1typeof Shopify>"u"&&(Shopify={}),Shopify.formatMoney||(Shopify.formatMoney=function(cents,format){var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||this.money_format;typeof cents=="string"&&(cents=cents.replace(".",""));function defaultOption(opt,def){return typeof opt>"u"?def:opt}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultOption(precision,2),thousands=defaultOption(thousands,","),decimal=defaultOption(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),cents2=parts[1]?decimal+parts[1]:"";return dollars+cents2}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}),typeof ShopifyAPI>"u"&&(ShopifyAPI={});function attributeToString(attribute){return typeof attribute!="string"&&(attribute+="",attribute==="undefined"&&(attribute="")),jQuery.trim(attribute)}ShopifyAPI.onCartUpdate=function(cart){typeof window.BOLD<"u"&&typeof window.BOLD.common<"u"&&typeof window.BOLD.common.cartDoctor<"u"&&(cart=window.BOLD.common.cartDoctor.fix(cart))},ShopifyAPI.updateCartNote=function(note,callback){var $body2=$(document.body),params={type:"POST",url:"/cart/update.js",data:"note="+attributeToString(note),dataType:"json",beforeSend:function(){$body2.trigger("beforeUpdateCartNote.ajaxCart",note)},success:function(cart){typeof window.BOLD<"u"&&typeof window.BOLD.common<"u"&&typeof window.BOLD.common.cartDoctor<"u"&&(cart=window.BOLD.common.cartDoctor.fix(cart)),typeof callback=="function"?callback(cart):ShopifyAPI.onCartUpdate(cart),$body2.trigger("afterUpdateCartNote.ajaxCart",[note,cart])},error:function(XMLHttpRequest2,textStatus2){$body2.trigger("errorUpdateCartNote.ajaxCart",[XMLHttpRequest2,textStatus2]),ShopifyAPI.onError(XMLHttpRequest2,textStatus2)},complete:function(jqxhr,text){$body2.trigger("completeUpdateCartNote.ajaxCart",[this,jqxhr,text])}};jQuery.ajax(params)},ShopifyAPI.onError=function(XMLHttpRequest,textStatus){var data=eval("("+XMLHttpRequest.responseText+")");data.message&&alert(data.message+"("+data.status+"): "+data.description)},ShopifyAPI.addItemFromForm=function(form,callback,errorCallback){var $body2=$(document.body),before_callback=function(jqxhr,settings2){$body2.trigger("beforeAddItem.ajaxCart",form)},success_callback=function(line_item){typeof callback=="function"?callback(line_item,form):ShopifyAPI.onItemAdded(line_item,form),$body2.trigger("afterAddItem.ajaxCart",[line_item,form])},error_callback=function(XMLHttpRequest2,textStatus2){typeof errorCallback=="function"?errorCallback(XMLHttpRequest2,textStatus2):ShopifyAPI.onError(XMLHttpRequest2,textStatus2),$body2.trigger("errorAddItem.ajaxCart",[XMLHttpRequest2,textStatus2])};if(typeof BOLD=="object"&&BOLD.helpers&&typeof BOLD.helpers.addItemFromForm=="function")BOLD.helpers.addItemFromForm($(form),success_callback,error_callback,{endpoint:"/cart/add.js"});else{var $body2=$(document.body),params={type:"POST",url:"/cart/add.js",data:jQuery(form).serialize(),dataType:"json",beforeSend:before_callback,success:success_callback,error:error_callback,complete:function(jqxhr,text){$body2.trigger("completeAddItem.ajaxCart",[this,jqxhr,text])}};jQuery.ajax(params)}},ShopifyAPI.getCart=function(callback){$(".template-product").addClass("loading"),$(document.body).trigger("beforeGetCart.ajaxCart"),jQuery.getJSON("/cart.js",function(cart,textStatus2){typeof callback=="function"?callback(cart):ShopifyAPI.onCartUpdate(cart),$(document.body).trigger("afterGetCart.ajaxCart",cart)})},ShopifyAPI.changeItem=function(line,quantity,callback){var checkout=document.querySelector(".ajaxcart__footer");checkout.style="pointer-events:none; opacity: 0.4;",setTimeout(function(){checkout.style="pointer-events:inital; opacity: 1;"},2500);var $body2=$(document.body),params={type:"POST",url:"/cart/change.js",data:"quantity="+quantity+"&line="+line,dataType:"json",beforeSend:function(){$body2.trigger("beforeChangeItem.ajaxCart",[line,quantity])},success:function(cart){typeof window.BOLD<"u"&&typeof window.BOLD.common<"u"&&typeof window.BOLD.common.cartDoctor<"u"&&(cart=window.BOLD.common.cartDoctor.fix(cart)),typeof callback=="function"?callback(cart):ShopifyAPI.onCartUpdate(cart),$body2.trigger("afterChangeItem.ajaxCart",[line,quantity,cart])},error:function(XMLHttpRequest2,textStatus2){$body2.trigger("errorChangeItem.ajaxCart",[X
1MLHttpRequest2,textStatus2]),ShopifyAPI.onError(XMLHttpRequest2,textStatus2)},complete:function(jqxhr,text){$body2.trigger("completeChangeItem.ajaxCart",[this,jqxhr,text])}};jQuery.ajax(params)};var ajaxCart=(function(module,$){"use strict";var init,loadCart,settings,isUpdating,$body,$formContainer,$addToCart,$cartCountSelector,$cartCostSelector,$cartContainer,$drawerContainer,updateCountPrice,formOverride,itemAddedCallback,itemErrorCallback,cartUpdateCallback,buildCart,cartCallback,adjustCart,adjustCartCallback,createQtySelectors,qtySelectors,validateQty;init=function(options){settings={formSelector:'form[action^="/cart/add"]',cartContainer:"#CartContainer",addToCartSelector:'input[type="submit"]',cartCountSelector:null,cartCostSelector:null,moneyFormat:"$",disableAjaxCart:!1,enableQtySelectors:!0},$.extend(settings,options),$formContainer=$(settings.formSelector),$cartContainer=$(settings.cartContainer),$addToCart=$formContainer.find(settings.addToCartSelector),$cartCountSelector=$(settings.cartCountSelector),$cartCostSelector=$(settings.cartCostSelector),$body=$(document.body),isUpdating=!1,settings.enableQtySelectors&&qtySelectors(),!settings.disableAjaxCart&&$addToCart.length&&formOverride(),adjustCart()},loadCart=function(){$body.addClass("drawer--is-loading"),document.cookie="discount_code=SHINE25",ShopifyAPI.getCart(cartUpdateCallback)},updateCountPrice=function(cart){typeof window.BOLD<"u"&&typeof window.BOLD.common<"u"&&typeof window.BOLD.common.cartDoctor<"u"&&(cart=window.BOLD.common.cartDoctor.fix(cart)),$cartCountSelector&&($cartCountSelector.html(cart.item_count).removeClass("hidden-count"),cart.item_count===0&&$cartCountSelector.addClass("hidden-count")),$cartCostSelector&&$cartCostSelector.html(Shopify.formatMoney(cart.total_price,settings.moneyFormat))},formOverride=function(){$formContainer.on("submit",function(evt){evt.preventDefault(),$addToCart.removeClass("is-added").addClass("is-adding"),$(".qty-error").remove(),ShopifyAPI.addItemFromForm(evt.target,itemAddedCallback,itemErrorCallback)})},itemAddedCallback=function(product){$addToCart.removeClass("is-adding").addClass("is-added"),ShopifyAPI.getCart(cartUpdateCallback)},itemErrorCallback=function(XMLHttpRequest,textStatus){var data=eval("("+XMLHttpRequest.responseText+")");$addToCart.removeClass("is-adding is-added"),data.message&&data.status==422&&$formContainer.after('<div class="errors qty-error">'+data.description+"</div>")},cartUpdateCallback=function(cart){updateCountPrice(cart),buildCart(cart)},buildCart=function(cart){if(typeof BOLD=="object"&&BOLD.options&&BOLD.options.app&&typeof BOLD.options.app.registerCartRenderFunction=="function"&&BOLD.options.app.registerCartRenderFunction(buildCart),typeof window.BOLD<"u"&&typeof window.BOLD.common<"u"&&typeof window.BOLD.common.cartDoctor<"u"&&(cart=window.BOLD.common.cartDoctor.fix(cart)),$cartContainer.empty(),cart.item_count===0){$cartContainer.append("<p>Your cart is currently empty.</p>"),cartCallback(cart);return}var items=[],item={},data2={},source=$("#CartTemplate").html(),template=Handlebars.compile(source),shippablePrice=0;$.each(cart.items,function(index,cartItem){if(cartItem.image!=null)var prodImg=cartItem.image.replace(/(\.[^.]*)$/,"_small$1").replace("http:","");else var prodImg="//cdn.shopify.com/s/assets/admin/no-image-medium-cc9732cb976dd349a0df1d39816fbcc7.gif";var ItemShipPrice=0;cartItem.requires_shipping?ItemShipPrice=cartItem.line_price:ItemShipPrice=0,shippablePrice+=ItemShipPrice,parseInt($(this).text()),item={key:cartItem.key,line:cartItem.raw_line_index?cartItem.raw_line_index+1:index+1,url:cartItem.url,img:prodImg,sku:cartItem.sku,name:cartItem.product_title,type:cartItem.product_type,variation:cartItem.variant_title,properties:cartItem.properties,itemAdd:cartItem.quantity+1,itemMinus:cartItem.quantity-1,itemQty:cartItem.quantity,price:Shopify.formatMoney(cartItem.price,settings.moneyFormat),vendor:cartItem.vendor,linePrice:Shopify.formatMoney(cartItem.line_price,settings.moneyFormat),lineMemPrice:Shopify.formatMoney(cartItem.line_price*.9,settings.moneyFormat),originalLinePrice:Shopify.formatMoney(cartItem.original_line_price,settings.moneyFormat),discounts:cartItem.discounts,discountsApplied:cartItem.line_price!==cartItem.original_line_price},items.push(item)}),data2={items,note:cart.note,totalQty:cart.item_count,totalPrice:Shopify.formatMoney(cart.total_price,settings.moneyFormat),salePrice:Shopify.formatMoney(cart.total_price*.75,settings.moneyFormat),memPrice:Shopify.formatMoney(cart.total_price*.9,settings.moneyFormat),cartPrice:cart.total_price,freeshipPrice:Shopify.formatMoney(5500-shippablePrice,settings.moneyFormat),freeship:!(shippablePrice>5490),gwp:!(shippablePrice>3900),shippablePrice,totalCartDiscount:cart.total_discount===0?0:Shopify.formatMoney(cart.total_discount,settings.moneyFormat),totalCartDiscountApplied:cart.total_discount!==0},$cartContainer.append(template(data2)),cartCallback(cart),window.BOLD&&BOLD.common&&BOLD.common.eventEmitter&&typeof BOLD.common.eventEmitter.emit=="function"&&BOL
1D.common.eventEmitter.emit("BOLD_COMMON_cart_loaded")},cartCallback=function(cart){$body.removeClass("drawer--is-loading"),$body.trigger("afterCartLoad.ajaxCart",cart),window.Shopify&&Shopify.StorefrontExpressButtons&&Shopify.StorefrontExpressButtons.initialize(),window.BOLD&&BOLD.common&&BOLD.common.eventEmitter&&typeof BOLD.common.eventEmitter.emit=="function"&&BOLD.common.eventEmitter.emit("BOLD_COMMON_cart_loaded"),$(".ajaxcart__product-meta").each(function(){var name=$(this).text();name.indexOf("update")!=-1&&$(this).parents(".ajaxcart__product").hide()}),$(".ajaxcart__product-meta").each(function(){var prop=$(this).text(),prop=prop.replace(/\s+/g,""),n1=$(this).siblings(".ajaxcart__product-name").text(),n1=n1.replace(/\s+/g,"");$(".ajaxcart__product-name").each(function(){var name=$(this).text(),name=name.replace(/\s+/g,"");(prop.indexOf(name.replace("-PartofSet",""))!=-1||prop.indexOf(name.replace("-partofset",""))!=-1)&&$(this).parents(".ajaxcart__product").addClass(n1)})})},adjustCart=function(){$body.on("click",".ajaxcart__qty-adjust",function(){if(!isUpdating){var $el=$(this),line=$el.data("line"),$qtySelector=$el.siblings(".ajaxcart__qty-num"),qty=parseInt($qtySelector.val().replace(/\D/g,"")),qty=validateQty(qty);$el.hasClass("ajaxcart__qty--plus")?(qty+=1,document.getElementById("screenReaderAlert").textContent="Quantity Increased"):(qty-=1,document.getElementById("screenReaderAlert").textContent="Quantity Decreased",qty<=0&&(qty=0),document.getElementById("screenReaderAlert").textContent="Item Removed from Cart");var idnt=$(this).parents(".two-thirds").find(".ajaxcart__product-name").text(),idnt=idnt.replace(/\s+/g,"");$(".ajaxcart__product").each(function(){if($(this).hasClass(idnt)){console.log(qty);var id1=$(this).find(".ajaxcart__product-meta").text(),id1=id1.replace("update: update_","");$.ajax({type:"POST",url:"/cart/change.js",dataType:"json",async:!1,data:"id="+id1+"&quantity="+qty,success:function(res){console.log("done")}}),qty==0&&(line=parseInt(line)-1,console.log("line="+line))}}),line?updateQuantity(line,qty):$qtySelector.val(qty)}}),$body.on("change",".ajaxcart__qty-num",function(){if(!isUpdating){var $el=$(this),line=$el.data("line"),qty=parseInt($el.val().replace(/\D/g,"")),qty=validateQty(qty);line&&updateQuantity(line,qty)}}),$body.on("submit","form.ajaxcart",function(evt){isUpdating&&evt.preventDefault()}),$body.on("focus",".ajaxcart__qty-adjust",function(){var $el=$(this);setTimeout(function(){$el.select()},50)});function updateQuantity(line,qty){isUpdating=!0;var $row=$('.ajaxcart__row[data-line="'+line+'"]').addClass("is-loading");qty===0&&$row.parent().addClass("is-removed"),setTimeout(function(){ShopifyAPI.changeItem(line,qty,adjustCartCallback)},250)}$body.on("change",'textarea[name="note"]',function(){var newNote=$(this).val();ShopifyAPI.updateCartNote(newNote,function(cart){})})},adjustCartCallback=function(cart){updateCountPrice(cart),setTimeout(function(){isUpdating=!1,buildCart(cart)},150)};var quickAdd=$(".quick-add");quickAdd.click(function(evt){evt.preventDefault();var quickAdd2=jQuery.post("/cart/add.js",{quantity:1,id:$(this).data("id")}).always(function(){ShopifyAPI.getCart(cartUpdateCallback)});document.getElementById("screenReaderAlert").textContent="Item added to bag"});var quickAddMultiple=$(".quick-add-multiple");return quickAddMultiple.click(function(evt){evt.preventDefault();var $button=$(this),productIds=$button.data("ids").split(",");$button.prop("disabled",!0).text("Adding items to bag...");function addProductToCart(id){return jQuery.ajax({type:"POST",url:"/cart/add.js",data:{quantity:1,id},dataType:"json"})}productIds.reduce(function(promise,id){return promise.then(function(){return addProductToCart(id)})},Promise.resolve()).then(function(){ShopifyAPI.getCart(cartUpdateCallback),document.getElementById("screenReaderAlert").textContent="Items added to bag",$button.prop("disabled",!1).text("Add set to bag")}).catch(function(error){console.error("Error adding products to cart:",error),$button.prop("disabled",!1).text("Add set to bag")})}),$(".quick-adder").click(function(){$.ajax({url:"/cart/update.js",method:"POST",dataType:"json",data:{updates:{42349877919786:1}}}),$(".bill-add").hide()}),createQtySelectors=function(){$('input[type="number"]',$cartContainer).length&&$('input[type="number"]',$cartContainer).each(function(){var $el=$(this),currentQty=$el.val(),itemAdd=currentQty+1,itemMinus=currentQty-1,itemQty=currentQty,source=$("#AjaxQty").html(),template=Handlebars.compile(source),data2={key:$el.data("id"),itemQty,itemAdd,itemMinus};$el.after(template(data2)).remove()})},qtySelectors=function(){var numInputs=$('input[type="number"]');numInputs.length&&(numInputs.each(function(){var $el=$(this),currentQty=$el.val(),inputName=$el.attr("name"),inputId=$el.attr("id"),itemAdd=currentQty+1,itemMinus=currentQty-1,itemQty=currentQty,source=$("#JsQty").html(),template=Handlebars.compile(source),data2={key:$el.data("id"),itemQty,itemAdd,itemMinus,inputName,inputId};$el.after(template(data2)).remove()}),$(".js-qty__adjust").on("click",function(){var $el=$(this),id=$el.data("id"),$qtySelector=$el.siblings(".js-qty__num"),qty=parseInt($qtySelector.val().replace(/\D/g,"")),qty=vali
1dateQty(qty);$el.hasClass("js-qty__adjust--plus")?(qty+=1,qty>=60&&(qty=60)):(qty-=1,qty<=1&&(qty=1)),$qtySelector.val(qty)}))},validateQty=function(qty){return parseFloat(qty)==parseInt(qty)&&!isNaN(qty)||(qty=1),qty},module={init,load:loadCart},module})(ajaxCart||{},jQuery);window.theme=window.theme||{},theme.CartDrawer=new theme.Drawers("CartDrawer","right",{onDrawerOpen:ajaxCart.load}),jQuery(function($2){ajaxCart.init({formSelector:".product-form",cartContainer:"#CartContainer",addToCartSelector:".product-form__cart-submit",cartCountSelector:"#CartCount span",cartCostSelector:"#CartCost",moneyFormat:theme.moneyFormat})}),Handlebars.registerHelper("if_eq",function(a,b,opts){return a.trim()==b.trim()?opts.fn(this):opts.inverse(this)}),jQuery(document.body).on("afterCartLoad.ajaxCart",function(evt,cart){theme.CartDrawer.open(),$(".template-product").removeClass("loading"),$(".wait").hide(),$(".bold-clone").on("click",function(){$("#CartDrawer").removeAttr("tabindex")});function waitForElm(selector){return new Promise(resolve=>{if(document.querySelector(selector))return resolve(document.querySelector(selector));const observer=new MutationObserver(mutations=>{document.querySelector(selector)&&(resolve(document.querySelector(selector)),observer.disconnect())});observer.observe(document.body,{childList:!0,subtree:!0})})}waitForElm("#bold-modal__window").then(elm=>{$("#bold-modal__window").attr("tabindex",-1),$("#bold-modal__window").focus(),$("#bold-modal__btn-close").attr("aria-label","close"),$("#bold-modal__btn-close").attr("aria-role","button")}),$(".cart__checkout").click(function(e){e.preventDefault(),$.trim($("#gift_note_textarea").val())?$.ajax({url:"/cart/update.js",method:"POST",dataType:"json",data:{updates:{"32095265620010":1}},success:function(){window.location.href="/checkout"},error:function(){alert("Error updating cart")}}):$.ajax({url:"/cart/update.js",method:"POST",dataType:"json",data:{updates:{"32095265620010":0}},success:function(){window.location.href="/checkout"},error:function(){alert("Error updating cart")}})})}); 2//# sourceMappingURL=/cdn/shop/t/751/assets/ajax-cart.js.map?v=41211870032863366031790072180
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.