(function() { function bxBootstrap() { var re = /bot|crawl|slurp|spider|mediapartners|headlesschrome|snap-prefetch|remotasks|woorank|uptime\.com|facebookexternalhit|facebookcatalog/i; if (re.test(navigator.userAgent) || navigator.userAgent == '') { return; } if (!(window.bouncex&&bouncex.website)) { var pushedData = []; if(window.bouncex && bouncex.push && bouncex.length){ pushedData = bouncex; } window.bouncex = {}; bouncex.pushedData = pushedData; bouncex.website = {"id":3082,"name":"AllHeart","cookie_name":"bounceClientVisit3082","domain":"allheart.com","ct":"bind_to_domain","ally":0,"ei":0,"tcjs":"","cjs":"/* Set global control for client - https://www.wrike.com/open.htm?id=355994052 */\n(function() {\n var newSession = bouncex.vars.last_session_vid !== bouncex.cookie.vid;\n\n if (window.ga && newSession) {\n try {\n ga(\"create\", bouncex.website.gai);\n ga('send', 'event', 'BX', 'Pageload', {\n dimension1: bouncex.cookie.m.toString(),\n nonInteraction: true\n });\n } catch(e) {\n bouncex.err(e);\n }\n\n bouncex.setVarAndReload('last_session_vid', bouncex.cookie.vid);\n }\n})();","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-462213-6","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":1,"gmp":0,"whitelist_check":0},"burls":[],"ple":false,"fbe":true,"mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/************************** HELPERS ***************************/\nfunction getUrl() {\n var paramstoAllow = [];\n\n if (bouncex.website.pts === \"search\") {\n paramstoAllow = ['q', 'search-button', 'lang', 'prefn1', 'prefv1'];\n }\n\n return bouncex.utils.url.allowParams(paramstoAllow);\n}\n\nfunction isValidForTracking() {\n var url = getUrl();\n\n return url.indexOf(\"https://www.allheart.com/\") > -1 \n && url.indexOf(\"egift-certificate\") < 0 \n && url.indexOf(\"gc20\") < 0 \n && url.indexOf(\"Cart-GetProduct\") < 0 \n && url.indexOf(\"specialty-shops\") < 0 \n && jQuery(\"html\").attr(\"lang\").indexOf(\"en\") > -1;\n}\n\nfunction prodIdFormatter(prodId) {\n return prodId.split(\"-\").join(\"\").toLowerCase();\n}\n\n// we are creating string of items added to cart in addition to the main item. They will be separated by commas. The AJAX request lists these on the SKU-level identifier, which is the format \"ITEM-ID--SKU-ID\". If we look for index of the group-level ids in this array, we will return positive matches for those items.\nfunction addedToCartFormatter(pidsArr) {\n var skuIds = [];\n pidsArr.forEach(function(obj) {\n skuIds.push(prodIdFormatter(obj.pid || \"\"));\n });\n\n return skuIds.join(\",\");\n}\n\n// this is grabbing all of the possible add-ons on the page (if any are listed). The items only list the group-level IDs.\nfunction getAddOnPossibilities() {\n var addOns = [];\n jQuery(\".js-isAddOnProduct\").each(function() {\n var id = jQuery(this).attr('data-pid') || \"\";\n if (id) {\n addOns.push(id);\n }\n });\n return addOns;\n}\n\nfunction getPDPParsedJSON() {\n var itemJSON = jQuery('head script[type=\"application/ld+json\"]:contains(\"image\")').last().text();\n if (itemJSON.length) return bouncex.parseJSON(itemJSON);\n return \"\";\n}\n\n// if there's 0-1 options, the ID will have dashes. If not, there will be no dashes.\nfunction getPDPId() {\n if (jQuery(\".color-price\").length < 2 && !jQuery(\".js-attribute[data-attrname='Width']\").length && !jQuery(\".js-attribute[data-attrname='Size']\").length) {\n return jQuery(\".product-id\").text();\n }\n\n return bouncex.utils.getParam(\"pid\", jQuery('div[data-querystring*=\"pid\"]').attr('data-querystring'));\n}\n\nfunction getItemPrice() {\n var $itemPrice = jQuery('.main-product .price .isSale');\n if (!$itemPrice.length) {\n $itemPrice = jQuery('.main-product .price');\n }\n return $itemPrice.first().text().replace(/[^0-9.]/g, '');\n}\n/************************** ITEM ***************************/\nfunction getItem() {\n var parsedJSON = getPDPParsedJSON(),\n url = getUrl();\n return {\n id: jQuery('.yotpo.bottomLine').attr('data-product-id') || bouncex.utils.getNestedProp('dataLayerEvent.ecommerce.detail.products[0].id', ''),\n copy: parsedJSON.name || bouncex.vars.prod_name,\n category: jQuery(\".breadcrumb-item\").last().text().trim() || bouncex.vars.prod_category || \"global\",\n url: url,\n imageurl: parsedJSON.image[0],\n price: getItemPrice(),\n instock: true,\n isGiftCard: parsedJSON.name.toLowerCase().indexOf(\"gift certificate\") > -1,\n collection: jQuery(\".product-brand\").first().text().trim()\n };\n}\n\nfunction firePDPEvents() {\n var item;\n bouncex.et.onTrue(function() {\n item = getItem();\n return item.id && item.imageurl && item.category && item.copy;\n }, function() {\n bouncex.push([\"item\", item]);\n bouncex.push([\"view item\", { \"item:id\": item.id , \"item:itemgroupid\": item.id}]);\n skuChangeTracker();\n }, 15);\n}\n\n/************************* CATEGORY **************************/\nfunction getCategoryIds() {\n return jQuery(\".product\").map( function() {\n var id = jQuery(this).attr(\"data-pid\") || \"\";\n return prodIdFormatter(id);\n }).toArray().join(\",\");\n}\n\nfunction fireCategoryEvents() {\n var ids;\n bouncex.et.onTrue(function() {\n ids = getCategoryIds();\n return ids.length;\n }, function() {\n bouncex.push([\"view category\", {\n \"page:title\": jQuery(\".breadcrumb-item a[aria-current='page']\").text().trim() ||\n bouncex.utils.getParam(\"q\") || \"global\",\n \"page:url\": getUrl(),\n \"items:ids\": ids\n }]);\n\n bouncex.et.onVarChange(\"prod_id\", function(oldVal, newVal) {\n if (newVal) {\n // var groupId = jQuery('.yotpo.bottomLine').attr('data-product-id') || jQuery('#quickViewModal.show .yotpo.bottomLine').attr('data-product-id');\n bouncex.push([\"view item\", { \"item:id\": newVal , \"item:itemgroupid\": newVal}]);\n }\n });\n skuChangeTracker();\n }, 15);\n}\n\n/*************************** CART ****************************/\nfunction initializeCartEvents() { \n bouncex.et.cart.init({\n replenishmentType: 'single',\n replenish: function() {}\n });\n\n bouncex.et.on(jQuery(document), 'ajaxComplete', AJAXCartListeners);\n \n if (bouncex.website.pts !== 'cart' && bouncex.vars.cart_set && bouncex.vars.cart_qty === 0) {\n bouncex.push(['cancel_allheart', {}]);\n bouncex.setv('cart_set', false);\n }\n \n if (bouncex.website.pts === 'cart') {\n bouncex.et.onVarChange('cart_qty', function(oldVal, newVal) {\n if (oldVal > newVal) {\n bouncex.log(\"REMOVED AN ITEM\");\n }\n \n if (!bouncex.vars.cart_set){\n return;\n }\n var allHeartProductTotal = 0;\n \n jQuery('.item-attributes').each(function(i, el){\n var itemIds = jQuery(el).find('.line-item-attributes:first strong').text();\n if (itemIds.slice('0, 2').indexOf('ah') > -1) {\n allHeartProductTotal++;\n }\n });\n \n if (allHeartProductTotal === 0) {\n bouncex.push(['cancel_allheart', {}]);\n bouncex.setv('cart_set', false);\n }\n });\n }\n}\n\nfunction AJAXCartListeners(event, xhr, settings) {\n if (settings.url.indexOf(\"Cart-AddProduct\") > -1) {\n bouncex.setTimeout2(function() {\n // we are setting a timeout in order to make sure the cart_price RTV is updated.\n var prodId;\n\n // if we are adding from a product page, we are using the ID from the JSON data. If not, we are using the prod_id RTV used on list pages\n if (bouncex.website.pts === \"product\") {\n prodId = getPDPId() || \"\";\n } else {\n prodId = bouncex.vars.prod_id;\n }\n\n fireAddToCart(prodId || bouncex.vars.prod_id);\n \n // we are checking to see if the ATC event contains any checked add-ons. This is only applicable for PDPs. These additional items added to cart will show in the field settings.data.pidsObj. We format this into a more usable format above & below.\n var addedOnObject = bouncex.utils.url.queryStringToObject(settings.data) || \"\",\n pidsStringObject = addedOnObject.pidsObj || \"\",\n pidsArrayOfAddedItems = bouncex.parseJSON(pidsStringObject) || \"\";\n\n // the prod_id_from_cart_page is an array of recommendations @ group Id level at the bottom of the cart page.\n // If we are on this page, we are grabbing the PID from the event directly, and testing that against our pre-filled array of IDs.\n if (bouncex.website.pts === \"cart\") {\n var skuId = bouncex.utils.url.getParam(\"pid\",settings.data),\n skuFormatted = prodIdFormatter(skuId);\n bouncex.vars.prod_id_from_cart_page.split(\",\").forEach(function(itemId) {\n if (skuFormatted.indexOf(itemId) > -1) {\n fireAddToCart(itemId);\n }\n });\n }\n \n // we are checking to see if the ATC event contains any checked add-ons. This is only applicable for PDPs. These additional items added to cart will show in the field settings.data.pidsObj. We format this into a more usable format above & below.\n if (pidsArrayOfAddedItems.length) {\n var addOnPossibilities = getAddOnPossibilities(),\n skuIdsAdded = addedToCartFormatter(pidsArrayOfAddedItems);\n \n addOnPossibilities.forEach(function(itemId) {\n if (skuIdsAdded.indexOf(itemId) > -1) {\n fireAddToCart(itemId);\n }\n });\n }\n }, 2500);\n }\n\n // if (settings.url.indexOf(\"Cart-RemoveProductLineItem\") > -1) {\n // if (jQuery(\".page-title\").text().toLowerCase().indexOf(\"your shopping bag is empty\") > -1) {\n // bouncex.push(['empty_cart', {'cart:update' : true }]);\n // bouncex.setv(\"cart_set\", false);\n // }\n // }\n \n // if (settings.url.indexOf(\"Cart-RemoveProductLineItem\") > -1) {\n // var allHeartProductTotal = 0;\n\n // jQuery('.item-attributes').each(function(i, el){\n // var itemIds = jQuery(el).find('.line-item-attributes:first strong').text();\n // if (itemIds.slice('0, 2').indexOf('ah') > -1) {\n // allHeartProductTotal++;\n // }\n // });\n\n // if (allHeartProductTotal === 0) {\n // bouncex.push(['cancel_allheart', {}]);\n // bouncex.setv('cart_set', false);\n // }\n\n // if (jQuery(\".page-title\").text().toLowerCase().indexOf(\"your shopping bag is empty\") > -1) {\n // bouncex.push(['empty_cart', {'cart:update' : true }]);\n // bouncex.setv(\"cart_set\", false);\n // }\n\n // }\n}\n\nfunction fireAddToCart(id) {\n if (id) {\n bouncex.push(['add to cart', { 'item:id': id, 'cart:value': bouncex.vars.cart_value }]);\n if (!bouncex.vars.cart_set && id.indexOf('ah') > -1) {\n bouncex.setv(\"cart_set\", true);\n }\n }\n}\n\nfunction getDefaultCartRecs() {\n return jQuery(\"button[data-href='/on/demandware.store/Sites-allheart-Site/default/Cart-AddProduct']\").map(function() {\n return jQuery(this).attr(\"data-pid\") || \"\";\n }).toArray();\n}\n\n/********************** USER TRACKING ***********************/\n\nfunction trackLoggedInUser() {\n bouncex.et.onVarChange(\"user_email\", function() {\n if (!bouncex.vars.logged_in_identified && bouncex.utils.validate.email(bouncex.vars.user_email)) {\n bouncex.push([\n 'user', {\n email: bouncex.vars.user_email,\n source: 'LoggedIn'\n }\n ]);\n bouncex.setv('logged_in_identified', true);\n setBounceCookie();\n }\n });\n}\n\n// SKU defaults to group ID if nothing is selected\nfunction skuChangeTracker() {\n bouncex.et.onVarChange(\"sku\", function(oldVal, newVal) {\n if (\n newVal \n && bouncex.vars.prod_id \n && prodIdFormatter(newVal) !== prodIdFormatter(bouncex.vars.prod_id)\n && jQuery(\".main-product .js-attribute button.selected\").length === jQuery(\".main-product .js-attribute\").length) {\n // var groupId = jQuery('.yotpo.bottomLine').attr('data-product-id') || jQuery('#quickViewModal.show .yotpo.bottomLine').attr('data-product-id');\n bouncex.push([\"select_sku\", { \"item:id\": bouncex.vars.prod_id, \"item:itemgroupid\": bouncex.vars.prod_id, \"item:feedid\": newVal.toUpperCase() }]);\n }\n });\n \n if (jQuery('.color-attribute, .selection-button').length === 1) {\n // var groupId = jQuery('.yotpo.bottomLine').attr('data-product-id') || jQuery('#quickViewModal.show .yotpo.bottomLine').attr('data-product-id');\n bouncex.push([\"select_sku\", { \"item:id\": bouncex.vars.prod_id, \"item:itemgroupid\": bouncex.vars.prod_id, \"item:feedid\": bouncex.vars.sku.toUpperCase() }]);\n }\n}\n\n/******************* INITIALIZE EVENTS *********************/\nfunction initializeEvents() {\n if (bouncex.website.pts === \"product\") {\n firePDPEvents();\n }\n\n if (bouncex.website.pts === \"category\" || bouncex.website.pts === \"search\") { \n fireCategoryEvents();\n }\n\n if (bouncex.website.pts === \"cart\") {\n var possibleIds;\n bouncex.et.onTrue(function() {\n possibleIds = getDefaultCartRecs();\n return possibleIds.length;\n }, function() {\n bouncex.setv(\"prod_id_from_cart_page\", possibleIds.join(\",\"));\n }, 15);\n }\n}\n\nif (isValidForTracking()) {\n initializeEvents();\n initializeCartEvents();\n trackLoggedInUser();\n}","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/cart';"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll(\"#product-search-results\").length > 0;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"search?"}]]},"checkout":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/checkout';"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/';"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.product-detail').length > 0;"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"search?q="}]]}},"els":{"ATC-PDP":".product-add__cart","CART-CheckoutButton":"#checkout","CART-PromoCodeBox":"#coupon_code","CART-Promocodeapplybutton":".apply_code","CAT-ProductGridImage":".category__products","CAT-ProductTile":"div[id*=\"product-box-\"]","CAT-Quickview":"#fancybox-frame","NON-CART-Footer":".footer","NON-CART-Navigationbar":".header__nav, .header.responsive","PDP-AddToCartButton":".product-add__cart ","PDP-ColorOption":".product-color__swatches","PDP-HeroImage":".detail-images__slider","PDP-ProductName":".product-specs__title","PDP-ProductPrice":".product-price","PDP-QuantityOption":".product-quantity","PDP-ReviewStars":".rating","PDP-SizeOption":".product-size__size","PDP-ThumbnailImage":".product-alts__slider","SEARCH-ProductGridImage":"#sli_products_container"},"vars":[{"name":"dollar_savings","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function(){\n var standardAmount = window.utag_data['meta.og:price:standard_amount'];\n var salePrice = window.utag_data['meta.og:price:amount'];\n var savings; \n\n salePrice = salePrice ? Number(salePrice.replace(/[^0-9.]/g,'')) : false;\n standardAmount = standardAmount ? Number(standardAmount.replace(/[^0-9.]/g,'')) : false;\n\n if (salePrice && standardAmount) {\n savings = Math.round(standardAmount - salePrice);\n }\n\n return savings ? savings : false;\n\n})();","trigger":"pageload"},{"name":"percentage_savings","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function(){\n var savings, standardAmount, percentageOff;\n\n if (bouncex.vars.dollar_savings) {\n standardAmount = Number(window.utag_data['meta.og:price:standard_amount'].replace(/[^0-9.]/g,''));\n savings = bouncex.vars.dollar_savings;\n percentageOff = Math.round((savings / standardAmount) * 100);\n }\n\n return percentageOff ? percentageOff : false;\n})();","trigger":"pageload"},{"name":"average_star_rating","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"Number(jQuery('[data-ratings]').attr('data-ratings') || 0) || false;","trigger":"pageload"},{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.validate.email(bouncex.utils.getNestedProp('_etmc.user_info.email'));","trigger":"pageload"},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":"pageload"},{"name":"cart_qty","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"Number(jQuery('.minicart-quantity, .js-cart-count').eq(0).text().replace(/[^0-9.]/g,''));","trigger":"pageload"},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (Number(jQuery('.minicart-quantity, .js-cart-count').eq(0).text().replace(/[^0-9.]/g,'')) === 0) {\n return 0;\n }\n \n // limited to grabbing cart value only when adding to cart and modal pops up on pdp & quick view adding requires a page refresh for correct value\n return Number(jQuery('.subtotal .bold, .sub-total').text().replace(/[^0-9.]/g,'')) || Number(bouncex.utils.getNestedProp('utag_data.total_value'), '') || null;\n})();","trigger":"pageload"},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('.email-signup-message').length > 0 || null;","trigger":"pageload"},{"name":"prod_price","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"0","code":"(function () {\n var $itemPrice = jQuery('.main-product .price .isSale');\n if (!$itemPrice.length) {\n $itemPrice = jQuery('.main-product .price');\n }\n return Number($itemPrice.first().text().replace(/[^0-9.]/g, ''));\n})();","trigger":"pageload"},{"name":"prod_name","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('h1.product-name, .product-quickview:visible .product__name h1').text() || false;","trigger":"pageload"},{"name":"in_stock","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(jQuery('.modal-content:visible').length > 0 || bouncex.website.pts === 'product') && jQuery('.js-availability-msg-label, .availability-msg, .avail__msg').text().trim().indexOf('Ships') < 0;","trigger":"pageload"},{"name":"cart_plurality","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"(function(){\n var cartQty = Number(jQuery('.minicart-quantity').eq(0).text().replace(/[^0-9.]/g,''));\n if(cartQty > 1){\n return 'items';\n }else if(cartQty === 0){\n return false;\n }else if(cartQty === 1){\n return 'item';\n }\n})();","trigger":"pageload"},{"name":"only_excluded_brands_in_cart","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"(function(){\n var $success = jQuery('#fancybox-content iframe');\n if($success.length > 0 && $success.attr('src').match(/AddToCartModal|ProductPageModal/)){\n var srcMatch = $success.attr('src').match(/aspx\\?p=(?:lit|wa\\d+)/) ;\n if(srcMatch){\n return Number(jQuery('.cart__value').text()) <= 1 || null;\n } else {\n return false;\n }\n } else if(jQuery('.cart__item--title, .item-row h2').length > 0){\n return jQuery('.cart__item--title, .item-row h2').filter(function(x,y){\n \treturn !y.textContent.match(/(Littmann)|(Welch Allyn)/);\n }).length === 0 ;\n } else if((jQuery('.cart__item-list').children().length > 0 && jQuery('.cart__item--title').length === 0) || jQuery('.item-row').text().indexOf('Your shopping cart is empty.') > -1){\n return false;\n } else {\n return null;\n }\n})();","trigger":"pageload"},{"name":"is_included_hostname","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"window.location.hostname === 'www.allheart.com' || window.location.hostname === 'search.allheart.com';","trigger":"pageload"},{"name":"is_allheart","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.getNestedProp('utag_data.page_category') !== 'Specialty Shops';","trigger":"pageload"},{"name":"prod_id","polling":"all","persist":"no","page_types":["product","search","category"],"testmode":false,"default":"","code":"(jQuery('.yotpo.bottomLine').attr('data-product-id') || jQuery('#quickViewModal.show .yotpo.bottomLine').attr('data-product-id') || \"\").toLowerCase() || null;\n","trigger":"pageload"},{"name":"prod_category","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery(\".breadcrumb-item a[aria-current='page']\").text().trim();","trigger":"pageload"},{"name":"prod_imageurl","polling":"none","persist":"no","page_types":["product"],"testmode":true,"default":"false","code":"jQuery(\".prod-slider__item img\").first().attr(\"src\");","trigger":"pageload"},{"name":"prod_url","polling":"none","persist":"no","page_types":["product"],"testmode":true,"default":"false","code":"bouncex.utils.url.allowParams();","trigger":"pageload"},{"name":"cat_title","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"jQuery('.category-hero__container h1').text() !== '' ? jQuery('.category-hero__container h1').text().trim() : jQuery('.category-hero__brand').text().trim();\n","trigger":"pageload"},{"name":"cat_url","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"bouncex.utils.url.removeParams(['utm', 'msclkid', 'adlclid']);\n","trigger":"pageload"},{"name":"cat_ids","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"(function() {\n\tvar items = jQuery('div[id*=\"product-box-\"]:lt(20)');\n\tvar ids = [];\n\tfor (var i = 0; i < items.length; i++) {\n\t\tvar id = items\n\t\t\t.eq(i)\n\t\t\t.attr('data-id');\n\t\tif (id && ids.indexOf(id) === -1) {\n\t\t\tids.push(id);\n\t\t}\n\t}\n\treturn ids.join(',');\n})();","trigger":"pageload"},{"name":"hover_id","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function(el){\n\treturn jQuery(el).attr('data-id');\n})(this);","trigger":"event"},{"name":"quickview_id","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"","code":"jQuery(\".product-id\").text() || jQuery(\".modal-body .product-detail\").attr(\"data-pid\");","trigger":"pageload"},{"name":"no_search_results","polling":"none","persist":"no","page_types":["search"],"testmode":true,"default":"false","code":"jQuery('#page-title-heading').text().toLowerCase().indexOf('no results for') > -1;","trigger":"pageload"},{"name":"is_giftcard","polling":"none","persist":"no","page_types":["category","product"],"testmode":true,"default":"false","code":"window.location.href.indexOf('egift-certificate') > -1 || window.location.href.indexOf('p=gc') > -1 || window.location.href.indexOf('gift-card') > -1;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"has_product_grid","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"jQuery(\".product-grid[itemid='#product']\").length > 0;","trigger":"pageload"},{"name":"is_english_prod_copy","polling":"none","persist":"no","page_types":["product"],"testmode":true,"default":"false","code":"(function () {\n\tvar pattern = /^[\\sa-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]*$/;\n\tif (bouncex.vars.prod_name.match(pattern)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n})();","trigger":"pageload"},{"name":"atc_modal_visible","polling":"vars","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"(function(){\n\tvar outerIframe = document.getElementById('fancybox-frame');\n\tif (outerIframe) {\n\t\tvar outerIframeDom = outerIframe.contentDocument\n\t\tif (outerIframeDom) {\n\t\t\tvar innerIframe = outerIframeDom.getElementsByTagName('iframe')[0];\n\t\t\tif (innerIframe) { return true; }\n\t\t}\n\t}\n\treturn false;\n})();\n","trigger":"pageload"},{"name":"atc_modal_success_cat","polling":"vars","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"(function(){\n\tvar outerIframe = document.getElementById('fancybox-frame');\n\tif (outerIframe && outerIframe.src && outerIframe.src.indexOf(\"www.allheart.com\") > -1) {\n\t\tvar outerIframeDom = outerIframe.contentDocument\n\t\tif (outerIframeDom) {\n\t\t\tvar innerIframe = outerIframeDom.getElementsByTagName('iframe')[0];\n\t\t\tif (innerIframe && innerIframe.src && innerIframe.src.indexOf(\"www.allheart.com\") > -1) {\n\t\t\t\tvar innerIframeDom = innerIframe.contentDocument\n\t\t\t\tif (innerIframeDom) {\n\t\t\t\t\tvar isAtcDiv = innerIframeDom.getElementsByClassName('success')[0]\n\t\t\t\t\tif (isAtcDiv) {\n\t\t\t\t\t\tvar success = isAtcDiv.innerText.indexOf(\"This item was successfully added to your cart!\") > -1\n\t\t\t\t\t\treturn success\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n return false;\n})();","trigger":"pageload"},{"name":"atc_modal_success_pdp","polling":"vars","persist":"no","page_types":["product"],"testmode":true,"default":"false","code":"(function(){\n\tvar iframe = document.getElementById('fancybox-frame');\n\tif (iframe && iframe.src && iframe.src.indexOf(\"www.allheart.com\") > -1) {\n var iframeDom = iframe.contentDocument\n if (iframeDom) {\n var isAtcDiv = iframeDom.getElementsByClassName('success')[0];\n if (isAtcDiv) {\n var success = isAtcDiv.innerText.indexOf(\"This item was successfully added to your cart!\") > -1;\n return success\n }\n }\n }\n return false;\n})();\n","trigger":"pageload"},{"name":"is_mobile","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function(){\n\tvar isMobileHtml = jQuery(\"#deviceType\").attr(\"value\") ? jQuery(\"#deviceType\").attr(\"value\").indexOf(\"mobile\") > -1 : false\n\tvar isUtagMobile = window.utag_data ? utag_data._cstore.indexOf(\"mobile\") > -1 : false\n\treturn isMobileHtml || isUtagMobile\n})();\n","trigger":"pageload"},{"name":"cart_total_threshold_fired","polling":"none","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"last_session_vid","polling":"vars","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"previous_selection","polling":"none","persist":"permanent","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"user_email","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.getNestedProp(\"utag_data.customer_email\") || bouncex.utils.getNestedProp(\"_user_id\");","trigger":"pageload"},{"name":"cart_page_title","polling":"all","persist":"no","page_types":["cart"],"testmode":true,"default":"","code":"jQuery(\".page-title\").text().toLowerCase();","trigger":"pageload"},{"name":"sku","polling":"all","persist":"no","page_types":["category","product","search"],"testmode":false,"default":"","code":"(function() {\n if (bouncex.website.pts === \"product\") {\n return jQuery(\".product-number .product-id\").text().trim();\n }\n\n var imgSrc = jQuery(\".modal-body button.slick-active img\").first().attr(\"data-imagezoom\") || \"\",\n beforeImageType = imgSrc.split(\".\").slice(-2)[0] || \"\";\n skuFromImage = beforeImageType.split(\"_\").slice(-2)[0] || \"\";\n \n var prodName = jQuery(\".product__name\").text().toLowerCase(),\n $color = jQuery(`.${bouncex.vars.prod_id}color-value`),\n $size = jQuery(`.${bouncex.vars.prod_id}size-value`),\n $width = jQuery(`.${bouncex.vars.prod_id}width-value`),\n $inseam = jQuery(`.${bouncex.vars.prod_id}inseam-value`),\n selectedColor,\n selectedSize,\n selectedWidth,\n selectedInseam,\n itemSpecificSelctor,\n skuFromImage;\n \n\n // shoes do not have SKU on the dom. we need to create it using the selectors\n if (prodName.indexOf(\"shoe\") > -1 || prodName.indexOf(\"clog\") > -1 || prodName.indexOf(\"boot\") > -1) {\n if ($color.length && $size.length && $width.length) { \n selectedColor = $color.closest('.selected').attr(\"data-attr-value\") || \"\";\n selectedSize = $size.closest('.selected').attr(\"aria-describedby\") || \"\";\n selectedWidth = $width.closest('.selected').attr(\"aria-describedby\") || \"\";\n \n if (selectedColor && selectedSize && selectedWidth) {\n itemSpecificSelctor = selectedColor + selectedSize + selectedWidth;\n skuFromImage = skuFromImage.split(\"-\");\n skuFromImage[skuFromImage.length - 1] = itemSpecificSelctor;\n return skuFromImage.join(\"-\").toUpperCase();\n }\n }\n }\n \n if (prodName.indexOf(\"scrub\") > -1 || prodName.indexOf(\"pant\") > -1) {\n if ($color.length && $size.length && $inseam.length) { \n selectedColor = $color.closest('.selected').attr(\"data-attr-value\") || \"\";\n selectedSize = $size.closest('.selected').attr(\"aria-describedby\") || \"\";\n selectedInseam = $inseam.closest('.selected').attr(\"aria-describedby\") || \"\";\n \n if (selectedColor && selectedSize && selectedInseam) {\n var sizeAndInseam = selectedSize.length === 3 && selectedInseam[0] === \"r\" ? selectedSize : selectedSize.slice(0, 2) + selectedInseam.slice(0, 1);\n sizeAndInseam = selectedSize === \"med\" ? \"md\" + selectedInseam[0] : sizeAndInseam;\n sizeAndInseam = selectedSize === \"med\" && selectedInseam[0] === \"r\" ? \"mdt\" : sizeAndInseam;\n \n itemSpecificSelctor = selectedColor + sizeAndInseam;\n skuFromImage = skuFromImage.split(\"-\");\n skuFromImage[skuFromImage.length - 1] = itemSpecificSelctor;\n return skuFromImage.join(\"-\").toUpperCase();\n }\n }\n }\n\n if (bouncex.website.pts === \"category\" || bouncex.website.pts === \"search\") {\n var listedSku = bouncex.utils.url.getParam(\"pid\", jQuery(\".full-pdp-link\").attr(\"href\"));\n \n if (listedSku) return listedSku;\n if (skuFromImage) return skuFromImage;\n }\n})();","trigger":"pageload"},{"name":"cart_set","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cookie_modal_present","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#onetrust-group-container:visible').length > 0;","trigger":"pageload"},{"name":"prod_id_from_cart_page","polling":"none","persist":"no","page_types":["cart"],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"hh_cart_qty","polling":"all","persist":"no","page_types":["cart"],"testmode":true,"default":"false","code":"(function() {\n var hhInCart = 0;\n jQuery('.line-item-attributes:contains(\"#\") strong').each(function() {\n if (jQuery(this).text().indexOf('hh-') > -1) {\n hhInCart += 1;\n }\n });\n return hhInCart;\n})()","trigger":"pageload"},{"name":"ck_cart_qty","polling":"all","persist":"no","page_types":["cart"],"testmode":true,"default":"false","code":"(function() {\n var ckInCart = 0;\n jQuery('.line-item-attributes:contains(\"#\") strong').each(function() {\n if (jQuery(this).text().indexOf('ck-') > -1) {\n ckInCart += 1;\n }\n });\n return ckInCart;\n})()","trigger":"pageload"},{"name":"property","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\tvar currentBrand = window.location.hostname,\n\t\tpropertyMap = {\n\t\t\t'www.medelita.com': 'medelita',\n\t\t\t'www.allheart.com': 'allheart',\n \t'www.healinghandsscrubs.com': 'healinghandsscrubs',\n \t'www.cherokeeuniforms.com': 'cherokeeuniforms'\n\t\t};\n\t\n\tif (currentBrand) {\n\t\treturn propertyMap[currentBrand] || null;\n\t}\n})();","trigger":"pageload"}],"dgu":"pixel.cdnwidget.com","dgp":false,"ba":{"enabled":0,"fbte":0},"biu":"assets.bounceexchange.com","bau":"api.bounceexchange.com","beu":"events.bouncex.net","ibx":{"tjs":"","cjs":"","miw":1,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"bxid":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"var audiences = {\r\n /* PROPERTIES */\r\n testMode: false,\r\n interceptEnabled: true,\r\n mirrorEnabled: true,\r\n arrayObserverEnabled: true,\r\n\r\n viewCart: function viewCart(obj) {\r\n var Total = bouncex.utils.getNestedProp('ecommerce.items.value', '', obj);\r\n var cartArray = bouncex.utils.getNestedProp('ecommerce.items', [], obj);\r\n var cartItems = cartArray.map(function (ea) {\r\n return {\r\n ProductId: ea.item_variant,\r\n UnitPrice: ea.price,\r\n Quantity: ea.quantity\r\n };\r\n });\r\n if (cartItems.length > 0) {\r\n _shq.push(['onCartView', {\r\n Items: cartItems,\r\n Total: Total\r\n }]);\r\n }\r\n // Watch for product quantity changes in network event\r\n if(!window.jQuery){\r\n return;\r\n }\r\n window.jQuery(document).ajaxComplete(function (event, xhr, settings) {\r\n if(xhr.status === 200){\r\n var queryString = '', productId = '';\r\n if (bouncex.utils.getNestedProp('responseJSON.action', null, xhr) === 'Cart-UpdateQuantity') {\r\n queryString = bouncex.utils.getNestedProp('responseJSON.queryString', null, xhr);\r\n var qtyUpdate = queryString && bouncex.utils.url.queryStringToObject(queryString);\r\n productId = qtyUpdate.pid;\r\n var qty = qtyUpdate.quantity;\r\n \r\n if (productId && qty) {\r\n _shq.push(['onCartQty', {\r\n Items: [{\r\n ProductId: productId,\r\n Quantity: qty\r\n }]\r\n }]);\r\n }\r\n }\r\n //Watch for removal of products from cart in network event\r\n if (bouncex.utils.getNestedProp('responseJSON.action', null, xhr) === 'Cart-RemoveProductLineItem') {\r\n queryString = bouncex.utils.getNestedProp('responseJSON.queryString', null, xhr);\r\n var prodRemoval = queryString && bouncex.utils.url.queryStringToObject(queryString);\r\n productId = prodRemoval.pid;\r\n \r\n if (productId) {\r\n _shq.push(['onCartRemove', {\r\n Items: [{\r\n ProductId: productId\r\n }]\r\n }]);\r\n }\r\n \r\n }\r\n }\r\n // Check if cart value is at 0\r\n bouncex.et.onTrue(function () {\r\n var cartSelector = document.querySelector('.minicart-quantity');\r\n var cartQuantity = cartSelector && cartSelector.innerText ? Number(cartSelector.innerText.replace(/[^0-9.]/g, '')) : -1;\r\n return cartQuantity === 0;\r\n }, function () {\r\n _shq.push(['onCartEmpty']);\r\n });\r\n });\r\n\r\n },\r\n processObserver: function processObserver(aoItems) {\r\n // aoItems will be an array of objects\r\n while (aoItems.length) {\r\n var item = aoItems.shift();\r\n\r\n if (item.event && item.event === 'view_cart') {\r\n this.viewCart(item);\r\n }\r\n }\r\n },\r\n arrayObserver: function arrayObserver() {\r\n var _this = this;\r\n\r\n if (!this.arrayObserverEnabled) {\r\n return;\r\n }\r\n bouncex.et.onTrue(function () {\r\n return bouncex.utils.getNestedProp('window._shq.loaded');\r\n }, function () {\r\n _shq.ArrayObserver(window.dataLayer, function (e) {\r\n _this.processObserver(e);\r\n }, { catchUp: true });\r\n });\r\n },\r\n\r\n /* Initialize audiences Tracking */\r\n init: function init() {\r\n // test mode\r\n if (this.testMode && !bouncex.testmode.bxdev) return;\r\n // attach object to bouncex.et\r\n if (!bouncex.et) {\r\n return;\r\n }\r\n bouncex.et.audiences = this;\r\n // initialize main functions\r\n this.arrayObserver();\r\n }\r\n};\r\n\r\naudiences.init();\r\n","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Send this text to sign-up for automated, recurring allheart marketing texts, like cart reminders.","eventSharing":true,"shqId":"3go51mkueu-1","enabled":0},"pde":true,"fmc":["US","CA"],"fme":true,"fmx":"","sdk":{"android":{"enabled":false,"enabledVersions":[],"eventModifications":null},"ios":{"enabled":false,"enabledVersions":[],"eventModifications":null}},"onsite":{"enabled":1},"ads":{"enabled":0},"pubs":{"enabled":0},"websdk":{"enabled":0},"ga4_property_id":"251358754","ga4_measurement_id":"G-KFM3HWRFZ7"} ; bouncex.tag = 'tag3'; bouncex.$ = window.jQuery; bouncex.env = 'production'; bouncex.restrictedTlds = {"casl":{"ca":1},"gdpr":{"ad":1,"al":1,"at":1,"ax":1,"ba":1,"be":1,"bg":1,"by":1,"xn--90ais":1,"ch":1,"cy":1,"cz":1,"de":1,"dk":1,"ee":1,"es":1,"eu":1,"fi":1,"fo":1,"fr":1,"uk":1,"gb":1,"gg":1,"gi":1,"gr":1,"hr":1,"hu":1,"ie":1,"im":1,"is":1,"it":1,"je":1,"li":1,"lt":1,"lu":1,"lv":1,"mc":1,"md":1,"me":1,"mk":1,"xn--d1al":1,"mt":1,"nl":1,"no":1,"pl":1,"pt":1,"ro":1,"rs":1,"xn--90a3ac":1,"ru":1,"su":1,"xn--p1ai":1,"se":1,"si":1,"sj":1,"sk":1,"sm":1,"ua":1,"xn--j1amh":1,"va":1,"tr":1}}; bouncex.client = { supportsBrotli: 0 }; bouncex.assets = {"ads":"44fda29a3ca8b3798fe72ceb2caeade8","creativesBaseStyles":"a53944a2","gpsAuction":"1375a7b38c31e98d14fe7f396b72da14","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"0704dae1eb637cbeb4a847506058402d"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_6459738026535cda4232dc813c61447d.js'); runtime.setAttribute('async', 'async'); runtime.setAttribute('onload', 'bouncex.initializeTag()'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_b0f9dea1e3910d3b6e492e0d6dab8565.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_3a843477d8e318f67237a66d0a58c542.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } window._shq = window._shq || []; var eventSharingCartridge = document.createElement('script'); eventSharingCartridge.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/wknd_audiences_2648fa8509e4b3a98a2790bb8171ddc1.js'); eventSharingCartridge.setAttribute('async', 'async'); document.body.appendChild(eventSharingCartridge); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();