1window.module=window.module||{},module.Global=(function(){var timer,cache2={},selectors={body:"body",pageContainer:".page-container",addToBagForms:"form[action='/cart/add']:not(.noAjax)",patternInputs:"[pattern]",header:".header__actionmenu",itemAddedClass:".item-added__container",itemAddedClose:".item-added__close",quantityButton:".product-quantity__button",headerTop:"[data-section-id='theme_heading']",headerBottom:"[data-section-id='theme_header']"};function cacheSelectors(){cache2={$body:$(selectors.body),$container:$(selectors.pageContainer),$header:$(selectors.header),$didScroll:!1,$lastScrollTop:0,$delta:120,$headerTotalHeight:$(selectors.headerTop).outerHeight()+$(selectors.headerBottom).outerHeight()}}function init(){cacheSelectors(),cache2.$container.on("click",function(e){module.Header.closeSearch(!1),module.Navigation.close(!1)}),$(document).on("click",selectors.quantityButton,function(e){e.preventDefault();var $quantity=$(this).parent().find("[name='quantity']");$(this).hasClass("product-quantity__button--up")?$quantity.val(parseInt($quantity.val())+1):$quantity.val($quantity.val()==1?1:$quantity.val()-1)}),$(document).on("click",selectors.itemAddedClose,function(e){e.preventDefault(),clearTimeout(timer),$(selectors.itemAddedClass).remove()}),$(document).on("submit",selectors.addToBagForms,function(e){e.preventDefault(),theme.Shopify.addItemFromForm($(this))}),$(document).on("keydown",selectors.patternInputs,function(e){if(e.keyCode<48)return!0;if(!e.key.match("^"+$(this).attr("pattern")+"$"))return!1}),$(window).scroll(function(event){cache2.$didScroll=!0}),setInterval(function(){cache2.$didScroll&&(hasScrolled(),cache2.$didScroll=!1)},250),$("[data-scroll-speed]").length>0&&$("[data-scroll-speed]").moveIt(),autoAddProduct()}function hasScrolled(){var st=$(this).scrollTop();Math.abs(cache2.$lastScrollTop-st)<=cache2.$delta||(st>cache2.$lastScrollTop&&st>cache2.$headerTotalHeight||st>cache2.$lastScrollTop&&st<cache2.$headerTotalHeight?cache2.$body.removeClass("scroll-up").addClass("scroll-down"):(st+$(window).height()<$(document).height()&&cache2.$body.removeClass("scroll-down").addClass("scroll-up"),st<=10&&cache2.$body.removeClass("scroll-up").removeClass("scroll-down")),cache2.$lastScrollTop=st)}function buildItemAdded(product,quantity,line_item){if(autoAddProduct(),$(selectors.itemAddedClass).remove(),$(window).width()>theme.breakpoint){var string=" <div class='item-added__container'> <div class='item-added__container--padding'> <div class='item-added__header'> Item Added <button class='item-added__close text-link'> <span class='visually-hidden'>Close Popup</span> <i class='fas fa-times' aria-hidden='true'></i> </button> </div> <div class='item-added__product'> <div class='item-added__product-image'> <img src='"+product.images[0]+"' alt='' /> </div><!-- --><div class='item-added__product-info'> <label class='item-added__product-info--title'>"+product.product_title+"</label> <label class='item-added__product-info--type'>"+product.product_type+"</label> <div class='item-added__product-info--price-container'>";typeof product.regularPrice!="undefined"&&(string+="<label class='item-added__product-info--compare'>"+product.regularPrice+"</label>"),line_item&&line_item.properties&&line_item.properties.gift?string+="<label class='item-added__product-info--price'>FREE</label>":string+="<label class='item-added__product-info--price'>"+theme.utils.formatMoney(product.price)+"</label>",string+=" </div> <label class='item-added__product-info--quantity'>Qty: "+quantity+"</label> </div> </div> <div class='item-added__actions'> <a class='btn btn--secondary' href='/cart'>View Bag</a>",product.cart.total>theme.domesticShipping?string+="<p class='item-added__actions-shipping'>You've qualified for free domestic shipping</p>":string+="<p class='item-added__actions-shipping'>Spend "+theme.utils.formatMoney(theme.domesticShipping-product.cart.total)+" more and get free shipping</p>",string+=" </div> </div>",typeof product.upsell!="undefined"&&(string+=" <div class='item-added__upsell'> <div class='item-added__container--padding'> <div class='item-added__upsell-title'> Best Paired With </div><!-- --><div class='item-added__upsell-product'> <div class='item-added__upsell-product-image'> <img src='"+product.upsell.image+"' alt='' /> </div> </div> </div>"),string+=" </div> </div>",cache2.$header.prepend(string)}else{var string=" <div class='item-added__container item-added__container--mobile'> <div class='item-added__container--padding'> <div class='item-added__header'>Item Added</div><!-- --><div class='item-added__product'> <div class='item-added__product-image'> <img src='"+product.images[0]+"' alt='' /> </div><!-- --><div class='item-added__product-info'> <label class='item-added__product-info--title'>"+product.product_title+"</label> <div class='item-added__product-info--price-container'>";typeof product.regularPrice!="undefined"&&(string+="<label class='item-added__product-info--compare'>"+theme.utils.formatMoney(product.regularPrice)+"</label>"),string+=" <label class='item-added__product-info--price'>"+theme.utils.formatMoney(product.price)+"</label> </div> </div> </div><!-- --><div class='item-added__actions'>",product.cart.total>
1theme.domesticShipping?string+="<p class='item-added__actions-shipping'>You've qualified for free domestic shipping</p>":string+="<p class='item-added__actions-shipping'>Spend "+theme.utils.formatMoney(theme.domesticShipping-product.cart.total)+" more and get free shipping</p>",string+=" </div> </div> </div> </div>",cache2.$body.prepend(string)}clearTimeout(timer),timer=setTimeout(function(){$(selectors.itemAddedClass).remove()},5e3)}function autoAddProduct(){if(!theme.activate_auto_product&&!theme.automatic_product_promo.active)return!1;theme.Shopify.getCart(function(cart){if(theme.activate_auto_product){var carton_count=0,drip_count=0;$.each(cart.items,function(index,product){product.product_type=="Unit Carton"?carton_count+=1:$.each(product.tags,function(i,tag){tag=="#.promo:dripdrop3"?drip_count+=3:tag=="#.promo:dripdrop"&&(drip_count+=product.quantity)})}),drip_count>=3&&carton_count==0&&(theme.environment=="stg"?theme.Shopify.addItem(20521282142319,1,{},function(){return!1}):theme.environment=="live"&&theme.Shopify.addItem(22488501616758,1,{},function(){return!1}))}if(theme.automatic_product_promo.active){var promo_product_quantity=0,trigger_product_quantity=0;theme.automatic_product_promo.type=="price"&&cart.total_price_cents>=theme.automatic_product_promo.min_price?($.each(cart.items,function(index,product){product.tags.indexOf(theme.automatic_product_promo.promo_tag)>-1&&product.discounted_price!=product.original_price&&(promo_product_quantity+=product.quantity)}),promo_product_quantity<theme.automatic_product_promo.max_quantity&&(theme.environment=="stg"?theme.Shopify.addItem(theme.automatic_product_promo.variant.stg,1):theme.environment=="live"&&theme.Shopify.addItem(theme.automatic_product_promo.variant.live,1))):theme.automatic_product_promo.type=="product"&&($.each(cart.items,function(index,product){product.tags.indexOf(theme.automatic_product_promo.promo_tag)>-1&&(promo_product_quantity+=product.quantity),product.handle==theme.automatic_product_promo.trigger_handle&&(trigger_product_quantity+=product.quantity)}),trigger_product_quantity>0&&promo_product_quantity<theme.automatic_product_promo.max_quantity&&(theme.environment=="stg"?theme.Shopify.addItem(theme.automatic_product_promo.variant.stg,1,{gift:1}):theme.environment=="live"&&theme.Shopify.addItem(theme.automatic_product_promo.variant.live,1,{gift:1})))}}),theme.pathname=="/cart"&&theme.Shopify.getCart(module.Cart.updateCartValues)}return{init:init,buildItemAdded:buildItemAdded,autoAddProduct:autoAddProduct}})(),window.module=window.module||{},module.HomepageSignup=(function(){var selectors={container:"#homepage-signup",signupForm:"#popup-signup__form"};function cacheSelectors(){cache={$container:$(selectors.container)}}function init(){cacheSelectors(),KlaviyoSubscribe.attachToForms(selectors.signupForm,{hide_form_on_success:!1,success:function($form){$(selectors.signupForm).html("<p class='signup__complete'>You're in! Use code <b>TYSM</b><br/>for $5 off your skin care shopping spree.</p>")}}),theme.utils.readCookie("fourthray_newsletter")||setTimeout(function(){$.fancybox.open({src:selectors.container,arrows:!1,infobar:!1,toolbar:!1,opts:{afterShow:function(instance,current){theme.utils.createCookie("fourthray_newsletter","x",7776e6)}}})},1e3)}return{init:init}})(),window.module=window.module||{},module.FeaturedCollection=(function(){var cache2={},selectors={container:".featured-collection__carousel"};function cacheSelectors(){cache2={$container:$(selectors.container),$slideshow:""}}function init(){cacheSelectors(),cache2.$slideshow==""&&(cache2.$slideshow=cache2.$container.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:2},800:{items:4}}}))}return{init:init}})(),window.module=window.module||{},module.CollectionListing=(function(){var cache2={},selectors={container:".collection-listing__carousel"};function cacheSelectors(){cache2={$container:$(selectors.container),$slideshow:""}}function init(){cacheSelectors(),cache2.$slideshow==""&&(cache2.$slideshow=cache2.$container.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:2},800:{items:3}}}
1))}return{init:init}})(),window.module=window.module||{},module.Slideshow=(function(){var cache2={},selectors={items:".slideshow__item",container:"#slideshow"};function cacheSelectors(){cache2={$container:$(selectors.container),$items:$(selectors.items),$slideshow:null}}function init(){cacheSelectors(),cache2.$items.length>1&&(cache2.$slideshow=cache2.$container.owlCarousel({autoplay:!0,autoplayTimeout:7e3,loop:!0,margin:0,nav:!0,dots:!1,items:1}))}return{init:init}})(),window.module=window.module||{},module.Heading=(function(){var cache2={},selectors={items:".announcement-bar__message",container:".heading__center"};function cacheSelectors(){cache2={$container:$(selectors.container),$items:$(selectors.items),$announcementBar:null}}function init(){cacheSelectors(),cache2.$items.length>1&&(cache2.$announcementBar=cache2.$container.owlCarousel({autoplay:!0,autoplayTimeout:7e3,autoplayHoverPause:!1,loop:!0,nav:!1,dots:!1,items:1,animateOut:"slideOutUp",animateIn:"flipInX",mouseDrag:!1}))}return{init:init}})(),window.module=window.module||{},module.Header=(function(){var cache2={}
1,selectors={pageContainer:".page-container",container:".header",hamburger:".hamburger",searchButton:".action__search",closeSearch:".header__search-bar--close",searchBar:".header__search-bar--container",searchForm:".header__search-bar--form",searchInput:"#header__search-bar--input",searchResults:".header__search-results"},config={openClass:"open"};function cacheSelectors(){cache2={$container:$(selectors.container),$hamburger:$(selectors.hamburger),$searchButton:$(selectors.searchButton),crisps:Crisp.Search({query:"",template:"crisp",exact:!1,types:["product"]})}}function init(){cacheSelectors(),cache2.$hamburger.on("click",function(){$(this).hasClass(config.openClass)?(module.Navigation.close(),$(this).removeClass(config.openClass)):(module.Navigation.open(),$(this).addClass(config.openClass))}),cache2.$searchButton.on("click",openSearch),$(document).on("click",selectors.closeSearch,function(){closeSearch(!0)})}function closeSearch(isButton){slate.a11y.removeTrapFocus({$container:$(selectors.searchBar),namespace:"searchbar"}),$(selectors.searchBar).remove(),$(selectors.searchResults).remove(),isButton&&cache2.$searchButton.focus()}function openSearch(){module.Navigation.close(!1);var string="<div class='header__search-bar--container'> <label class='visually-hidden'>Search bar</label> <form class='header__search-bar--form' action='/search' method='get' _lpchecked='1'> <input type='hidden' name='type' value='product'> <div class='header__search-bar--left'> <label for='header__search-bar--input' class='visually-hidden'>Search</label> <input type='text' name='q' id='header__search-bar--input' placeholder=\"Type what you're looking for\" /> </div> <div class='header__search-bar--right'> <button class='header__search-bar--submit'> <span class='visually-hidden'>Submit</span> </button> </div> </form> <button class='header__search-bar--close visually-hidden'>Close Search Bar</button> </div>";cache2.$container.prepend(string),slate.a11y.trapFocus({$container:$(selectors.searchBar),$elementToFocus:$(selectors.searchInput),namespace:"searchbar"}),$(selectors.searchInput).keyup(function(e){var search_val=$(this).val().toLowerCase();search_val.length>2?(cache2.crisps.setQuery(decodeURIComponent(search_val)),cache2.crisps.preview({number:5,callback:function(r){if(r.error){if(Crisp.isCancel(r.error))return;throw new Error("Could not fetch products")}if($(".header__search-results").remove(),r.payload.length>0){var string2="<div class='header__search-results'>";$.each(r.payload,function(index,product){product.hidden||(string2+="<div class='header__search-result'> <a href='/products/"+product.handle+"'> <img class='header__search-result--image' src='"+product.images[0]+"' alt=''><div class='header__search-result--info'> <label class='header__search-result--title'>"+product.product_title+"</label> <label class='header__search-result--type'>"+product.product_type+"</label> </div> </a> </div>")}),string2+="</div>",cache2.$container.prepend(string2)}}})):$(".header__search-results").remove()}),$(selectors.searchForm).children().on("click",function(e){e.stopPropagation()})}function resetHamburger(){cache2.$hamburger.removeClass(config.openClass)}function focusHamburger(){cache2.$hamburger.focus()}return{init:init,focusHamburger:focusHamburger,resetHamburger:resetHamburger,closeSearch:closeSearch}})(),window.module=window.module||{},module.Navigation=(function(){var cache2={},selectors={container:'[data-section-type="navigation-section"]',closeButton:".navigation--close",firstElement:".mainmenulabel",headerLink:".navigation__list lh"};function cacheSelectors(){cache2={$closeButton:$(selectors.closeButton),$container:$(selectors.container),$firstElement:$(selectors.firstElement),$headerLink:$(selectors.headerLink)}}function init(){cacheSelectors(),cache2.$closeButton.click(function(){closeNavigation(!0)}),cache2.$container.children().on("click",function(e){e.stopPropagation()}),cache2.$headerLink.on("click",headerLinkHandler)}function headerLinkHandler(e){if($(this).hasClass("navigation__layer--parent")){e.preventDefault();
1var $parent=$(this).closest(".navigation__list");$parent.toggleClass("open")}}function openNavigation(){cache2.$container.show(),cache2.$container.animate({left:"0%"},300,function(){slate.a11y.trapFocus({$container:cache2.$container,$elementToFocus:cache2.$container.find("a").first(),namespace:"navigation"})})}function closeNavigation(button){cache2.$container.animate({left:"-30%"},300,function(){cache2.$container.hide()}),slate.a11y.removeTrapFocus({$container:cache2.$container,namespace:"navigation"}),module.Header.resetHamburger(),button&&module.Header.focusHamburger()}return{init:init,open:openNavigation,close:closeNavigation}})(),window.module=window.module||{},module.Product=(function(){var cache2={},selectors={floatingContainer:".product__floating-container",floatingImage:".product__floating-image",imageCarousel:".product__image-carousel",floatingRemove:".product__float--remove-height",stepsCarousel:".product__steps",mobileSuggestedButton:".product__video-text--button",mobileSuggestedText:".product__video-text--text",iconCarousel:".product__icons-carousel",childCarousel:".child__floating-image-carousel",childTab:".children__tab",children:".child",childInstructions:".child__instructions",childSelect:".children-select",ingredTruncate:".product__ingred.truncated",ingredExpanded:".product__ingred.expanded",emailMe:".product-action__email button",oos:"#oos-popup",oos_show:".product-action__oos",oos_title:".oos-popup__title",oos_button:".oos-popup__button",oos_signup:".oos-popup__checkbox",oos_email:".oos-popup__email",oos_success:".oos-popup__success"};function cacheSelectors(){cache2={$floatingContainer:$(selectors.floatingContainer),$floatingImage:$(selectors.floatingImage),$imageCarousel:$(selectors.imageCarousel),$floatingRemove:$(selectors.floatingRemove),$stepsCarousel:$(selectors.stepsCarousel),$mobileSuggestedButton:$(selectors.mobileSuggestedButton),$mobileSuggestedText:$(selectors.mobileSuggestedText),$iconCarousel:$(selectors.iconCarousel),$ingredTruncate:$(selectors.ingredTruncate),$ingredExpanded:$(selectors.ingredExpanded)}}function cacheChildren(){cache2.$childrenCarousel=$(".product__children-carousel"),cache2.$childCarousel=$(selectors.childCarousel),cache2.$childTab=$(selectors.childTab),cache2.$children=$(selectors.children),cache2.$childInstructions=$(selectors.childInstructions),cache2.$childSelect=$(selectors.childSelect)}function init(){if(cacheSelectors(),$(selectors.childCarousel).length>0&&(cacheChildren(),cache2.$childCarousel=cache2.$childCarousel.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!0,autoWidth:!0,center:!0,items:1}),cache2.$childrenCarousel.length>0&&cache2.$childrenCarousel.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!1,dots:!0,autoWidth:!1,center:!0,items:3}),cache2.$childSelect.on("change",handleTabChange),cache2.$childTab.on("click",handleTabChange),cache2.$childTab.first().click()),cache2.$imageCarousel.owlCarousel({autoplay:!1,loop:cache2.$imageCarousel.children().length>1,margin:0,nav:!0,dots:!0,autoWidth:!0,center:!0,items:1}),cache2.$iconCarousel.each(function(){$(this).children().length>3?$(this).owlCarousel({autoplay:!1,loop:cache2.$iconCarousel.children().length>3,margin:0,nav:!1,dots:!0,autoWidth:!1,center:!0,items:3}):($(this).removeClass("owl-carousel"),$(this).removeClass("owl-theme"))}),theme.viewWidth<=800){var position=cache2.$stepsCarousel.data("position");cache2.$stepsCarousel.owlCarousel({autoplay:!1,autoplayHoverPause:!0,startPosition:position,loop:!1,nav:!1,dots:!1,autoWidth:!0,center:!0})}else cache2.$stepsCarousel.owlCarousel({autoplay:!1,autoplayHoverPause:!0,loop:!0,nav:!1,dots:!1,autoWidth:!0,center:!1});getFloatingData(),cache2.$mobileSuggestedButton.on("click",function(e){e.preventDefault(),$(this).hasClass("open")?($(this).removeClass("open"),cache2.$mobileSuggestedText.stop().slideUp("fast")):($(this).addClass("open"),cache2.$mobileSuggestedText.stop().slideDown("fast"))}),cache2.$ingredExpanded.hide(),$(document).on("click",".readmore",readMoreHandle),$(document).on("click",selectors.oos_show,showOOSPopup),$(document).on("click",selectors.oos_button,bindOOSbutton)}function bindOOSbutton(e){e.preventDefault();var email=$(selectors.oos_email).val(),variant=theme.product.variant_id,signup=$(selectors.oos_signup).prop("checked"),data={email:email,variant:variant,signup:signup};$.ajax({url:"https://colourpop-usps.azurewebsites.net/api/HttpTriggerFRKlaviyoBIS",type:"POST",data:JSON.stringify(data),contentType:"application/json",dataType:"json",complete:function(r){$(selectors.oos_success).show(),setTimeout(function(){$.fancybox.close(),$(selectors.oos_success).hide()},3e3)}})}
1function showOOSPopup(e){e.preventDefault(),$(selectors.oos_title).html(theme.product.title),$.fancybox.open({src:selectors.oos,arrows:!1,infobar:!1,toolbar:!1})}function readMoreHandle(){$(".product__ingred.expanded").is(":visible")?($(".product__ingred.truncated").show(),$(".product__ingred.expanded").slideUp(),$(this).html("Read more"),$(".product__video-container").addClass("up"),$(".product__video-container").removeClass("down"),$("html, body").animate({scrollTop:$(".product__display--ingredients").offset().top-200},300)):($(".product__ingred.truncated").hide(),$(".product__ingred.expanded").show(),$(this).html("Read less"),$(".product__video-container").addClass("down"),$(".product__video-container").removeClass("up"),$("html, body").animate({scrollTop:$(".product__display--ingredients").offset().top+200},300))}function handleTabChange(e){if(e.preventDefault,$(this).is("select"))var handle=$(this).val();else{if($(this).hasClass("active"))return!1;var handle=$(this).attr("data-handle")}$(selectors.childTab).removeClass("active"),cache2.$children.hide(),cache2.$childInstructions.hide(),$(selectors.children+"[data-handle='"+handle+"']").show(),$(selectors.childInstructions+"[data-handle='"+handle+"']").show(),$(selectors.childTab+"[data-handle='"+handle+"']").addClass("active"),theme.wow.scrollHandler()}function getFloatingData(){cache2.floatingHeight=cache2.$floatingImage.height(),cache2.containerHeight=cache2.$floatingContainer.height()}function repositionImage(){var topScroll=$(this).scrollTop(),fromBottom=cache2.containerHeight-(topScroll+cache2.floatingHeight);fromBottom>0?cache2.$floatingImage.css("top",topScroll):cache2.$floatingImage.css("top","calc(100% - 50px - "+cache2.$floatingRemove.height()+"px)")}return{init:init}})(),window.module=window.module||{},module.ProductNew=(function(){var cache2={$details_container:$(".product-details"),$floating_container:$(".product-details__floating"),$story_tab:$(".product-story__desktop-tab"),$story_tab_mobile:$(".product-story__mobile-tab"),$story_child:$(".product-story__children"),$story_title:$(".product-story__block-title:not(.text-link)"),$complete_your_look:$(".product-complete__container"),$complete_your_look_container:$(".product-complete"),$images:$(".product-images__carousel--mobile"),$children:$(".product-details__children-carousel"),$dot_container:$(".product-images__dots"),active_dot:0,$quantity_box:$(".product-actions__quantity--input"),$quantity_up:$(".product-actions__quantity--up"),$quantity_down:$(".product-actions__quantity--down")},selectors={action_button:".product-actions__buttons",dots:".product-images__dot",product_images_desktop:".product-images__carousel--desktop .product-image",floating_container:".product-details__floating",product_right_container:".product-details__right",upsell:".product-details__upsell-container",upsell_banner:".banner-upsell",ingredients:".product-story__ingredients",shade_description:".product-details__mvp-description",children_container:".product-details__children",oos:"#oos-popup",oos_show:".product-actions__buttons--out-of-stock",oos_title:".oos-popup__title",oos_button:".oos-popup__button",oos_signup:".oos-popup__checkbox",oos_email:".oos-popup__email",oos_success:".oos-popup__success"};function calculateFloatingPosition(){var container_height=cache2.$details_container.height(),header_height=102,distance_from_top=$(this).scrollTop();$(selectors.floating_container).each(function(){var floating_height=$(this).height();$(this).hasClass("product-images__dots")&&(floating_height+=360),floating_height+distance_from_top-header_height+40>container_height?$(this).addClass("bottom-reached"):$(this).removeClass("bottom-reached")})}function init(container){return cache2.$quantity_down.on("click",decreaseQuantity),cache2.$quantity_up.on("click",increaseQuantity),$(window).on("scroll",checkViewportImage),$(window).on("scroll",calculateFloatingPosition),$(window).trigger("scroll"),$(document).on("click",selectors.oos_show,showOOSPopup),$(document).on("click",selectors.oos_button,bindOOSbutton),cache2.$story_title.on("click",toggleStoryRow),cache2.$story_tab.length>0&&(cache2.$story_tab_mobile.on("change",showChildStory),cache2.$story_tab.on("click",
1showChildStory),cache2.$story_tab.first().click()),cache2.$images.owlCarousel({autoplay:!1,autoplayHoverPause:!0,loop:!0,nav:!0,dots:!0,autoWidth:!0,center:!0,items:1}),cache2.$children.length>0&&cache2.$children.owlCarousel({autoplay:!1,autoplayHoverPause:!0,loop:!1,nav:!0,dots:!1,responsive:{0:{items:2},768:{items:3}}}),cache2.$complete_your_look.length>0&&(cache2.$complete_your_look.find(".owl-carousel").owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:2},800:{items:4}}}),cache2.$complete_your_look_container.show()),$(".product-actions__packaging--input").on("change",handleGroupChange),$(".product-actions__packaging--input").length>0&&$(".product-actions__packaging--input").first().trigger("change"),!0}function handleGroupChange(){var product_data=theme.products[$(this).val()];$(".product-info__price--sale").html(product_data.sale_price),$(".packaging_id").val(product_data.variant_id),$("#net_weight").html(product_data.net_weight)}function decreaseQuantity(e){e.preventDefault();var current_quantity=parseInt(cache2.$quantity_box.val());current_quantity<=1?cache2.$quantity_box.val(1):cache2.$quantity_box.val(current_quantity-1)}function increaseQuantity(e){e.preventDefault(),cache2.$quantity_box.val(parseInt(cache2.$quantity_box.val())+1)}function checkViewportImage(){$(selectors.product_images_desktop).each(function(){if($(this).isInViewport()){var position=$(this).attr("data-position");return cache2.active_dot!=position&&(cache2.active_dot=position,$(selectors.dots).removeClass("product-images__dot--active"),$(selectors.dots).filter("[data-position='"+position+"']").addClass("product-images__dot--active")),!1}})}function buildCompleteYourLook(){cache2.$complete_your_look.empty(),jQuery.getJSON("/recommendations/products.json?product_id="+theme.product.product_id,function(response){theme.Shopify.getProducts(response.products).then(function(products){var string=" <div class='featured-collection__carousel owl-carousel owl-theme'>";$.each(products,function(index,product){string+=" <div class='featured-collection__item'> <div class='product-card'> <div class='product-card__img'> <a href='"+product.url+"' > <img id='"+product.id+"' src='"+product.images[0]+"' alt='"+product.title+"' /> </a> </div> <div class='product-card__info'> <label class='product-card__title'>"+product.product_title+"</label> <label class='product-card__type'>"+product.product_type+"</label> <label class='product-card__price'>",typeof product.regularPrice!="undefined"&&(string+="<span class='visually-hidden'>Original Price:</span><strike class='product-card__price--sale'>"+product.regularPrice+"</strike>",""+product.regularPrice),string+="<span class='visually-hidden'>Sale Price:</span> "+product.price+" </label> <div class='yotpo bottomLine product-card__reviews' data-product-id='"+product.id+"'></div> </div> </div> </div>"}),string+=" </div>",cache2.$complete_your_look.append(string),cache2.$complete_your_look.find(".owl-carousel").owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:2},800:{items:4}}}),cache2.$complete_your_look_container.show()})})}function toggleStoryRow(){$(this).parent().toggleClass("open")}function showChildStory(){if($(this).is("select"))var child_handle=$(this).val();else var child_handle=$(this).attr("data-child-handle");$(this).hasClass("active")||(cache2.$story_tab.attr("aria-selected",!1),cache2.$story_tab.removeClass("active"),cache2.$story_tab.filter("[data-child-handle='"+child_handle+"']").addClass("active"),cache2.$story_tab.filter("[data-child-handle='"+child_handle+"']").attr("aria-selected",!0),cache2.$story_child.hide(),cache2.$story_child.filter("[data-child-handle='"+child_handle+"']").show())}function bindOOSbutton(e){e.preventDefault();var email=$(selectors.oos_email).val(),variant=theme.product.variant_id,signup=$(selectors.oos_signup).prop("checked"),data={email:email,variant:variant,signup:signup};$.ajax({url:"https://colourpop-usps.azurewebsites.net/api/HttpTriggerFRKlaviyoBIS",type:"POST",data:JSON.stringify(data),contentType:"application/json",dataType:"json",complete:function(r){$(selectors.oos_success).show(),setTimeout(function(){$.fancybox.close(),$(selectors.oos_success).hide()},3e3)}})}
1function showOOSPopup(e){e.preventDefault(),$(selectors.oos_title).html(theme.product.title),$.fancybox.open({src:selectors.oos,arrows:!1,infobar:!1,toolbar:!1})}return{init:init}})(),window.module=window.module||{},module.Cart=(function(){var cache2={},selectors={form:".cart__container",productContainer:".cart__products",rowRemove:".cart__product--remove",rowQuantity:".cart__product-quantity--input",discount:".cart__summary-discount--text",total:".cart__value--total"};function cacheSelectors(){cache2={$form:$(selectors.form),$productContainer:$(selectors.productContainer),$rowRemove:$(selectors.rowRemove),$rowQuantity:$(selectors.rowQuantity),$discount:$(selectors.discount),$total:$(selectors.total)}}function init(){cacheSelectors(),$(document).on("click",selectors.rowRemove,removeRow),$(document).on("change",selectors.rowQuantity,changeRow),cache2.$discount.on("click",function(e){$(this).toggleClass("open")}),theme.Shopify.getCart(updateCartValues)}function removeRow(e){e.preventDefault();var row=$(this).attr("data-row");theme.Shopify.removeRow(row,module.Global.autoAddProduct)}function changeRow(e){e.preventDefault();var row=$(this).attr("data-row"),quantity=$(this).val();module.Global.autoAddProduct(),theme.Shopify.changeRow(row,quantity,module.Global.autoAddProduct)}function updateCartValues(cart){$(".hover-cart-count").html(cart.item_count),cart.items.length==0?cache2.$productContainer.html(" <div class='cart__product cart__product--empty'> <p>Your cart is currently empty.</p> </div>"):(cache2.$productContainer.html(" <div class='cart__product cart__product--header hidemobile'> <div class='cart__product-info'>Item</div><!-- --><div class='cart__product-price'>Price</div><!-- --><div class='cart__product-quantity'>Qty</div><!-- --><div class='cart__product-total'>Total</div> </div>"),$.each(cart.items,function(index,product){var string=" <div class='cart__product' data-row='"+(index+1)+"' data-handle='"+product.handle+"'> <div class='cart__product-info'> <div class='cart__product-info--image'> <img src='"+product.image+"' alt='' /> </div> <div class='cart__product-info--text'> <label class='cart__product-info--title'>"+product.product_title+"</label> <label class='cart__product-info--type'>"+product.product_type+"</label> <label class='cart__product-info--price showmobile'><span class='bold'>Price</span> "+theme.utils.formatMoney(product.discounted_price)+"</label> <label class='cart__product-info--subtotal showmobile'><span class='bold'>Subtotal</span> "+theme.utils.formatMoney(product.line_price)+"</label> </div> </div><!-- --><div class='cart__product-price hidemobile'>";product.discounted_price!=product.original_price&&(string+=" <span class='visually-hidden'>Regular Price: </span> <span class='cart__product-price--compare'>"+theme.utils.formatMoney(product.original_price)+"</span>"),string+=" <span class='visually-hidden'>Sale Price: </span> <span class='cart__product-price--sale'>"+theme.utils.formatMoney(product.discounted_price)+"</span> </div><!-- --><div class='cart__product-quantity'> <span class='visually-hidden'>Quantity: </span> <input type='text' data-row='"+(index+1)+"' class='cart__product-quantity--input' maxlength='2' pattern='[0-9]' name='updates[]' value='"+product.quantity+"' /> </div><!-- --><div class='cart__product-total hidemobile'> <span class='visually-hidden'>Total Price: </span> <span class='cart__product-price--sale'>"+theme.utils.formatMoney(product.line_price)+"</span> </div> <button data-row='"+(index+1)+"' class='cart__product--remove text-link'> <span class='visually-hidden'>Remove Item</span> <i class='fal fa-times' aria-hidden='true'></i> </button> </div>",cache2.$productContainer.append(string)})),cache2.$total.html(cart.total_price)}return{init:init,updateCartValues:updateCartValues}})(),window.module=window.module||{},module.IngredientGlossary=(function(){var cache2={},data={},selectors={lists:".glossary__list"};function cacheSelectors(){cache2={$headerContent:$(".glossary__header p"),$readmore:$(".glossary__read-more"),$lists:$(".glossary__list"),$desktopLetters:$(".glossary__letters--desktop"),$content:$(".glossary__content"),$bottom:$(".glossary__content--bottom"),$glossary:$(".glossary__letter"),$mobileCarousel:$(".glossary__letters--carousel")}}
1function init(){cacheSelectors(),cache2.$readmore.click(function(){cache2.$headerContent.toggleClass("open"),cache2.$headerContent.height()==93?cache2.$headerContent.animate({height:cache2.$headerContent[0].scrollHeight}):cache2.$headerContent.animate({height:93})}),theme.ingredients.length>0&&(buildIngredientList(),storePositionData(),cache2.$glossary.on("click",scrollToSection),$(window).width()>theme.breakpoint?($(window).on("scroll",moveGlossary),$(window).on("scroll",highlightLetterDesktop)):(cache2.$mobileCarousel.owlCarousel({autoplay:!1,loop:!1,nav:!1,dots:!1,autoWidth:!0,center:!1}),$(window).on("scroll",highlightLetterMobile))),theme.hash!=""&&$(".glossary__letter[data-letter='"+theme.hash.toLowerCase()+"']").click()}function highlightLetterMobile(){var scrollTop=$(window).scrollTop()+132,windowHeight=$(window).height();cache2.$lists.each(function(){var offset=$(this).offset();if(scrollTop<=offset.top&&$(this).height()+offset.top<scrollTop+windowHeight){var letter=$(this).attr("data-letter");$(".glossary__letter").removeClass("active"),$(".glossary__letter[data-letter='"+letter+"']").addClass("active");var position=$(".glossary__letter[data-letter='"+letter+"']").parent().index();return cache2.$mobileCarousel.trigger("to.owl.carousel",position),!1}})}function scrollToSection(e){e.preventDefault();var letter=$(this).attr("data-letter"),additionalSpacing=350;$(window).width()>theme.breakpoint&&(additionalSpacing=525),$("html, body").animate({scrollTop:$(selectors.lists+"[data-letter='"+letter+"']").position().top+additionalSpacing})}function storePositionData(){data.containerTop=cache2.$content.offset().top,data.containerBottom=cache2.$bottom.offset().top}function moveGlossary(){var scrollTop=$(window).scrollTop()+132,diff=scrollTop-data.containerTop,add=scrollTop+data.containerTop;diff>0&&add<data.containerBottom&&cache2.$desktopLetters.css("top",diff)}function highlightLetterDesktop(){var scrollTop=$(window).scrollTop()+0,windowHeight=$(window).height();cache2.$lists.each(function(){var offset=$(this).offset();if(scrollTop<=offset.top){var letter=$(this).attr("data-letter");return $(".glossary__letter").removeClass("active"),$(".glossary__letter[data-letter='"+letter+"']").addClass("active"),!1}})}function buildIngredientList(){theme.ingredients.sort(function(a,b){var x=a.title.toLowerCase(),y=b.title.toLowerCase();return x<y?-1:x>y?1:0}),$.each(theme.ingredients,function(index,ingredient){var letter=ingredient.title.charAt(0).toLowerCase(),$container=$(".glossary__list[data-letter='"+letter+"']"),string="<div class='glossary__ingredient'> <div class='glossary__ingredient--image'> <img src='"+ingredient.image+"' alt='' /> </div><!-- --><div class='glossary__ingredient--info'> <label>"+ingredient.title+"</label> <p>"+ingredient.description+"</p> <a href='"+ingredient.url+"' class='text-link'>Shop Products</a> </div> </div>";$container.append(string),$container.removeClass("glossary__list--empty"),$(".glossary__letter[data-letter='"+letter+"']").removeAttr("disabled")})}return{init:init}})(),window.module=window.module||{},module.Login=(function(){var cache2={},selectors={inputs:".form__input"};function cacheSelectors(){cache2={$reset:$(".form__link--password"),$return:$(".form__link--return"),$password:$(".reset-password__container"),$login:$(".login__container")}}function init(){cacheSelectors(),theme.hash=="recover"&&(cache2.$login.hide(),cache2.$password.show()),cache2.$reset.on("click",function(e){e.preventDefault(),cache2.$login.hide(),cache2.$password.css("display","inline-block"),cache2.$password.find(selectors.inputs).first().focus()}),cache2.$return.on("click",function(e){e.preventDefault(),cache2.$password.hide(),cache2.$login.css("display","inline-block"),cache2.$login.find(selectors.inputs).first().focus()}),KlaviyoSubscribe.attachToForms("#password__signup-form",{hide_form_on_success:!0,success:function($form){var string="<p class='signup__complete'>You're in! Use code <b>TYSM</b><br/>for $5 off your skin care shopping spree.</p>",$string=$("<div/>").html(string).contents();$(".password__signup-success").html($string)}})}return{init:init}})(),window.module=window.module||{},module.Account=(function(){var cache2={},classes={profile_edit:"account__box--active"},selectors={links:".account__navigation--link",profile_inputs:"[data-profile]"};function cacheSelectors(){cache2={$dropdown:$(".account__navigation--dropdown"),$links:$(selectors.links),$pages:$("[data-page]"),$profile_container:$("[data-page='beauty-profile']"),$profile_edit:$("[data-page='beauty-profile'] .account__row--edit a"),$profile_save:$(".account__profile--save"),$profile_cancel:$(".account__profile--cancel"),$reorder_row:$(".reorder__row"),$reorder_more:$(".reorder-actions button")}}
1function init(){cacheSelectors(),cache2.$dropdown.on("change",function(e){e.preventDefault(),$(selectors.links+"[data-navigation='"+$(this).val()+"']").click()}),cache2.$links.on("click",function(e){var page=$(this).attr("data-navigation");swapPage(page)}),theme.hash!=""?$(selectors.links+"[data-navigation='"+theme.hash+"']").click():cache2.$links.first().click(),removeEmptyReorders(),cache2.$profile_edit.on("click",toggleProfileEditForms),cache2.$profile_cancel.on("click",toggleProfileEditForms),cache2.$profile_save.on("click",saveProfileForms),cache2.$reorder_more.on("click",showMoreOrders)}function showMoreOrders(e){cache2.$reorder_row.filter(":not(:visible)").length>=1&&cache2.$reorder_row.filter(":visible").last().next().show(),cache2.$reorder_row.filter(":not(:visible)").length<=1&&cache2.$reorder_more.remove()}function removeEmptyReorders(){cache2.$reorder_row.each(function(){$(this).find(".reorder__product").length==0&&$(this).remove()})}function toggleProfileEditForms(e){e.preventDefault(),cache2.$profile_container.toggleClass(classes.profile_edit)}function saveProfileForms(e){e.preventDefault();var data={},month="",day="";if($(selectors.profile_inputs).each(function(){var field=$(this).attr("data-profile");$(this).is("select")?field=="month"?month=$(this).val():field=="day"&&(day=$(this).val()):$(this).is(":checked")&&(data[field]?data[field]+="|"+$(this).val():data[field]=$(this).val())}),month!=""&&day!=""){var d=new Date;data.birthday=d.getFullYear()+"-"+month+"-"+parseInt(day).zeroPad()+" 23:59:59"}$.isEmptyObject(data)||(data.custid=theme.customer.id,$.ajax({url:"https://colourpop-usps.azurewebsites.net/api/HttpTriggerFRCustomerTags?code=MG3aWgOAhvKf0SuzJkyZ0hmA6V1Vq1Rmcud08MC8oliqdedQFSMVIw==",method:"POST",type:"POST",dataType:"json",contentType:"application/json",data:JSON.stringify(data),complete:function(r){window.location.reload()}}))}function swapPage(page){cache2.$pages.hide(),$("[data-page='"+page+"']").show(),cache2.$links.removeClass("active"),$(selectors.links+"[data-navigation='"+page+"']").addClass("active"),cache2.$dropdown.val(page),theme.wow.scrollHandler()}return{init:init}})(),window.module=window.module||{},module.Address=(function(){var cache2={},selectors={showAdd:".address__header--button"};function cacheSelectors(){cache2={$showAdd:$(".address__header--button"),$newForm:$(".address__add"),$cancelNew:$(".form__link--cancel")}}function init(){cacheSelectors(),cache2.$showAdd.on("click",function(e){e.preventDefault(),cache2.$newForm.is(":visible")||cache2.$newForm.slideDown()}),cache2.$cancelNew.on("click",function(e){e.preventDefault(),cache2.$newForm.hide()})}function swapPage(page){cache2.$pages.hide(),$("[data-page='"+page+"']").show(),cache2.$links.removeClass("active"),$(selectors.links+"[data-navigation='"+page+"']").addClass("active"),cache2.$dropdown.val(page),theme.wow.scrollHandler()}return{init:init}})(),window.module=window.module||{},module.Order=(function(){var cache2={},selectors={};function cacheSelectors(){cache2={$usps:$("[data-usps]"),$status:$(".status__label"),$dropdown:$(".account__navigation--dropdown")}}function init(){cacheSelectors(),cache2.$dropdown.on("change",function(e){e.preventDefault(),window.location.href=$(this).val()}),$(document).ready(function(){$(".act-nav__dropdown").change(function(){$(this).val()!=""&&(window.location.href=$(this).val())});var usps=cache2.$usps.attr("data-usps");usps!=""&&$.ajax({url:"https://colourpop-usps.azurewebsites.net/api/HttpTriggerFRUSPS",type:"POST",data:JSON.stringify({trackId:usps}),contentType:"application/json",dataType:"json",complete:function(r){typeof r.responseJSON=="string"&&cache2.$status.html(r.responseJSON)}})})}return{init:init}})(),window.module=window.module||{},module.Password=(function(){var cache2={},selectors={};function cacheSelectors(){cache2={}}function init(){cacheSelectors()}return{init:init}})(),window.module=window.module||{},module.HomepageQuotes=(function(){var cache2={},selectors={};function cacheSelectors(){cache2={$carousel:$(".quote__carousel")}}function init(){cacheSelectors(),cache2.$carousel.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!0,autoWidth:!1,responsive:{0:{items:1},800:{items:2}}})}return{init:init}})(),window.module=window.module||{},module.Footer=(function(){var cache2={},selectors={signupForm:"#newsletter__form"};function cacheSelectors(){cache2={}}
1function init(){cacheSelectors(),KlaviyoSubscribe.attachToForms(selectors.signupForm,{hide_form_on_success:!1,success:function($form){$(selectors.signupForm).html("<p class='signup__complete'>You're in! Use code <b>TYSM</b><br/>for $5 off your skin care shopping spree.</p>")}})}return{init:init}})(),window.module=window.module||{},module.InformationCenter=(function(){var cache2={},selectors={};function cacheSelectors(){cache2={$carousel:$(".information-b__carousel")}}function init(){cacheSelectors(),cache2.$slideshow=cache2.$carousel.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:2},800:{items:3}}})}return{init:init}})(),window.module=window.module||{},module.HomepageBoxes=(function(){var cache2={},selectors={};function cacheSelectors(){cache2={$carousel:$(".homepage-box__carousel")}}function init(){cacheSelectors(),cache2.$carousel.length>0&&(cache2.$slideshow=cache2.$carousel.owlCarousel({autoplay:!1,loop:!0,margin:0,nav:!0,dots:!1,responsive:{0:{items:1},800:{items:3}}}))}return{init:init}})(),window.module=window.module||{},module.TheRoutine=(function(){var cache2={$links:$(".routine__navigation-link"),$contrast_button:$(".routing__countast--button"),$container:$("[data-section-type='TheRoutine']")};function init(){cache2.$links.on("click",function(e){e.preventDefault(),$("html, body").animate({scrollTop:$("#"+$(this).attr("data-href")).offset().top-90},500)}),cache2.$contrast_button.on("click",function(){cache2.$container.toggleClass("contrast")})}return{init:init}})(),window.module=window.module||{},module.Shelfie=(function(){var cache2={$answers:$(".shelfie__answer--radio"),total_questions:parseInt($(".shelfie__parent").attr("data-total-questions")),answered:0,$score:$(".shelfie__results--score"),$results:$(".shelfie__results-wrapper")},selectors={answers:".shelfie__answer--radio",unanswered:".shelfie__answers[data-answered='false']"};function init(){cache2.$answers.on("change",selectAnswer)}function selectAnswer(){cache2.answered+=1;var $parent=$(this).parent(),$grandparent=$parent.parent();$parent.attr("data-selected","true"),$grandparent.attr("data-answered","true"),$grandparent.find(selectors.answers).prop("disabled",!0),console.log(cache2.answered,cache2.total_questions),cache2.answered==cache2.total_questions?displayResults():$("html, body").animate({scrollTop:$(selectors.unanswered).first().parent().offset().top-150},500)}function displayResults(){var correct=$(selectors.answers+"[data-correct='true']:checked").length;cache2.$score.html("<span>"+(correct/cache2.total_questions*100).toFixed(0)+"%</span>"),cache2.$results.show(),$("html, body").animate({scrollTop:cache2.$results.offset().top-90},500)}return{init:init}})(); 2//# sourceMappingURL=/cdn/shop/t/55/assets/modules.js.map?v=132670053111873516231701204563
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.