"use strict";PULSE.app.templates["main-navigation.featured-link"]=_.template('
'),function(e,t,n,a){const o="is-fixed",i="is-hidden",s="is-active",r="menu-open",l="navigation-more-dropdown",c="search-open",d="sidebar-open",u="drop-down-open",m="with-overlay",v="u-body-fixed",g="ready";let y;e.MainNavigationWidget=function(n){const a=this;a.container=n,a.body=document.querySelector(".js-body-content"),a.navigation=document.querySelector(".navigation"),a.mainBody=document.querySelector("body"),a.menuButton=a.container.querySelector(".js-navigation-menu-button"),a.mainMenu=a.container.querySelector(".js-navigation-menu"),a.navList=a.container.querySelector(".js-nav-list"),a.mainMenuSecond=a.container.querySelector(".js-navigation-menu-second"),a.search=a.container.querySelector(".js-navigation-search"),a.searchOpen=a.container.querySelector(".js-navigation-search-open"),a.searchInput=a.container.querySelector(".js-navigation-search-input"),a.searchInputMobile=a.container.querySelector(".js-navigation-search-input-mobile"),a.searchButton=a.container.querySelector(".js-navigation-search-button"),a.sidebar=a.container.querySelector(".js-navigation-sidebar"),a.sidebarOpen=a.container.querySelector(".js-navigation-sidebar-open"),a.sidebarClose=[].slice.call(a.container.querySelectorAll(".js-navigation-sidebar-close")),a.sidebarMoreNav=a.container.querySelector(".js-navigation-sidebar-more-nav"),a.overlay=a.container.querySelector(".js-overlay"),a.userCtas=[].slice.call(a.container.querySelectorAll(".js-user")),a.boundToggleDropDown=a.toggleDropDown.bind(a),a.featuredLists=a.container.querySelectorAll(".js-featured-list"),a.scrollTop=document.documentElement.scrollTop,a.moreMenuLinks=a.container.querySelectorAll(".js-more-menu"),a.secondaryMenuLinks=a.container.querySelector(".js-secondary-nav-items"),a.searchPlaceholder=a.container.querySelector(".js-search-placeholder"),a.telstraBar=document.querySelector('[data-widget="telstra-bar"]'),a.menuOrdered=!1,a.titleBar=a.container.querySelector(".js-navigation-title-bar"),a.titleBarHeight=a.titleBar.offsetHeight,a.navPos=a.container.getBoundingClientRect().bottom+a.scrollTop,a.offset=a.navPos-a.container.getBoundingClientRect().top-a.titleBarHeight-a.scrollTop,a.navPosOffset=a.navPos-a.offset,a.timeout,window.innerWidth>e.measurements.tablet&&b.call(a),a.orderMenu(),a.initialiseMoreNav(),a.featuredLists.length&&a.initialiseFeaturedLink();e.authentication.isUserAuthenticated()&&t.style.addClass(a.container,"user-authenticated")},e.MainNavigationWidget.prototype.initialiseFeaturedLink=function(){const n=this;n.featuredLists.forEach((a=>{const o=a.querySelectorAll("[data-featured-link]");o&&o.length&&o.forEach((a=>{const o=a.dataset.featuredLink.split(","),i=o[0],s=o[1],r={label:a.dataset.label,tag:i,description:s};let l={url:e.common.url.createContentPath("photo",{tagNames:["menu-item-thumb",`menu-item-thumb:${i}`]}),method:"GET",callback:n.handleMenuResponse.bind(n,r,a),target:n};t.data.manager.add(l)}))}))},e.MainNavigationWidget.prototype.handleMenuResponse=function(n,a,o){if(o.content&&o.content.length>0){t.style.addClass(a,"drop-down__option--featured"),n.image=e.common.image.getOnDemandImageUrl(o.content[0],88,88);const i=e.templating.render(n,"main-navigation.featured-link");a.firstElementChild.innerHTML=i}},e.MainNavigationWidget.prototype.initialiseMoreNav=function(){const e=this;e.moreNav=new n.moreNav({navWrap:e.mainMenu,activeClass:"is-active",openClass:"is-open",hideClass:"is-hidden",showClass:"u-show",minTrigger:9,moreDropdownClass:l,moreButton:"",buildCallback:e=>this.buildCallback(e)});const a=e.container.querySelector(`.${l}`);a&&e.sidebarMoreNav.appendChild(a),e.setListeners(),t.style.addClass(e.mainMenu,g),t.style.addClass(e.mainMenuSecond,g)},e.MainNavigationWidget.prototype.buildCallback=function(e){if(!e||!e.config||!e.config.navs)return;let n=!1;e.config.navs.forEach((a=>{if(!t.style.hasClass(a,i)&&t.style.hasClass(a,"js-nav-move")){n=!0;const o=a.cloneNode(!0);e.moreNavs.dropdown.insertAdjacentElement("beforeend",o),t.style.addClass(a,i)}})),n&&t.style.addClass(this.navList,"showMoreEnabled")},e.MainNavigationWidget.prototype.setListeners=function(){const e=this;this.searchInputMobile&&(this.searchInputMobile.addEventListener("focus",(()=>{t.style.addClass(e.searchPlaceholder,a.U_HIDE)})),this.searchInputMobile.addEventListener("blur",(()=>{""===this.searchInputMobile.value&&t.style.removeClass(e.searchPlaceholder,a.U_HIDE)})),this.searchInputMobile.addEventListener("input",(n=>{""===n.target.value?(t.style.removeClass(e.searchPlaceholder,a.U_HIDE),t.style.removeClass(e.searchButton,s)):(t.style.addClass(e.searchPlaceholder,a.U_HIDE),t.style.addClass(e.searchButton,s))}))),this.menuButton.addEventListener("click",e.toggleMenu.bind(e)),this.sidebarOpen.addEventListener("click",e.toggleSidebar.bind(e)),this.sidebarClose.forEach((t=>{t.addEventListener("click",e.toggleSidebar.bind(e))})),this.searchOpen&&this.searchOpen.addEventListener("click",e.toggleSearch.bind(e)),this.userCtas.forEach((t=>{t.addEventListener("click",e.toggleUser.bind(e))})),this.setNavigationLinkListeners(),t.event.windowResize.add({method:e.setNavigationLinkListeners.bind(e)}),t.event.windowResize.add({method:e.orderMenu.bind(e)}),e.container.addEventListener("touchmove",(function(){t.style.hasClass(e.container,r)&&_.debounce(document.documentElement.scrollTop=0,100)})),document.body.addEventListener(a.NAV_CTA_EVENTS.SEARCH.OPEN,(()=>{h.call(e)})),document.body.addEventListener(a.NAV_CTA_EVENTS.SEARCH.CLOSE,(()=>{p.call(e)})),document.body.addEventListener(a.NAV_CTA_EVENTS.MENU.OPEN,(()=>{e.openSidebar()})),document.body.addEventListener(a.NAV_CTA_EVENTS.MENU.CLOSE,(()=>{e.closeSidebar()})),e.initCtaEventEngine(),this.stickyNav()},e.MainNavigationWidget.prototype.orderMenu=function(){const n=this,o=n.container.querySelector(".js-nav-move");if(window.innerWidth<=e.measurements.tablet&&!n.menuOrdered){n.menuOrdered=!0;const e=n.secondaryMenuLinks.cloneNode(!0);[].slice.call(e.children).forEach((e=>{o.insertAdjacentElement("beforebegin",e)})),t.style.addClass(n.secondaryMenuLinks,a.U_HIDE)}else if(window.innerWidth>e.measurements.tablet){n.menuOrdered=!1;[].slice.call(o.parentNode.querySelectorAll(".js-secondary-item")).forEach((e=>{e.parentNode.removeChild(e)})),t.style.removeClass(n.secondaryMenuLinks,a.U_HIDE)}},e.MainNavigationWidget.prototype.setNavigationLinkListeners=function(){const t=this;t.navigationLinks=[].slice.call(t.container.querySelectorAll(".js-navigation-link")),t.navigationLinks.length>0&&t.navigationLinks.forEach((e=>{e.removeEventListener("click",t.boundToggleDropDown),e.addEventListener("click",t.boundToggleDropDown)})),(window.innerWidth<=e.measurements.tablet&&!t.menuOrdered||window.innerWidth>e.measurements.tablet)&&f.call(t)},e.MainNavigationWidget.prototype.toggleMenu=function(){const n=this;n.overlay.style.marginTop=0,n.sidebar.style.marginTop=0,t.style.hasClass(n.container,r)?(t.style.removeClass(n.container,r),t.style.removeClass(n.telstraBar,"level-one"),C.call(n)):(t.style.addClass(n.container,r),t.style.addClass(n.telstraBar,"level-one"),e.common.event.dispatch(a.NAV_CTA_EVENTS.USER.CLOSE),E.call(n))},e.MainNavigationWidget.prototype.toggleDropDown=function(e){const n=this;t.style.hasClass(e.currentTarget,u)?t.style.removeClass(e.currentTarget,u):(n.navigationLinks.forEach((e=>{t.style.removeClass(e,u)})),t.style.addClass(e.currentTarget,u))},e.MainNavigationWidget.prototype.toggleSidebar=function(){t.style.hasClass(this.container,d)?e.common.event.dispatch(a.NAV_CTA_EVENTS.MENU.CLOSE):e.common.event.dispatch(a.NAV_CTA_EVENTS.MENU.OPEN)},e.MainNavigationWidget.prototype.toggleSearch=function(){t.style.hasClass(this.container,c)?e.common.event.dispatch(a.NAV_CTA_EVENTS.SEARCH.CLOSE):e.common.event.dispatch(a.NAV_CTA_EVENTS.SEARCH.OPEN)},e.MainNavigationWidget.prototype.toggleUser=function(){t.style.hasClass(this.container,a.USER_MENU_OPEN_CLASS)?e.common.event.dispatch(a.NAV_CTA_EVENTS.USER.CLOSE):e.common.event.dispatch(a.NAV_CTA_EVENTS.USER.OPEN)},e.MainNavigationWidget.prototype.closeSidebar=function(){t.style.removeClass(this.container,d),t.style.removeClass(this.telstraBar,"level-one"),document.body.style.overflowY="auto"},e.MainNavigationWidget.prototype.openSidebar=function(){const e=this;e.overlay.style.marginTop=0,e.sidebar.style.marginTop=0;const n=e.overlay.getBoundingClientRect().top,a=e.sidebar.getBoundingClientRect().top-e.mainMenu.offsetHeight;n>0&&(e.overlay.style.marginTop=`-${n}`),e.sidebar.style.marginTop=`-${a}`,t.style.addClass(e.container,d),document.body.style.overflowY="hidden",t.style.addClass(e.telstraBar,"level-one")},e.MainNavigationWidget.prototype.stickyNav=function(){const n=this;t.event.windowOnScroll.add({method:()=>{n.scrollTop>document.documentElement.scrollTop&&window.scrollY>n.navPos||window.scrollY>n.navPosOffset&&window.scrollY