
/* JS for HtmlBundle [61260:1258479] */
(function() {
    try {
        for(var bannerButtons,j,ogLink,newLink,banners=document.getElementsByClassName("banner"),i=0;i<banners.length;i++)if(bannerButtons=banners[i].getElementsByClassName("banner__button"),bannerButtons.length>0){var scriptContent=banners[i].parentElement.nextSibling.innerText,omnitureRef=scriptContent.toString().match(/(shop:.*)(?=","LazyLoad")/g)[0],omnitureArr=omnitureRef.split(":");for(j=0;j<bannerButtons.length;j++)ogLink=bannerButtons[j].pathname,ogLink.length>1&&(newLink=ogLink+="?ref="+omnitureRef.replace(/:/g,"%3a")+"&cl="+omnitureArr[omnitureArr.length-2]+"_"+omnitureArr[omnitureArr.length-1],bannerButtons[j].setAttribute("href",newLink))}
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1258479 }}, 'warning');
    }
})();

/* JS for HtmlBundle [60235:1514044] */
(function() {
    try {
        function updateCmsTabOrder(){const n=[...document.querySelectorAll(".banner")];n.forEach(function(n){var r=n.getElementsByTagName("a"),t,i;if(n.children.length>1&&r){t=n.querySelectorAll("a[data-type='bannerLink']:not(.banner__button)");for(i of t)removeTabFocus(i)}})}function removeTabFocus(n){return n.setAttribute("tabindex","-1")}for(var asteriskTitle,heroTitle,heroText,banner=document.querySelectorAll(".banner"),i=0;i<banner.length;i++)banner[i].innerHTML=banner[i].innerHTML.replace(/®/g,"<sup>®<\/sup>");for(asteriskTitle=document.querySelectorAll(".banner.main-banner"),i=0;i<asteriskTitle.length;i++)asteriskTitle[i].innerHTML=asteriskTitle[i].innerHTML.replace(/\*/g,"<sup class='asterisk'>*<\/sup>");for(heroTitle=document.querySelectorAll(".main-banner .banner__caption-title"),i=0;i<heroTitle.length;i++)heroTitle[i].innerHTML=heroTitle[i].innerHTML.replace(/50% off/gi,"<span style='white-space: nowrap;'>50% off<\/span>");for(heroText=document.querySelectorAll(".main-banner .banner__caption-text"),i=0;i<heroText.length;i++)heroText[i].innerHTML=heroText[i].innerHTML.replace(/Online./gi,"Online.<br>")
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1514044 }}, 'warning');
    }
})();

/* JS for HtmlBundle [61283:1541802] */
(function() {
    try {
        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 rotateAppMessages(n){for(var t=0;t<appSlides.length;t++)appSlides[t].classList.remove("active");appSlideIndex++;appSlideIndex=n;n>appSlides.length?appSlideIndex=1:n<1&&(appSlideIndex=appSlides.length);appSlides[appSlideIndex-1].classList.add("active");rotateApp()}function rotateApp(){appHasHover||appHasFocus?clearTimeout(appInterval):appHasHover&&appHasFocus||(clearTimeout(appInterval),appInterval=setTimeout(function(){rotateAppMessages(appSlideIndex+=1)},5e3))}function updateAppSlide(n){rotateAppMessages(appSlideIndex+=n);updateAppAria()}function updateAppAria(){var n=document.querySelector(".app-headband-slider__container");appHasFocus&&n.hasAttribute("aria-live")!=="polite"?n.setAttribute("aria-live","polite"):n.setAttribute("aria-live","off")}function addListeners(){document.getElementById("app-chevron--next").addEventListener("click",function(){updateAppSlide(1)});document.getElementById("app-chevron--prev").addEventListener("click",function(){updateAppSlide(-1)});var n=[].concat(_toConsumableArray(document.querySelectorAll(".app-headband-slider__message")),_toConsumableArray(document.querySelectorAll(".app-headband-button__chevron"))),t=["mouseover","mouseout","focusin","focusout"];n.forEach(function(n){t.forEach(function(t){n.addEventListener(t,function(n){n.type==="mouseover"?appHasHover=!0:n.type==="mouseout"?appHasHover=!1:n.type==="focusin"?(appHasFocus=!0,updateAppAria()):n.type==="focusout"&&(appHasFocus=!1,updateAppAria());rotateApp()})})})}function init(){document.body.className.indexOf("indigo-app")>-1&&(rotateAppMessages(appSlideIndex),addListeners())}var appInterval,appSlideIndex=1,appHasHover=!1,appHasFocus=!1,appSlides=document.getElementsByClassName("app-headband-slider__message");init()
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1541802 }}, 'warning');
    }
})();

/* JS for HtmlBundle [43947:1541804] */
(function() {
    try {
        function rotateMessages(n){for(var t=0;t<slides.length;t++)slides[t].classList.remove("active");slideIndex++;slideIndex=n;n>slides.length?slideIndex=1:n<1&&(slideIndex=slides.length);slides[slideIndex-1].classList.add("active");rotate()}function rotate(){hasHover||hasFocus?clearTimeout(interval):hasHover&&hasFocus||(clearTimeout(interval),interval=setTimeout(function(){rotateMessages(slideIndex+=1)},5e3))}function updateSlide(n){rotateMessages(slideIndex+=n);updateSlideAriaLive()}function updateSlideAriaLive(){var n=document.querySelector(".headband-slider__container");hasFocus&&n.hasAttribute("aria-live")!=="polite"?n.setAttribute("aria-live","polite"):n.setAttribute("aria-live","off")}function addSlideListeners(){["mouseenter","mouseleave","focusin","focusout"].forEach(function(n){document.querySelector(".headband__container").addEventListener(n,function(n){n.type==="mouseenter"?hasHover=!0:n.type==="mouseleave"?hasHover=!1:n.type==="focusin"?(hasFocus=!0,updateSlideAriaLive()):n.type==="focusout"&&(hasFocus=!1,updateSlideAriaLive());rotate()})});document.getElementById("chevron--next").addEventListener("click",function(){updateSlide(1)});document.getElementById("chevron--prev").addEventListener("click",function(){updateSlide(-1)})}function init(){slides.length>0&&document.querySelector(".header__marketing-messages")&&(rotateMessages(slideIndex),addSlideListeners())}var interval,slideIndex=1,hasHover=!1,hasFocus=!1,slides=document.getElementsByClassName("headband-slider__message");init()
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1541804 }}, 'warning');
    }
})();

/* JS for HtmlBundle [43644:1502735] */
(function() {
    try {
        function getCMSBreakpoint(){typeof window=="undefined"&&(global.window={});var t=function(n){var t=document.querySelector(n);return t&&window.getComputedStyle?window.getComputedStyle(t,":after"):!1},n=t(".breakpoints-for-cms");return n?n.getPropertyValue("content").replace(/"/g,""):"unknown"}prerequire.add(["jquery"],function(n){n(document).ready(function(){if(["Toys","Baby"].indexOf(n(".categoryBrowseHeader").text())>-1){var t=["Agendas","Art and Architecture","Biography and Memoir","Business and Finance","Computers","Entertainment","Family and Relationships","Fiction and Literature","Food and Drink","Health and Well Being","History","Home and Garden","Mystery and Suspense","Reference and Language","Religion and Spirituality","Romance","Science and Nature","Science Fiction and Fantasy","Social and Cultural Studies","Sports and Fitness","Travel","Reading Accessories","Action and Adventure","Alternative","Blues","Children's Music","Comedy","Comedy and Spoken Word","Country","Dramas","Easy Listening","Electronic","Folk","Foreign Films","Horror and Suspense","Jazz","Kids and Family","Miscellaneous","Musicals and Music","New Age","R&B and Soul","Rap and Hip-Hop","Reggae","Religious","Rock and Pop","Science Fiction and Fantasy","Soundtracks and Shows","Special Interests","Sports and Fitness","World","Tech Toys","Video Games & Consoles","Tech Accessories","Graphic Novels","Humour and Comedy"];n(".side_menu_nav > .categoryBrowse ul li a").each(function(){t.indexOf(n(this).text())>-1&&n(this).parent().hide()});n(".categoryBrowseHeader").text()==="Toys"&&n("li.selected span").text()==="Toys"&&n("li.selected span").parent().hide()}})});prerequire.add(["jquery","helperFunctions","emailSignup","BrowseCartApi","SandboxExports","$Cookies"],function(n,t,i,r,u){var o=function(){var n=appData.info.browseBase.split("://")[1];return new RegExp("^"+location.hostname.replace(/\./,"\\.")).test(n)}(),f="email-popup-cookie",e;o&&n.cookies.test()&&(e=u?u.constructor:exports.sandbox.constructor,n.cookies.get(f)===null&&location.href.indexOf("?EMS_SEG")===-1&&(t.openUrlInPopup(location.protocol+"/en-ca/email-signup-pop-up-blackfriday/",".embed_html",function(){var n=new e("merchEmailSingupSandbox",{shopPopup:r.showGenericPopup,membershipEmailSignUpUrl:appData.info.membershipEmailSignUpUrl,inputSelector:"#email",buttonSelector:"#emailSubmitBF"});i.init(n)}),n.cookies.set(f,!0,{domain:".indigo.ca",path:"/",expiresAt:new Date(2024,1,1)})))});prerequire.add(["jquery"],function(n){n(document).click(function(t){n(t.target).is("#usSubmit, .browsepopup-closebtn")&&(t.preventDefault(),n("#browseCart-genericPopup-wrapper").css("cssText","display:none !important;"))})})
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1502735 }}, 'warning');
    }
})();

/* JS for HtmlBundle [44145:1541359] */
(function() {
    try {
        (function(n){var t=escape(window.location.href||""),i=escape(n.referrer||""),r=Math.floor(Math.random()*999999999999),u=new Image;u.src="https://www.offlinx.com/alpha/tracking/pixel.gif?merchant_id=73ADB1C6572DE809&random_num="+r+"&referer="+i+"&href="+t})(window.document)
    } catch (e) {
        Bugsnag.notifyException(e, 'HtmlBundle JavaScript error', { 'info': { historyId: 1541359 }}, 'warning');
    }
})();
