#8 JavaScript::Eval (size: 14938) - SHA256: f54e39febd4232637f067cc0fa8b494bb7c45eb592a2ea04a198d53dc5181f2e
/* version: 0.9 */
/* <>PLUGINMETADATA<>25<>PLUGINMETADATA<> */
/* Configuration START */
var snippet_52_options = {
"algo": {
"options": [{
"label": "Cross-Sell",
"value": "3024410d-3c98-48ea-9d69-fce46e6319e7"
}, {
"label": "Upsell",
"value": "1316545f-b04f-485d-ba78-8566bbc017fa"
}, {
"label": "Most Ordered",
"value": "03856576-d022-4b48-913b-208168133745"
}, {
"label": "Most Viewed",
"value": "bfd58ad7-e2f4-4fcc-b379-2267cef69335"
}, {
"label": "Previously Viewed",
"value": "828a578f-871b-4cb0-8c9d-d0928285b559"
}, {
"label": "Oliver Accessories",
"value": "48e6015c-c7d8-44fe-a6a1-15bc1d1803fd"
}, {
"label": "Reese Accessories",
"value": "54e629da-4590-4fe1-88ca-137f6a1a431a"
}, {
"label": "London Accessories",
"value": "6ddffc2f-6c9a-406f-801e-70cf561853c7"
}, {
"label": "blankets cross-sell",
"value": "85bc6aca-070b-435c-9078-c1cee12fea68"
}, {
"label": "Erin Accessories",
"value": "87254f26-94e8-45d5-9846-ab0862ffd32c"
}, {
"label": "Kennedy Accessories",
"value": "98c15ba3-cb47-4d81-8f28-2b7288475e8c"
}, {
"label": "Harper Accessories",
"value": "999d8fec-eb2f-4e3b-a70e-2c838febb587"
}, {
"label": "Recommended Products",
"value": "c4881a51-dcc8-4ed9-98f7-ef914c6bb695"
}, {
"label": "Ava Accessories",
"value": "d8e2453d-e550-4bd8-9698-c180c54ebc78"
}, {
"label": "Evan Accessories",
"value": "e7f0e26e-68ed-4897-a0c4-5add1584b876"
}],
"value": "c4881a51-dcc8-4ed9-98f7-ef914c6bb695",
"type": "select",
"title": "AI Engine Type",
"help": ""
},
"prodLimit": {
"value": 20,
"type": "int",
"title": "Product Limit",
"help": ""
},
"direction": {
"options": [{
"label": "Horizontal",
"value": "horizontal"
}, {
"label": "Vertical",
"value": "vertical"
}],
"value": "horizontal",
"type": "select",
"title": "Direction",
"help": ""
},
"responsiveColumns": {
"value": "1,2,3,4,5,6,7,8,9,10",
"type": "text",
"title": "Responsive Layout Items",
"help": "Starting with mobile phone sizes, comma seperated number of products per view up to large displays"
},
"navigation": {
"options": [{
"label": "None",
"value": "none"
}, {
"label": "Middle Sides",
"value": "sides"
}, {
"label": "Top Sides",
"value": "top"
}, {
"label": "Bottom Sides",
"value": "bottom"
}],
"value": "sides",
"type": "select",
"title": "Arrows",
"help": ""
},
"pagination": {
"value": false,
"type": "bit",
"title": "Show pagination dots",
"help": ""
},
"autoScroll": {
"value": true,
"type": "bit",
"title": "Auto Scroll Products",
"help": ""
},
"showSecondImage": {
"value": true,
"type": "bit",
"title": "Alternate Image on Hover",
"help": ""
},
"itemMaxHeight": {
"value": 300,
"type": "int",
"title": "Max Item Height",
"help": ""
},
"maxImageHeight": {
"value": 120,
"type": "int",
"title": "Max Product Image Height",
"help": ""
},
"engageOnInteraction": {
"value": false,
"type": "bit",
"title": "Next Tab on Interaction",
"help": ""
},
"showAddToCart": {
"value": 0,
"type": "options",
"title": "Show Add To Cart Button",
"help": "",
"labels": [
"Yes",
"No"
],
"values": [{
"allowQty": {
"value": 0,
"type": "options",
"title": "Show Quantity Selector",
"help": "",
"labels": [
"No",
"Yes"
],
"values": [{}, {
"langQtyTitle": {
"value": "SELECT QUANTITY",
"type": "text",
"title": "Language: SELECT QUANTITY",
"help": ""
},
"langQtyPrefix": {
"value": "QUANTITY:",
"type": "text",
"title": "Language: QUANTITY prefix",
"help": ""
},
"qtyDropdown": {
"value": "1,2,3,4,5,6,7,8,9,10",
"type": "text",
"title": "Quantity Options",
"help": ""
}
}]
},
"showHoverOnly": {
"value": false,
"type": "bit",
"title": "Show on Hover Only",
"help": ""
},
"belowName": {
"value": true,
"type": "bit",
"title": "Place Button Below Name",
"help": ""
},
"langSelectOptions": {
"value": "SELECT OPTIONS",
"type": "text",
"title": "Language: SELECT OPTIONS",
"help": ""
},
"langSelect": {
"value": "Select",
"type": "text",
"title": "Language: Select [option]",
"help": ""
},
"langAddToBag": {
"value": "ADD TO CART",
"type": "text",
"title": "Language: ADD TO CART",
"help": ""
},
"langAddNow": {
"value": "ADD NOW",
"type": "text",
"title": "Language: ADD NOW",
"help": ""
},
"langItemAdded": {
"value": "ITEM ADDED!",
"type": "text",
"title": "Language: ITEM ADDED!",
"help": ""
},
"btnColor": {
"value": "rgba(64,115,141,1)",
"type": "colorpicker",
"title": "Button Color",
"help": ""
},
"btnBrdColor": {
"value": "rgba(64,115,141,1)",
"type": "colorpicker",
"title": "Button Border Color",
"help": ""
},
"btnTextColor": {
"value": "rgba(255,255,255,1)",
"type": "colorpicker",
"title": "Button Text Color",
"help": ""
},
"qtySelector": {
"value": ".badge--cart",
"type": "text",
"title": "Mini Cart Quantity Selector",
"help": ""
},
"refreshCart": {
"options": [{
"label": "Select",
"value": ""
}, {
"label": "Sellify",
"value": "sellify"
}],
"value": "",
"type": "select",
"title": "Select Cart App",
"help": ""
},
"redirectAddToCart": {
"value": 0,
"type": "options",
"title": "URL/Function After Add to Cart",
"help": "",
"labels": [
"No",
"Yes"
],
"values": [{}, {
"redirectAddToCartUrl": {
"value": "/cart",
"type": "text",
"title": "URL/Function After Added To Cart",
"help": ""
}
}]
},
"showVariantImage": {
"value": true,
"type": "bit",
"title": "Show Variant Images",
"help": ""
}
}, {}]
},
"showProductName": {
"value": 0,
"type": "options",
"title": "Show Product Name",
"help": "",
"labels": [
"Yes",
"No"
],
"values": [{
"allCaps": {
"value": false,
"type": "bit",
"title": "Uppercase Name",
"help": ""
},
"ellipsize": {
"value": true,
"type": "bit",
"title": "Ellipsize Title",
"help": ""
}
}, {}]
},
"showProductPrice": {
"value": 0,
"type": "options",
"title": "Show Product Price",
"help": "",
"labels": [
"Yes",
"No"
],
"values": [{
"priceTextColor": {
"value": "rgba(0,0,0,1)",
"type": "colorpicker",
"title": "Price Text Color",
"help": ""
},
"showMSRP": {
"value": true,
"type": "bit",
"title": "Show MSRP",
"help": ""
},
"priceLocale": {
"options": [{
"label": "US DOLLAR ($, USD) $12.50",
"value": "en-US/USD"
}, {
"label": "CANADIAN DOLLAR ($, CAD) $12.50",
"value": "en-CA/CAD"
}, {
"label": "CANADIAN DOLLAR ($, CAD) 12,50 $",
"value": "fr-CA/CAD"
}, {
"label": "AUSTRALIAN DOLLAR ($, AUD) $12.50",
"value": "en-AU/AUD"
}, {
"label": "EURO (�, EUR)\t12,50 �",
"value": "de-DE/EUR"
}, {
"label": "EURO (�, EUR)\t�12.50",
"value": "en-IE/EUR"
}, {
"label": "EURO (�, EUR)\t�12,50",
"value": "nl-NL/EUR"
}, {
"label": "BRITISH POUNDS (�, GBP) �12.50",
"value": "en-GB/GBP"
}, {
"label": "MEXICO PESO ($, MXN) $12.50",
"value": "es-MX/MXN"
}, {
"label": "CHILEAN PESO ($, CLP) $12",
"value": "es-CL/CLP"
}, {
"label": "JAPANESE YEN (�, JPY) �1250",
"value": "ja-JP/JPY"
}, {
"label": "NEW ZEALAND DOLLAR ($, NZD) $12.50",
"value": "en-NZ/NZD"
}, {
"label": "HONG KONG DOLLAR ($, HKD) $12.50",
"value": "zh-HK/HKD"
}, {
"label": "SINGAPORE DOLLAR ($, SGD) $12.50",
"value": "zh-SG/SGD"
}, {
"label": "DANISH KRONE (KR, DKK) 12,50 kr.",
"value": "da-DK/DKK"
}, {
"label": "INDIAN RUPI (?, INR) ?12.50",
"value": "en-IN/INR"
}],
"value": "en-US/USD",
"type": "select",
"title": "Currency Format",
"help": ""
}
}, {}]
}
}
/* Configuration END */
window.recQueried = false;
window.recLoaded = false;
window.snippet_52_platform_other = "" // "Yahoo, Netohq";
window.snippet_52_platform_storeID = "" //"yhst-xyz";
function snippet_52_options_js() {
try {
snippet_52_options.algo.options = prodRecRuleSets.map(function(val) {
return {
label: JSON.stringify(val.name).slice(1, -1).replace(/"/g, ""),
value: encodeURIComponent(val.ruleset_id)
}
});
} catch (e) { /*Do Nothing*/ }
};
snippet_52_options_js();
#15 JavaScript::Eval (size: 50367) - SHA256: 700120e0f3ed3f02e8ddc63a92fc2451936d1fdf5c062a477c0a0a67e58697ae
jju('.snippet_52_css').remove();
window.shouldHideSnippetFontOptions = false;
var snippet_52_layerId = ('snippet_52_').split('_')[1];
var snippet_52_layerHeight = function() {
return jju('.design-layer[data-layertype="snippet"][data-layerid="' + snippet_52_layerId + '"]').height();
}
snippet_52_cssValues = "" +
".simpleselect, .simpleselect .placeholder, .snippet_52_plugin-wrapper .prodAdd, .snippet_52_plugin-wrapper .addButton, .snippet_52_plugin-wrapper .addNow{background-color: " + snippet_52_options.showAddToCart.values[0].btnColor.value + " !important;}" +
".simpleselect .placeholder, .snippet_52_plugin-wrapper .addButton, .snippet_52_plugin-wrapper .selOptions, .snippet_52_plugin-wrapper .addNow {border: 1px solid " + snippet_52_options.showAddToCart.values[0].btnBrdColor.value + " !important; color:" + snippet_52_options.showAddToCart.values[0].btnTextColor.value + " !important;}" +
".simpleselect .placeholder {border-top: 1px solid " + snippet_52_options.showAddToCart.values[0].btnBrdColor.value + " !important;}" +
".snippet_52_plugin-wrapper .prodPrice{color: " + snippet_52_options.showProductPrice.values[0].priceTextColor.value + " !important;}" +
//".snippet_52_plugin-wrapper .swiper-slide{max-height: "+snippet_52_options.itemMaxHeight.value+"px !important;}" +
".snippet_52_plugin-wrapper .swiper-slide-content{height: " + snippet_52_layerHeight() + "px !important;}" +
".simpleselect .options::-webkit-scrollbar-thumb {background-color: " + snippet_52_options.showAddToCart.values[0].btnColor.value + ";}" +
".simpleselect .options::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.2); -webkit-border-radius: 10px; border-radius: 4px;}";
if (snippet_52_options.direction.value == 'vertical') {
snippet_52_cssValues += ".snippet_52_plugin-wrapper .swiper-slide-content{height: " + snippet_52_options.itemMaxHeight.value + "px !important;}";
}
jju("head").append('<style type="text/css" class="snippet_52_css">' + snippet_52_cssValues + '</style>');
var moveStuff = ju_debounce(function() {
// let's figure out the height of the title and price and adjust the height of the image accordingly
if (snippet_52_options.showProductName.value == 0 || snippet_52_options.showProductPrice.value == 0) {
var snippet_52_titleConHeight = Math.max.apply(null, jju('.snippet_52_plugin-wrapper .prodTitleCon').map(function() {
return $(this).height();
}).get()) * (snippet_52_options.showProductPrice.value != 0 ? 1.4 : 1.15);
var snippet_52_addToCartBottom = (snippet_52_titleConHeight - jju('.snippet_52_plugin-wrapper .prodActions:first').height() - 10);
} else {
var snippet_52_titleConHeight = 0;
var snippet_52_addToCartBottom = 10;
}
var snippet_52_maxImageHeight = snippet_52_options.maxImageHeight.value;
var snippet_52_prodImageHeight = (snippet_52_layerHeight() - snippet_52_titleConHeight);
var snippet_52_prodImagePadding = (snippet_52_maxImageHeight < snippet_52_prodImageHeight ? snippet_52_prodImageHeight - snippet_52_maxImageHeight : 0);
if (snippet_52_options.showAddToCart.values[0].belowName.value) {
var snippet_52_addToCartBottom = 10;
var snippet_52_titleConHeight = snippet_52_titleConHeight - 40;
var snippet_52_prodImagePadding = 0;
}
snippet_52_cssValues = "" +
".snippet_52_plugin-wrapper .prodImages{height: " + snippet_52_prodImageHeight + "px !important;max-height: " + snippet_52_maxImageHeight + "px !important;}" +
".snippet_52_plugin-wrapper .prodTitleCon{padding-top: " + snippet_52_prodImagePadding + "px !important;}" +
".snippet_52_plugin-wrapper .prodActions{bottom: " + snippet_52_addToCartBottom + "px !important;}" +
".snippet_52_plugin-wrapper .swiper-button-next.sides, .snippet_52_plugin-wrapper .swiper-button-prev.sides{display:flex;top: " + (((snippet_52_layerHeight() - snippet_52_titleConHeight) * .5) - 20) + "px !important;}" +
".snippet_52_plugin-wrapper .swiper-button-next.top, .snippet_52_plugin-wrapper .swiper-button-prev.top{display:flex;top: -60px !important;}" +
".snippet_52_plugin-wrapper .swiper-button-next.bottom, .snippet_52_plugin-wrapper .swiper-button-prev.bottom{display:flex;top:auto !important;;bottom: -60px !important;}"
jju("head").append('<style type="text/css" class="snippet_52_css">' + snippet_52_cssValues + '</style>');
}, 50, 'End');
function snippet_52_checkprice(prod, priceType, format, variant) {
var lowestVariantPrice = 999999;
var lowestVariantMsrp = 999999;
jju.each(prod.variantList, function(v, variant) {
if (prod.variantList[v].inventory > 0) {
lowestVariantPrice = Math.min(lowestVariantPrice, prod.variantList[v].price);
lowestVariantMsrp = Math.min(lowestVariantMsrp, prod.variantList[v].msrp);
}
});
var pPrice = prod.price;
var pMsrp = prod.msrp;
if (variant) {
var vPrice = variant.price;
var vMsrp = variant.msrp;
} else {
var vPrice = lowestVariantPrice;
var vMsrp = lowestVariantMsrp;
}
var returnPrice;
if (priceType == 'price') {
//if (pPrice==0) {
if (vPrice == 0) {
if (vMsrp == 0) {
returnPrice = pMsrp;
} else {
returnPrice = vMsrp;
}
} else {
returnPrice = vPrice;
}
//} else {
// returnPrice = pPrice;
//}
} else {
//if (pMsrp==0) {
if (vMsrp == 0) {
if (vPrice == 0) {
returnPrice = pPrice;
} else {
returnPrice = vPrice;
}
} else {
returnPrice = vMsrp;
}
//} else {
// returnPrice = pMsrp;
//}
}
if (format) {
var localeOption = snippet_52_options.showProductPrice.values[0].priceLocale.value;
var localeOptionArr = localeOption.split('/');
try {
returnPrice = new Intl.NumberFormat(localeOptionArr[0], {
style: 'currency',
currency: localeOptionArr[1]
}).format(returnPrice);
} catch (er) {
returnPrice = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD'
}).format(returnPrice);
}
}
return returnPrice;
}
function snippet_52_generateSuggestions(snippet_52_prodsArr, render) {
$(document).off('.snippet_52_spaceButtons');
$(window).off('.snippet_52_spaceButtons');
if (!snippet_52_options.showAddToCart.values[0].showHoverOnly.value && render) {
jju('.snippet_52_plugin-wrapper').addClass('alwaysShowAddButton');
}
jju('.snippet_52_plugin-wrapper').html('').append('<div class="swiper-container"><div class="swiper-wrapper"></div></div>');
jju.each(snippet_52_prodsArr, function(i, item) {
//snippet_52_platform = item.platform;
// lets see if we shoudl change the qty to allow purchasing out of stock items based on filters
jju.each(snippet_52_filters, function(f, filter) {
if (filter.Active.Bool) {
if (filter.FilterType.String === 'inventory' && filter.Min.Int64 <= 0) {
jju.each(snippet_52_prodsArr[i].variantList, function(v, variant) {
snippet_52_prodsArr[i].variantList[v].inventory = 1000;
});
};
if (filter.FilterType.String === 'force_include_product' && filter.Include.Bool && filter.Filters.some(el => el.String === snippet_52_prodsArr[i].id)) {
jju.each(snippet_52_prodsArr[i].variantList, function(v, variant) {
snippet_52_prodsArr[i].variantList[v].inventory = 1000;
});
};
};
});
if (item.imageURL1.indexOf('://') == -1) {
var hostURL = document.createElement('a');
hostURL.href = item.url;
item.imageURL1 = 'https://' + hostURL.hostname + item.imageURL1;
item.imageURL2 = 'https://' + hostURL.hostname + item.imageURL2;
item.imageURL3 = 'https://' + hostURL.hostname + item.imageURL3;
}
var newItem = '' +
'<div class="swiper-slide" ' + (i == 0 ? 'data-swiper-autoplay="8000"' : '') + '>' +
'<div class="swiper-slide-content" data-index="' + i + '">' +
'<a class="prodLink" href="' + item.url + '" target="_top">' +
'<div class="prodImages">' +
'<img class="prodImage1" src="' + this.imageURL1 + '">';
if (this.imageURL2 != '') newItem += '<img class="prodImage2" src="' + this.imageURL2 + '">';
if (this.imageURL3 != '') newItem += '<img class="prodImage3" src="' + this.imageURL3 + '">';
newItem += '<img class="varImage1" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">';
newItem += '</div>' +
'<div class="prodTitleCon">' +
(snippet_52_options.showProductName.value == 0 ? '<div class="prodTitle' + (snippet_52_options.showProductName.values[0].allCaps.value ? ' allCaps' : '') + '">' + this.title + '</div>' : '') +
(snippet_52_options.showProductPrice.value == 0 ? '<div class="prodPrice">' + snippet_52_checkprice(this, 'price', true) + (snippet_52_options.showProductPrice.values[0].showMSRP.value && snippet_52_checkprice(this, 'msrp', false) > snippet_52_checkprice(this, 'price', false) ? ' <span class="msrp">' + snippet_52_checkprice(this, 'msrp', true) + '</span>' : '') + '</div>' : '') +
'</div>' +
'</a>' +
(snippet_52_options.showAddToCart.value == 0 ?
'<div class="prodActions">' +
'<div class="prodActionsCon">' +
'<div class="prodOptions"></div>' +
'<div class="prodAdd">' +
'<div class="selOptions">' + snippet_52_options.showAddToCart.values[0].langSelectOptions.value + '</div>' +
'<button class="addButton" type="button" href="#">' + snippet_52_options.showAddToCart.values[0].langAddToBag.value + '</button>' +
'<button class="addNow" type="button" href="#">' + snippet_52_options.showAddToCart.values[0].langAddNow.value + '</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' : '') +
'</div>';
jju('.snippet_52_plugin-wrapper .swiper-wrapper').append(newItem);
});
jju('.snippet_52_plugin-wrapper .swiper-container').append('<div class="swiper-pagination"></div>');
if (snippet_52_options.navigation.value != 'none') {
jju('.snippet_52_plugin-wrapper').append('<div class="swiper-button-prev ' + snippet_52_options.navigation.value + '"></div>');
jju('.snippet_52_plugin-wrapper').append('<div class="swiper-button-next ' + snippet_52_options.navigation.value + '"></div>');
}
//jju('.snippet_52_plugin-wrapper .swiper-container').append('<div class="swiper-scrollbar"></div>');
setTimeout(function() {
if (snippet_52_options.showProductName.values[0].ellipsize.value && render) {
snippet_52_cssValues = ".snippet_52_plugin-wrapper .prodTitle{white-space: nowrap !important; width: " + jju('.snippet_52_plugin-wrapper .prodTitle').outerWidth() + "px; overflow: hidden !important; text-overflow:ellipsis !important;}";
jju("head").append('<style type="text/css" class="snippet_52_css">' + snippet_52_cssValues + '</style>');
}
if (snippet_52_platform == 'Shopify') {
addLinkShopify()
} else {
//addLink();
}
}, 75)
moveStuff();
function getWindowWidth() {
return jju('.design-layer[data-layertype="snippet"][data-layerid="' + snippet_52_layerId + '"]').width();
}
function getWindowHeight() {
return jju('.design-layer[data-layertype="snippet"][data-layerid="' + snippet_52_layerId + '"]').height();
}
$(document).on('click.snippet_52_spaceButtons', '.swiper-slide a', function(e) {
e.preventDefault();
e.stopPropagation();
getpromocode('22', '', currentcp, 1, (snippet_52_options.engageOnInteraction.value ? 1 : 0));
var navurl = $(this).attr('href');
setTimeout(function() {
top.location.href = navurl;
}, 700);
});
$(document).on('click.snippet_52_spaceButtons', 'div[class*="swiper-button-prev"], div[class*="swiper-button-next"]', function(e) {
e.preventDefault();
e.stopPropagation();
});
var resizeSgg = ju_debounce(function() {
var newWindowWidth = getWindowWidth();
if (newWindowWidth == jju('.snippet_52_plugin-wrapper').width()) return;
jju('.snippet_52_plugin-wrapper').css({
'width': newWindowWidth
});
/*
resizeSwiper();
setTimeout(function(){
if (snippet_52_options.showProductName.values[0].ellipsize.value) {
jju('.snippet_52_plugin-wrapper .prodTitle').css({'width':'auto'});
snippet_52_cssValues = ".snippet_52_plugin-wrapper .prodTitle{white-space: nowrap !important; width: "+jju('.snippet_52_plugin-wrapper .prodTitle').width()+"px; overflow: hidden !important; text-overflow:ellipsis !important;}";
jju("head").append('<style type="text/css" class="snippet_52_css">'+snippet_52_cssValues+'</style>');
}
},75)
*/
setTimeout(function() {
snippet_52_generateSuggestions(snippet_52_prod, false);
}, 200)
}, 200, 'End');
jju(window).on('resize.snippet_52_spaceButtons', function() {
resizeSgg();
});
jju('.snippet_52_plugin-wrapper').css({
'width': getWindowWidth()
});
jju(document).on('mouseenter.snippet_52_spaceButtons', '.swiper-slide-content', function() {
if (snippet_52_options.autoScroll.value) snippet_52_mySwiper.autoplay.stop();
thisItem = jju(this);
thisItem.find('.selOptions').hide();
thisItem.find('.addNow').hide();
thisItem.find('.addButton').show();
if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value) {
thisItem.find('.prodImage2').stop().fadeIn(150);
}
})
jju(document).on('mouseleave.snippet_52_spaceButtons', '.swiper-slide-content', function() {
thisItem = jju(this);
thisItem.find('.prodOptions').hide();
thisItem.find("select:visible").simpleselect("setInactive")
jju('.swiper-container').removeClass('overflowVisible');
jju('.prodImage2, .prodImage3').stop().fadeOut(100);
})
jju(document).on('touchstart.snippet_52_spaceButtons', '.prodImages', function() {
if (snippet_52_options.autoScroll.value) snippet_52_mySwiper.autoplay.stop();
thisItem = jju(this);
if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value) thisItem.find('.prodImage2').stop().fadeIn(150);
})
jju(document).on('touchend.snippet_52_spaceButtons', '.prodImages', function() {
jju('.prodImage2, .prodImage3').stop().fadeOut(100);
})
jju(document).on('click.snippet_52_spaceButtons', '.addNow', function() {
var thisButton = jju(this);
var thisItem = thisButton.closest('.swiper-slide-content');
addToCart(thisItem);
});
jju(document).on('click.snippet_52_spaceButtons', '.addButton', function() {
jju('.swiper-slide-content').each(function(i) {
var thisArrItem = jju(this);
thisArrItem.find('.selOptions').hide();
thisArrItem.find('.addNow').hide();
thisArrItem.find('.addButton').show();
});
var thisButton = jju(this);
var thisItem = thisButton.closest('.swiper-slide-content');
var thisIndex = thisItem.data('index');
var thisEl = snippet_52_prodsArr[thisIndex];
if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value) {
thisItem.find('.prodImage2').stop().fadeIn(150);
}
jju('.swiper-container').addClass('overflowVisible');
thisItem.find('.prodOptions').show();
if (!thisItem.hasClass('renderedOptions')) {
thisItem.addClass('renderedOptions')
buildDropdown('', thisItem, 1, thisEl);
buildDropdown('', thisItem, 2, thisEl);
buildDropdown('', thisItem, 3, thisEl);
buildQty(thisItem, thisEl)
thisItem.find("select:visible").simpleselect({
fadingDuration: 100,
containerMargin: 20
});
resetUnavailable(thisItem, thisEl);
}
checkOptionSelected(thisItem);
// automatically click the one option set if only one option set to expand
setTimeout(function() {
if (thisItem.find('.prodOptions select').length == 1 && !thisItem.find('.prodOptions select').has('option[value!=""]:selected').length) {
thisItem.find('.prodOptions .placeholder').trigger('click');
}
}, 100)
});
jju(document).on('change.snippet_52_spaceButtons', '.SlectBox:visible', function() {
var thisItem = jju(this).closest('.swiper-slide-content');
var thisIndex = thisItem.data('index');
var thisEl = snippet_52_prodsArr[thisIndex];
resetUnavailable(thisItem, thisEl);
checkOptionSelected(thisItem);
});
function checkOptionSelected(thisItem) {
var optCount = thisItem.find('select').filter(function() {
return jju(this).find('option').length > 1
}).length;
if (!optCount || (thisItem.find('select option:eq(1)').val() == '' && optCount == 1)) {
thisItem.find('select option:eq(1)').prop('selected', true);
addToCart(thisItem);
} else if (thisItem.find('select option:selected[value=""]').length) {
thisItem.find('.selOptions').show();
thisItem.find('.addButton').hide();
thisItem.find('.addNow').hide();
} else {
thisItem.find('.selOptions').hide();
thisItem.find('.addButton').hide();
thisItem.find('.addNow').show();
if (!thisItem.find('.simpleselect:visible').length) {
thisItem.find('select option:eq(1)').prop('selected', true);
addToCart(thisItem);
}
// let's attempt to show the variant image if option is enabled
if (snippet_52_options.showAddToCart.values[0].showVariantImage.value) {
var options1 = thisItem.find('.optionSel1');
var options2 = thisItem.find('.optionSel2');
var options3 = thisItem.find('.optionSel3');
var option1sel = options1.val() || '';
var option2sel = options2.val() || '';
var option3sel = options3.val() || '';
var thisIndex = thisItem.data('index');
var thisEl = snippet_52_prodsArr[thisIndex];
thisItem.find('.varImage1').hide();
jju.each(thisEl.variantList, function() {
if (this.option1.replace(/"/g, "''") == option1sel && this.option2.replace(/"/g, "''") == option2sel && this.option3.replace(/"/g, "''") == option3sel) {
// update price to show selected variant price
if (snippet_52_options.showProductPrice.value == 0) {
thisItem.find('.prodPrice').html(snippet_52_checkprice(thisEl, 'price', true, this) + (snippet_52_options.showProductPrice.values[0].showMSRP.value && snippet_52_checkprice(thisEl, 'msrp', false, this) > snippet_52_checkprice(thisEl, 'price', false, this) ? ' <span class="msrp">' + snippet_52_checkprice(thisEl, 'msrp', true, this) + '</span>' : ''))
}
// update image to show selected variatn image
if (this.imageURL1 != '') {
if (this.imageURL1.indexOf('://') == -1) {
var hostURL = document.createElement('a');
hostURL.href = this.url;
this.imageURL1 = 'https://' + hostURL.hostname + this.imageURL1;
}
thisItem.find('.varImage1').attr('src', this.imageURL1).show();
}
}
});
}
}
}
function sanitizeOptions(v) {
return v.replace(/[^A-Za-z0-9- ]/g, '')
}
function resetUnavailable(thisItem, thisEl) {
var thisParent = thisItem.closest('.swiper-slide-content');
var thisOptDif = thisParent.find('.SlectBox').length - thisParent.find('.hidden_select_container').length;
var options1 = thisParent.find('.optionSel1');
var options2 = thisParent.find('.optionSel2');
var options3 = thisParent.find('.optionSel3');
var option1sel = options1.val() || '';
var option2sel = options2.val() || '';
var option3sel = options3.val() || '';
option1sel = sanitizeOptions(option1sel)
option2sel = sanitizeOptions(option2sel)
option3sel = sanitizeOptions(option3sel)
for (var optIndex = 1; optIndex < 4; optIndex++) {
thisParent.find('.optionSel' + optIndex).find('option:not(:first)').each(function(i) {
var thisOpt = $(this);
var thisVal = thisOpt.val();
thisVal = sanitizeOptions(thisVal);
var available = false;
jju.each(thisEl.variantList, function() {
var thisVariant = this;
var thisOption = sanitizeOptions(thisVariant["option" + optIndex]);
var thisQty = thisVariant.inventory;
if (thisOption == thisVal && thisQty > 0) {
if (optIndex == 1 && (option2sel == sanitizeOptions(thisVariant["option2"]) || thisVariant["option2"] == "" || option2sel == "") && (option3sel == sanitizeOptions(thisVariant["option3"]) || thisVariant["option3"] == "" || option3sel == "")) {
available = true;
return;
} else if (optIndex == 2 && (option1sel == sanitizeOptions(thisVariant["option1"]) || thisVariant["option1"] == "" || option1sel == "") && (option3sel == sanitizeOptions(thisVariant["option3"]) || thisVariant["option3"] == "" || option3sel == "")) {
available = true;
return;
} else if (optIndex == 3 && (option3sel == sanitizeOptions(thisVariant["option3"]) || thisVariant["option3"] == "" || option3sel == "") && (option3sel == sanitizeOptions(thisVariant["option3"]) || thisVariant["option3"] == "" || option3sel == "")) {
available = true;
return;
}
}
});
if (thisParent.find('.optionSel' + optIndex).parent('.hidden_select_container').length) {
var simSelect = thisParent.find('.optionSel' + optIndex).parent('.hidden_select_container').next('.simpleselect');
var simOption = simSelect.find('.options .option:eq(' + (i + 1) + ')');
if (available) {
simOption.removeClass('unavailable');
} else {
simOption.addClass('unavailable');
if (thisOpt.is(':selected')) {
thisOpt.closest("select:visible").val('');
simSelect.find('.placeholder').html(snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + thisEl["optionType" + optIndex]);
//simSelect.find('.placeholder').html(snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl["optionType"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl["optionType"+optIndex]));
}
}
}
})
}
}
function buildDropdown(selType, thisItem, optIndex, thisEl) {
var html = '';
var optionArr = [];
//if (thisEl.variantList.length>1 || thisEl.variantList[0].title!="Default") {
jju.each(thisEl.variantList, function() {
var thisVariant = this;
var thisOption = thisVariant["option" + optIndex].replace(/"/g, "''");
if (thisOption == '' || optionArr.indexOf(thisOption) > -1) return true;
optionArr.push(thisOption);
});
if (optionArr.length > 0) {
var sizeSortArr = ["os", "xxxs", "3xs", "xxs", "2xs", "xs", "1xs", "s", "sm", "m", "ml", "l", "xl", "1xl", "xxl", "2xl", "xxxl", "3xl"]; // sort by value
// sort by value
function testForNum(v) {
return v.match(/[0-9]/g)
}
if (!optionArr.every(testForNum)) {
// sort by sizes
optionArr.sort(function(a, b) {
var nameA = a.toLowerCase().replace('extra', 'x').replace('small', 's').replace('medium', 'm').replace('large', 'l').replace('huge', 'xl').replace(/x[\s|-]s/g, 'xs').replace(/x[\s|-]l/g, 'xl');
var nameB = b.toLowerCase().replace('extra', 'x').replace('small', 's').replace('medium', 'm').replace('large', 'l').replace('huge', 'xl').replace(/x[\s|-]s/g, 'xs').replace(/x[\s|-]l/g, 'xl');
var nameAarr = nameA.split(/[^A-Za-z0-9]/);
var nameBarr = nameB.split(/[^A-Za-z0-9]/);
for (var i = 0; i < nameAarr.length; i++) {
if (sizeSortArr.indexOf(nameAarr[i]) != -1) {
nameA = sizeSortArr[sizeSortArr.indexOf(nameAarr[i])];
break;
}
}
for (var i = 0; i < nameBarr.length; i++) {
if (sizeSortArr.indexOf(nameBarr[i]) != -1) {
nameB = sizeSortArr[sizeSortArr.indexOf(nameBarr[i])];
break;
}
}
if (sizeSortArr.indexOf(nameA) < sizeSortArr.indexOf(nameB)) {
return -1;
}
if (sizeSortArr.indexOf(nameA) > sizeSortArr.indexOf(nameB)) {
return 1;
}
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
// names must be equal
return 0;
});
} else {
// sort by value
optionArr.sort(function(a, b) {
return Number(a.match(/\d+/g).join('')) - Number(b.match(/\d+/g).join(''));
});
}
}
if (optionArr.length > 0) {
jju.each(optionArr, function(index, value) {
html += '<option value="' + value + '" ' + (optionArr.length == 1 ? 'selected' : '') + '>' + value + '</option>';
})
html = '<option value="" ' + (optionArr.length > 1 ? 'selected' : '') + '>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + thisEl["optionType" + optIndex] + '</option>' + html;
//html = '<option value="" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl["optionType"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl["optionType"+optIndex]) + '</option>' + html;
html = '<select class="SlectBox optionSel' + optIndex + '">' + html;
html += '</select>';
var $html = jju(html);
if (optionArr.length == 1) $html.css({
'display': 'none'
});
thisItem.find('.prodOptions').append($html);
// now remove any options with the label "Default Title" if ther are more than 1 option
if (thisItem.find('.prodOptions .optionSel1 option').length > 2 && thisItem.find('.prodOptions .optionSel1 option:contains("Default Title")')) {
thisItem.find('.prodOptions .optionSel1 option:contains("Default Title")').remove();
}
if (thisItem.find('.prodOptions .optionSel2 option').length > 2 && thisItem.find('.prodOptions .optionSel2 option:contains("Default Title")')) {
thisItem.find('.prodOptions .optionSel2 option:contains("Default Title")').remove();
}
if (thisItem.find('.prodOptions .optionSel3 option').length > 2 && thisItem.find('.prodOptions .optionSel3 option:contains("Default Title")')) {
thisItem.find('.prodOptions .optionSel3 option:contains("Default Title")').remove();
}
thisItem.find('.prodOptions .optionSel1, .prodOptions .optionSel2, .prodOptions .optionSel3').change();
}
//}
//return $html;
}
function buildQty(thisItem, thisEl) {
var html = '';
if (snippet_52_options.showAddToCart.values[0].allowQty.value == 0) {
var optionArr = ['1'];
} else {
var optionArr = [];
var qtyDropdown = snippet_52_options.showAddToCart.values[0].allowQty.values[1].qtyDropdown.value.replace(/ /g, '');
if (isNaN(qtyDropdown.replace(/,/g, ''))) qtyDropdown = '1';
var optionArr = qtyDropdown.split(',');
}
if (optionArr.length > 0) {
jju.each(optionArr, function(index, value) {
html += '<option value="' + value + '" ' + (optionArr.length == 1 ? 'selected' : '') + '>' + snippet_52_options.showAddToCart.values[0].allowQty.values[1].langQtyPrefix.value + ' ' + value + '</option>';
})
html = '<option value="" ' + (optionArr.length > 1 ? 'selected' : '') + '>' + snippet_52_options.showAddToCart.values[0].allowQty.values[1].langQtyTitle.value + '</option>' + html;
//html = '<option value="" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl["optionType"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl["optionType"+optIndex]) + '</option>' + html;
html = '<select class="SlectBox qty">' + html;
html += '</select>';
var $html = jju(html);
if (optionArr.length == 1) $html.css({
'display': 'none'
});
thisItem.find('.prodOptions').append($html);
thisItem.find('.prodOptions .qty').change();
}
}
var addToCart = ju_debounce(function(thisItem) {
//function addToCart(thisItem){
var options1 = thisItem.find('.optionSel1');
var options2 = thisItem.find('.optionSel2');
var options3 = thisItem.find('.optionSel3');
var option1sel = options1.val() || '';
var option2sel = options2.val() || '';
var option3sel = options3.val() || '';
var qty = thisItem.find('.qty').val();
if (qty == "") qty = 1;
var thisIndex = thisItem.data('index');
var thisEl = snippet_52_prodsArr[thisIndex];
var thisId = thisEl.id;
var thisVariant;
var thisSku;
jju.each(thisEl.variantList, function() {
if (this.option1.replace(/"/g, "''") == option1sel && this.option2.replace(/"/g, "''") == option2sel && this.option3.replace(/"/g, "''") == option3sel) {
thisVariant = this.id;
thisSku = this.sku;
if (parseInt(this.inventory) < parseInt(qty)) qty = this.inventory;
return;
}
});
if (snippet_52_platform == 'Shopify') {
addToCartShopify(thisId, thisVariant, thisSku, qty)
}
if (snippet_52_platform == 'Magento') {
addToCartMagento(thisId, thisVariant, thisSku, qty)
parent.require(['Magento_Customer/js/customer-data'], function(customerData) {
setTimeout(function() {
customerData.reload(['cart']);
}, 1000);
});
}
if (snippet_52_platform == 'Wordpress') {
addToCartWordpress(thisId, thisVariant, thisSku, qty)
}
if (snippet_52_platform == 'BigCommerce') {
addToCartBigCommerce(thisId, thisVariant, thisSku, qty)
}
if (snippet_52_platform_other == 'Yahoo') {
addToCartYahoo(thisId, thisVariant, thisSku, qty)
}
if (snippet_52_platform_other == 'Netohq') {
addToCartNetohq(thisId, thisVariant, thisSku, qty)
}
getpromocode('21', '', currentcp, 1, (snippet_52_options.engageOnInteraction.value ? 1 : 0));
var addToCartPostFunUrl = snippet_52_options.showAddToCart.values[0].redirectAddToCart.values[1].redirectAddToCartUrl.value;
if (snippet_52_options.showAddToCart.values[0].redirectAddToCart.value == 1 && addToCartPostFunUrl != '') {
setTimeout(function() {
if (addToCartPostFunUrl.indexOf('(') != -1) {
eval(addToCartPostFunUrl);
} else {
top.location.href = snippet_52_options.showAddToCart.values[0].redirectAddToCart.values[1].redirectAddToCartUrl.value;
}
}, 1000)
}
try {
var qtySelVal = parent.jju(snippet_52_options.showAddToCart.values[0].qtySelector.value + ':visible:last').text();
if (!$.isNumeric(qtySelVal)) qtySelVal = 0;
qtySelVal = parseFloat(qtySelVal) + qty;
parent.jju(snippet_52_options.showAddToCart.values[0].qtySelector.value).text(qtySelVal);
} catch (er) {
//console.log('Mini Cart Quantity Selector not found');
}
var addButton = thisItem.find('.addButton');
addButton.html(snippet_52_options.showAddToCart.values[0].langItemAdded.value);
setTimeout(function() {
addButton.html(snippet_52_options.showAddToCart.values[0].langAddToBag.value)
}, 3000)
thisItem.find('.prodOptions').hide();
thisItem.find('.addNow').hide();
thisItem.find('.addButton').show();
}, 150, 'End');
// setup platform specific stuff
function addToCartShopify(Id, Variant, Sku, Qty) {
jju.ajax({
url: '/cart/add.js',
type: "post",
dataType: "text",
data: {
items: [{
id: Variant,
quantity: Qty
}],
sections: "header"
}
}).done(function(data) {
var htmlHeader = '';
try {
parent.update_shopify_ju_cart();
var parsedData = jju.parseJSON(data);
var htmlHeader = parsedData.sections.header;
} catch (e) {};
if (htmlHeader.length > 100) {
parent.jju('[data-section-id="header"]').html(htmlHeader);
}
});
}
function addToCartMagento(Id, Variant, Sku, Qty) {
jju.ajax({
url: '/justuno/cart/add?product=' + Id + '&variant=' + Variant + '&qty=' + Qty,
type: "get"
}).done(function(data) {
//
}).fail(function(jqXHR, textStatus) {
// incase they don't have the latest magento plugin
jju.ajax({
url: '/checkout/cart/add/product/' + Variant + '/qty/1',
type: "get"
}).done(function(data) {
//
}).fail(function(jqXHR, textStatus) {
//
});
});
}
function addToCartWordpress(Id, Variant, Sku, Qty) {
jju.ajax({
url: '/?add-to-cart=' + Variant + '&quantity=' + Qty,
type: "get"
}).done(function(data) {
//
});
}
function addLinkShopify() {
jju('.prodLink').each(function() {
if (jju(this).attr('href').indexOf('/products/') == -1) jju(this).attr('href', '/products/' + jju(this).attr('href'))
})
}
function addToCartBigCommerce(Id, Variant, Sku, Qty) {
jju.ajax({
url: '/cart.php?action=add&sku=' + Sku + '&qty=' + Qty,
type: "get",
dataType: "text"
}).done(function(data) {
// now fetch new cart info
try {
parent.update_bc_ju_cart();
} catch (e) {};
});
}
function addToCartYahoo(Id, Variant, Sku, Qty) {
setTimeout(function() {
parent.document.location = 'https://order.store.yahoo.net/' + snippet_52_platform_storeID + '/ymix/MetaController.html?eventName.addEvent&cartDS.shoppingcart_ROW0_m_orderItemVector_ROW0_m_itemId=' + Id + '&cartDS.shoppingcart_ROW0_m_orderItemVector_ROW0_m_quantity=' + Qty + '&ysco_key_cs_item=1§ionId=ysco.cart&ysco_key_store_id=' + snippet_52_platform_storeID;
}, 600)
}
function addToCartNetohq(Id, Variant, Sku, Qty) {
parent.jju('#ju-sku, #ju-qty').remove();
parent.jju('body').append('<input type="hidden" id="ju-sku" value="' + Sku + '"><input type="hidden" id="ju-qty" value="' + Qty + '">');
parent.$.addCartItem('ju-sku', 'ju-qty');
// jju.ajax({
// url: '/_mycart?sku='+Sku+'&qty='+Qty,
// type: "get",
// dataType: "text"
// }).done(function(data) {
// //
// });
}
function getSlidesPerView() {
var ww = getWindowWidth();
var wh = getWindowHeight();
try {
var direction = snippet_52_options.direction.value;
var responsiveColumnOption = snippet_52_options.responsiveColumns.value;
var responsiveColumnOptionArr = responsiveColumnOption.replace(/\s/g, '').split(',');
var responsiveColumnOptionArrLast = responsiveColumnOptionArr[responsiveColumnOptionArr.length - 1];
for (var i = responsiveColumnOptionArr.length; i < 8; i++) {
responsiveColumnOptionArr.push(responsiveColumnOptionArrLast);
}
if (direction == 'horizontal') {
if (ww < 575) return parseInt(responsiveColumnOptionArr[0]);
if (ww < 815) return parseInt(responsiveColumnOptionArr[1]);
if (ww < 1055) return parseInt(responsiveColumnOptionArr[2]);
if (ww < 1295) return parseInt(responsiveColumnOptionArr[3]);
if (ww < 1535) return parseInt(responsiveColumnOptionArr[4]);
if (ww < 1775) return parseInt(responsiveColumnOptionArr[5]);
if (ww < 2015) return parseInt(responsiveColumnOptionArr[6]);
} else {
if (wh < 575) return parseInt(responsiveColumnOptionArr[0]);
if (wh < 815) return parseInt(responsiveColumnOptionArr[1]);
if (wh < 1055) return parseInt(responsiveColumnOptionArr[2]);
if (wh < 1295) return parseInt(responsiveColumnOptionArr[3]);
if (wh < 1535) return parseInt(responsiveColumnOptionArr[4]);
if (wh < 1775) return parseInt(responsiveColumnOptionArr[5]);
if (wh < 2015) return parseInt(responsiveColumnOptionArr[6]);
}
return parseInt(responsiveColumnOptionArr[7]);
} catch (e) {
if (snippet_52_options.direction.value == 'horizontal') {
if (ww < 575) return 2;
if (ww < 815) return 3;
if (ww < 1055) return 4;
if (ww < 1295) return 5;
if (ww < 1535) return 6;
if (ww < 1775) return 7;
if (ww < 2015) return 8;
return 9;
} else {
if (ww < 575) return 1;
if (ww < 1000) return 2;
return 2;
}
}
}
function resizeSwiper() {
snippet_52_mySwiper.params.slidesPerView = getSlidesPerView();
snippet_52_mySwiper.params.slidesPerGroup = getSlidesPerView();
snippet_52_mySwiper.update();
}
function autoPlay() {
if (snippet_52_options.autoScroll.value) {
var autoPlayObj = {
delay: 5000,
disableoninteraction: true
}
return autoPlayObj;
} else {
return false;
}
}
if (snippet_52_options.direction.value == 'vertical') {
jju('.snippet_52_plugin-wrapper .swiper-container').css({
'height': getWindowHeight() + 'px',
'overflow': 'hidden'
});
} else {
jju('.snippet_52_plugin-wrapper .swiper-container').css({
'height': 'auto',
'overflow': 'visible'
});
}
window.snippet_52_mySwiper = new Swiper('.snippet_52_plugin-wrapper .swiper-container', {
// Optional parameters
direction: snippet_52_options.direction.value,
height: (snippet_52_options.direction.value == 'vertical' ? getWindowHeight() : null),
slidesPerView: getSlidesPerView(),
spaceBetween: (snippet_52_options.direction.value == 'vertical' ? 20 : 10),
slidesPerGroup: getSlidesPerView(),
loop: true,
shortSwipes: true,
mousewheel: {
forceToAxis: true
},
threshold: snippet_52_options.prodLimit.value,
autoplay: autoPlay(),
// If we need pagination
pagination: (snippet_52_options.pagination.value ? {
el: '.swiper-pagination',
clickable: true,
dynamicBullets: true
} : false),
// Navigation arrows
navigation: (snippet_52_options.navigation.value != 'none' ? {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev'
} : false),
// And if we need scrollbar
/*
scrollbar: {
el: '.swiper-scrollbar'
}
*/
on: {
slideChange: function() {
console.log('swiper initialized');
items = jju('.swiper-slide-content');
items.find('.prodOptions, .options, .selOptions, .addNow').hide();
items.find('.addButton').show();
items.find("select:visible").simpleselect("setInactive")
jju('.swiper-container').removeClass('overflowVisible');
jju('.prodImage2, .prodImage3').stop().fadeOut(100);
},
},
})
}
var snippet_52_prodsFilter = [];
if (parent.juDa) {
if (parent.juDa.prods_seen && parent.juDa.prods_seen.length > 0) {
snippet_52_prodsFilter = parent.juDa.prods_seen.map(function(item, index) {
return item.ID;
});
}
if (parent.juDa.cartItem) {
for (var key in parent.juDa.cartItem) {
// skip loop if the property is from prototype
if (!parent.juDa.cartItem.hasOwnProperty(key)) continue;
snippet_52_prodsFilter.push(parent.juDa.cartItem[key].v.i);
}
}
if (parent.ju_config && parent.ju_config.prodId) {
snippet_52_prodsFilter.push(parent.ju_config.prodId);
}
}
var snippet_52_prodsFilterUnique = [];
jju.each(snippet_52_prodsFilter, function(i, el) {
if (jju.inArray(el, snippet_52_prodsFilterUnique) === -1) snippet_52_prodsFilterUnique.push(el);
});
if (window.juPromo) {
var snippet_52_guid = parent.ju_num.toLowerCase();
} else {
var snippet_52_guid = account_guid;
}
var snippet_52_dataUri = 'https://recommend.jst.ai/products/v2/' + snippet_52_guid + '/' + snippet_52_options.algo.value + '?limit=' + snippet_52_options.prodLimit.value + '&products=' + snippet_52_prodsFilterUnique.join();
window.reloadRec = function(algo, cartitems, vieweditems, purchaseditems, currentitem) {
var snippet_52_prodsFilter = [];
if (parent.juDa) {
if (vieweditems && parent.juDa.prods_seen && parent.juDa.prods_seen.length > 0) {
snippet_52_prodsFilter = parent.juDa.prods_seen.map(function(item, index) {
return item.ID;
});
}
if (cartitems && parent.juDa.cartItem) {
for (var key in parent.juDa.cartItem) {
// skip loop if the property is from prototype
if (!parent.juDa.cartItem.hasOwnProperty(key)) continue;
snippet_52_prodsFilter.push(parent.juDa.cartItem[key].v.i);
}
}
if (purchaseditems && parent.juDa.order) {
for (var key in parent.juDa.order) {
// skip loop if the property is from prototype
if (!parent.juDa.order.hasOwnProperty(key)) continue;
if (purchaseditems && parent.juDa.order[key].i) {
for (var item in parent.juDa.order[key].i) {
// skip loop if the property is from prototype
if (!parent.juDa.order[key].i.hasOwnProperty(item)) continue;
snippet_52_prodsFilter.push(parent.juDa.order[key].i[item].i);
}
}
}
}
if (currentitem && parent.ju_config && parent.ju_config.prodId) {
snippet_52_prodsFilter.push(parent.ju_config.prodId);
}
}
snippet_52_prodsFilterUnique = [];
jju.each(snippet_52_prodsFilter, function(i, el) {
if (jju.inArray(el, snippet_52_prodsFilterUnique) === -1) snippet_52_prodsFilterUnique.push(el);
});
snippet_52_dataUri = 'https://recommend.jst.ai/products/v2/' + snippet_52_guid + '/' + algo + '?limit=' + snippet_52_options.prodLimit.value + '&products=' + snippet_52_prodsFilterUnique.join();
jju.ajax({
type: "GET",
url: snippet_52_dataUri,
cache: true
}).always(function(data) {
if (!data.products && (!window.juPromo || previewmode == "1")) {
data = {
filters: [],
platform: "shopify",
algorithm: "mpbyviewed",
products: [testProd, testProd, testProd, testProd, testProd, testProd]
};
}
snippet_52_filters = data.filters;
snippet_52_platform = data.platform;
snippet_52_algo = data.algorithm;
snippet_52_prod = data.products;
if (snippet_52_prod.length > 0) {
snippet_52_generateSuggestions(snippet_52_prod, false);
} else if (window.juPromo && window.previewmode != "1") {
close_window();
} else {
snippet_52_prod = [testProd, testProd, testProd, testProd, testProd, testProd];
snippet_52_generateSuggestions(snippet_52_prod, false);
}
window.recLoaded = true;
})
}
// aniCallback
if (typeof snippet_52_Callback !== 'function') {
var snippet_52_Callback = aniCallback;
aniCallback = function() {
var snippet_52_callbackresult = snippet_52_Callback.apply(this, arguments);
var thisPrePost = $('.design-layer[data-layerid="' + snippet_52_layerId + '"]').data('prepost');
if ((prepoststatus === thisPrePost || thisPrePost === 'both') && (prepoststatus != window.lastprepoststatus || !window.juPromo)) {
window.lastprepoststatus = prepoststatus;
if (!window.recQueried && !window.recLoaded) {
window.recQueried = true;
jju.when(
jju.ajax({
type: "GET",
url: 'https://unpkg.com/swiper@7/swiper-bundle.min.js',
dataType: "script",
cache: true
}),
jju.ajax({
type: "GET",
url: 'https://unpkg.com/swiper@7/swiper-bundle.min.css',
cache: true
})
)
.done(function(a1, a2) {
var css = a2[0];
jju('<style type="text/css" class="snippet_52_css">\n' + css + '</style>').appendTo("head");
jju.ajax({
type: "GET",
url: snippet_52_dataUri,
cache: true
}).always(function(data) {
if (!data.products && (!window.juPromo || previewmode == "1")) {
data = {
filters: [],
platform: "shopify",
algorithm: "mpbyviewed",
products: [testProd, testProd, testProd, testProd, testProd, testProd]
};
}
snippet_52_filters = data.filters;
snippet_52_platform = data.platform;
snippet_52_algo = data.algorithm;
snippet_52_prod = data.products;
if (snippet_52_prod.length > 0) {
snippet_52_generateSuggestions(snippet_52_prod, true);
} else if (window.juPromo && window.previewmode != "1") {
close_window();
} else {
snippet_52_prod = [testProd, testProd, testProd, testProd, testProd, testProd];
snippet_52_generateSuggestions(snippet_52_prod, true);
}
window.recLoaded = true;
})
});
} else if (window.recLoaded) {
snippet_52_generateSuggestions(snippet_52_prod, false);
}
}
};
}
var testProd = {
"id": "10564981320",
"url": "",
"title": "Test Product Title",
"imageURL1": "https://my.jst.ai/admin/img/placeholder.gif",
"imageURL2": "",
"imageURL3": "",
"score": 1,
"price": 14.99,
"msrp": 29.99,
"optionType1": "size",
"optionType2": "color",
"optionType3": "",
"variantList": [{
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "red",
"option2": "Large",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "red",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue",
"option2": "Large",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue1",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue2",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue3",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue4",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue5",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue6",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue7",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue8",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue9",
"option2": "XLarge",
"option3": ""
}, {
"id": "xxxxxxxxxx",
"imageURL1": "",
"imageURL2": "",
"imageURL3": "",
"sku": "xxxxxxxxx",
"title": "default",
"price": 14.99,
"msrp": 29.99,
"inventory": 1,
"option1": "blue10",
"option2": "XLarge",
"option3": ""
}]
};
#1 JavaScript::Write (size: 113905) - SHA256: c04abe36090f7653fd3e9c2d1547dd7b5b866720870a7ef21749a458ee7f5c72
< !DOCTYPE html >
< html xmlns: og = "http://opengraphprotocol.org/schema/"
xmlns: fb = "http://www.facebook.com/2008/fbml"
lang = "en" >
< head >
< title > product recommendations(desktop)[commerce ai] < /title> < meta http - equiv = "Content-Type"
content = "text/html;charset=utf-8" / >
< link rel = "stylesheet"
href = "https://cdn.jst.ai/ifm_4.1.css?v=2.11.56" >
< style class = "removeFocusBorder" > * : focus {
outline: none;border - color: inherit; - webkit - box - shadow: none;box - shadow: inherit;
} < /style> < script language = "javascript"
type = "text/javascript"
src = "https://cdn.jst.ai/jquery.min.js" > < /script> < script >
var currentcp = 830760;
var ac_guid = "{55DD516C-3AB9-4B5D-9226-37601AD034B2}";
var httplink = "https://";
//var viewheight = 0;
var ju_sid = parent._ju_dt;
var ju_mobile = "false";
var previewmode = "0";
var campaignid = "816826";
var ex_ID = "0";
var cm_title = "product recommendations(desktop) [commerce ai]";
var ju_ga_tracking = false;
var promotype = "2";
var userIP = "91.90.42.154";
var arbor = true;
var fetched = false;
var scroll_top = parent.jju(window).scrollTop();
var preload = false;
var fixed = parent.fixed_supported;
var iframe = true;
var jju;
var current_server_time_offset = (new Date()).getTime() - (new Date((new Date()).toLocaleString('en-US', {
timeZone: 'America/Los_Angeles'
}))).getTime();
var geo_country = parent.ju_config.ju_country;
var geo_region = parent.ju_config.ju_region;
var geo_city = parent.ju_config.ju_city;
var geo_zip = parent.ju_config.ju_zip;
var country = geo_country;
var ju_widget_v = "4.1";
var ju_brverify_config = false;
var parent_url = parent.fetchWindowHref();
if (parent_url == '') parent_url = "https://www.justuno.com";
var referringURL = parent.ju_referrer_url;
var camefromURL = parent.juDs.camefrom;
var firstURL = parent.juDs.firsturl;
var newuser = parent.ju_new_user_ever == 1 ? true : false;
var sessionkey = parent.ju_config.ju_sessionkey;
var ju_aserver = parent.ju_profileUrl;
var pageid = parent.ju_pageid;
var ju_onboarding_steps = (parent.ju_onboarding_steps === '' ? 3 : parent.ju_onboarding_steps);
var ju_onboarding_display = (parent.ju_onboarding_display === '' ? -1 : parent.ju_onboarding_display);
var ju_disable_auto_engagements = false;
var isEU = parent.ju_config.ju_EU;
var previously_engaged = false;
var dupEmail = "You've already given us that email address before";
popup_json = {
"design": {
"version": "3.53",
"themeId": 151898,
"popup": {
"layers": {
"0": {
"z-index": 5,
"euonly": false,
"visible": true,
"prepost": "both",
"layertype": "frame",
"layername": "Frame",
"layerid": 1,
"layerx": 150,
"layery": 100,
"layerwidth": 1078,
"layerheight": 421,
"layerrotate": 0,
"effect": "fade",
"layereffect": "none",
"layereffect-speed": 0,
"layereffect-delay": 0,
"scalex": 1,
"scaley": 1,
"editable": {
"position": 4,
"opacity": 1,
"direction": "to top",
"overlay_opacity": 1,
"push": "hover",
"effect": "zoomin",
"dim": "no",
"tab": "no",
"offset": 0,
"padding": 0,
"border-style": "solid",
"border-width": 0,
"border-radius": 0,
"box-shadow": 0,
"background-color": "rgba(255,255,255,1)",
"border-color": "rgba(222,222,222,1)",
"background-image-intro": "none",
"background-image-pre": "none",
"background-image-post": "none",
"gradient-color": "rgba(255,255,255,1)",
"integ_type": "",
"sms": "",
"list_id": "",
"resub": "",
"status": "",
"reactstate": "",
"segment_ids": "",
"merge_fields": "",
"group_ids": "",
"groupcat_id": "",
"selclientid": "",
"click-hide": 1
}
},
"1": {
"z-index": 52,
"euonly": false,
"visible": true,
"prepost": "post",
"layertype": "snippet",
"layername": "Plugin 52",
"layerid": 52,
"layerx": 9,
"layery": 120.99,
"layerwidth": 1060,
"layerheight": 243,
"effect": "fade",
"layereffect": "none",
"layereffect-speed": 1,
"layereffect-delay": 0,
"scalex": 1,
"scaley": 1,
"editable": {
"opacity": 1,
"padding": 0,
"direction": "to top",
"border-style": "solid",
"border-width": 0,
"border-radius": 0,
"box-shadow": 0,
"background-color": "rgba(255,255,255,0)",
"gradient-color": "rgba(255,255,255,0)",
"border-color": "#000",
"text-paragraph": "center",
"color": "#333333",
"font-family": "Arial,Helvetica,sans-serif",
"font-size": 14,
"sticky": "none",
"offset-left": 0,
"offset-right": 0,
"offset-top": 0,
"offset-bottom": 0,
"access": "",
"tabindex": ""
},
"snippet": "<script>\n /* version: 0.9 */\n /* <>PLUGINMETADATA<>25<>PLUGINMETADATA<> */\n /* Configuration START */ \nvar snippet_52_options = {\n \"algo\": {\n \"options\": [\n {\n \"label\": \"Cross-Sell\",\n \"value\": \"3024410d-3c98-48ea-9d69-fce46e6319e7\"\n },\n {\n \"label\": \"Upsell\",\n \"value\": \"1316545f-b04f-485d-ba78-8566bbc017fa\"\n },\n {\n \"label\": \"Most Ordered\",\n \"value\": \"03856576-d022-4b48-913b-208168133745\"\n },\n {\n \"label\": \"Most Viewed\",\n \"value\": \"bfd58ad7-e2f4-4fcc-b379-2267cef69335\"\n },\n {\n \"label\": \"Previously Viewed\",\n \"value\": \"828a578f-871b-4cb0-8c9d-d0928285b559\"\n },\n {\n \"label\": \"Oliver Accessories\",\n \"value\": \"48e6015c-c7d8-44fe-a6a1-15bc1d1803fd\"\n },\n {\n \"label\": \"Reese Accessories\",\n \"value\": \"54e629da-4590-4fe1-88ca-137f6a1a431a\"\n },\n {\n \"label\": \"London Accessories\",\n \"value\": \"6ddffc2f-6c9a-406f-801e-70cf561853c7\"\n },\n {\n \"label\": \"blankets cross-sell\",\n \"value\": \"85bc6aca-070b-435c-9078-c1cee12fea68\"\n },\n {\n \"label\": \"Erin Accessories\",\n \"value\": \"87254f26-94e8-45d5-9846-ab0862ffd32c\"\n },\n {\n \"label\": \"Kennedy Accessories\",\n \"value\": \"98c15ba3-cb47-4d81-8f28-2b7288475e8c\"\n },\n {\n \"label\": \"Harper Accessories\",\n \"value\": \"999d8fec-eb2f-4e3b-a70e-2c838febb587\"\n },\n {\n \"label\": \"Recommended Products\",\n \"value\": \"c4881a51-dcc8-4ed9-98f7-ef914c6bb695\"\n },\n {\n \"label\": \"Ava Accessories\",\n \"value\": \"d8e2453d-e550-4bd8-9698-c180c54ebc78\"\n },\n {\n \"label\": \"Evan Accessories\",\n \"value\": \"e7f0e26e-68ed-4897-a0c4-5add1584b876\"\n }\n ],\n \"value\": \"c4881a51-dcc8-4ed9-98f7-ef914c6bb695\",\n \"type\": \"select\",\n \"title\": \"AI Engine Type\",\n \"help\": \"\"\n },\n \"prodLimit\": {\n \"value\": 20,\n \"type\": \"int\",\n \"title\": \"Product Limit\",\n \"help\": \"\"\n },\n \"direction\": {\n \"options\": [\n {\n \"label\": \"Horizontal\",\n \"value\": \"horizontal\"\n },\n {\n \"label\": \"Vertical\",\n \"value\": \"vertical\"\n }\n ],\n \"value\": \"horizontal\",\n \"type\": \"select\",\n \"title\": \"Direction\",\n \"help\": \"\"\n },\n \"responsiveColumns\": {\n \"value\": \"1,2,3,4,5,6,7,8,9,10\",\n \"type\": \"text\",\n \"title\": \"Responsive Layout Items\",\n \"help\": \"Starting with mobile phone sizes, comma seperated number of products per view up to large displays\"\n },\n \"navigation\": {\n \"options\": [\n {\n \"label\": \"None\",\n \"value\": \"none\"\n },\n {\n \"label\": \"Middle Sides\",\n \"value\": \"sides\"\n },\n {\n \"label\": \"Top Sides\",\n \"value\": \"top\"\n },\n {\n \"label\": \"Bottom Sides\",\n \"value\": \"bottom\"\n }\n ],\n \"value\": \"sides\",\n \"type\": \"select\",\n \"title\": \"Arrows\",\n \"help\": \"\"\n },\n \"pagination\": {\n \"value\": false,\n \"type\": \"bit\",\n \"title\": \"Show pagination dots\",\n \"help\": \"\"\n },\n \"autoScroll\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Auto Scroll Products\",\n \"help\": \"\"\n },\n \"showSecondImage\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Alternate Image on Hover\",\n \"help\": \"\"\n },\n \"itemMaxHeight\": {\n \"value\": 300,\n \"type\": \"int\",\n \"title\": \"Max Item Height\",\n \"help\": \"\"\n },\n \"maxImageHeight\": {\n \"value\": 120,\n \"type\": \"int\",\n \"title\": \"Max Product Image Height\",\n \"help\": \"\"\n },\n \"engageOnInteraction\": {\n \"value\": false,\n \"type\": \"bit\",\n \"title\": \"Next Tab on Interaction\",\n \"help\": \"\"\n },\n \"showAddToCart\": {\n \"value\": 0,\n \"type\": \"options\",\n \"title\": \"Show Add To Cart Button\",\n \"help\": \"\",\n \"labels\": [\n \"Yes\",\n \"No\"\n ],\n \"values\": [\n {\n \"allowQty\": {\n \"value\": 0,\n \"type\": \"options\",\n \"title\": \"Show Quantity Selector\",\n \"help\": \"\",\n \"labels\": [\n \"No\",\n \"Yes\"\n ],\n \"values\": [\n {},\n {\n \"langQtyTitle\": {\n \"value\": \"SELECT QUANTITY\",\n \"type\": \"text\",\n \"title\": \"Language: SELECT QUANTITY\",\n \"help\": \"\"\n },\n \"langQtyPrefix\": {\n \"value\": \"QUANTITY:\",\n \"type\": \"text\",\n \"title\": \"Language: QUANTITY prefix\",\n \"help\": \"\"\n },\n \"qtyDropdown\": {\n \"value\": \"1,2,3,4,5,6,7,8,9,10\",\n \"type\": \"text\",\n \"title\": \"Quantity Options\",\n \"help\": \"\"\n }\n }\n ]\n },\n \"showHoverOnly\": {\n \"value\": false,\n \"type\": \"bit\",\n \"title\": \"Show on Hover Only\",\n \"help\": \"\"\n },\n \"belowName\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Place Button Below Name\",\n \"help\": \"\"\n },\n \"langSelectOptions\": {\n \"value\": \"SELECT OPTIONS\",\n \"type\": \"text\",\n \"title\": \"Language: SELECT OPTIONS\",\n \"help\": \"\"\n },\n \"langSelect\": {\n \"value\": \"Select\",\n \"type\": \"text\",\n \"title\": \"Language: Select [option]\",\n \"help\": \"\"\n },\n \"langAddToBag\": {\n \"value\": \"ADD TO CART\",\n \"type\": \"text\",\n \"title\": \"Language: ADD TO CART\",\n \"help\": \"\"\n },\n \"langAddNow\": {\n \"value\": \"ADD NOW\",\n \"type\": \"text\",\n \"title\": \"Language: ADD NOW\",\n \"help\": \"\"\n },\n \"langItemAdded\": {\n \"value\": \"ITEM ADDED!\",\n \"type\": \"text\",\n \"title\": \"Language: ITEM ADDED!\",\n \"help\": \"\"\n },\n \"btnColor\": {\n \"value\": \"rgba(64,115,141,1)\",\n \"type\": \"colorpicker\",\n \"title\": \"Button Color\",\n \"help\": \"\"\n },\n \"btnBrdColor\": {\n \"value\": \"rgba(64,115,141,1)\",\n \"type\": \"colorpicker\",\n \"title\": \"Button Border Color\",\n \"help\": \"\"\n },\n \"btnTextColor\": {\n \"value\": \"rgba(255,255,255,1)\",\n \"type\": \"colorpicker\",\n \"title\": \"Button Text Color\",\n \"help\": \"\"\n },\n \"qtySelector\": {\n \"value\": \".badge--cart\",\n \"type\": \"text\",\n \"title\": \"Mini Cart Quantity Selector\",\n \"help\": \"\"\n },\n \"refreshCart\": {\n \"options\": [\n {\n \"label\": \"Select\",\n \"value\": \"\"\n },\n {\n \"label\": \"Sellify\",\n \"value\": \"sellify\"\n }\n ],\n \"value\": \"\",\n \"type\": \"select\",\n \"title\": \"Select Cart App\",\n \"help\": \"\"\n },\n \"redirectAddToCart\": {\n \"value\": 0,\n \"type\": \"options\",\n \"title\": \"URL/Function After Add to Cart\",\n \"help\": \"\",\n \"labels\": [\n \"No\",\n \"Yes\"\n ],\n \"values\": [\n {},\n {\n \"redirectAddToCartUrl\": {\n \"value\": \"/cart\",\n \"type\": \"text\",\n \"title\": \"URL/Function After Added To Cart\",\n \"help\": \"\"\n }\n }\n ]\n },\n \"showVariantImage\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Show Variant Images\",\n \"help\": \"\"\n }\n },\n {}\n ]\n },\n \"showProductName\": {\n \"value\": 0,\n \"type\": \"options\",\n \"title\": \"Show Product Name\",\n \"help\": \"\",\n \"labels\": [\n \"Yes\",\n \"No\"\n ],\n \"values\": [\n {\n \"allCaps\": {\n \"value\": false,\n \"type\": \"bit\",\n \"title\": \"Uppercase Name\",\n \"help\": \"\"\n },\n \"ellipsize\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Ellipsize Title\",\n \"help\": \"\"\n }\n },\n {}\n ]\n },\n \"showProductPrice\": {\n \"value\": 0,\n \"type\": \"options\",\n \"title\": \"Show Product Price\",\n \"help\": \"\",\n \"labels\": [\n \"Yes\",\n \"No\"\n ],\n \"values\": [\n {\n \"priceTextColor\": {\n \"value\": \"rgba(0,0,0,1)\",\n \"type\": \"colorpicker\",\n \"title\": \"Price Text Color\",\n \"help\": \"\"\n },\n \"showMSRP\": {\n \"value\": true,\n \"type\": \"bit\",\n \"title\": \"Show MSRP\",\n \"help\": \"\"\n },\n \"priceLocale\": {\n \"options\": [\n {\n \"label\": \"US DOLLAR ($, USD) $12.50\",\n \"value\": \"en-US/USD\"\n },\n {\n \"label\": \"CANADIAN DOLLAR ($, CAD) $12.50\",\n \"value\": \"en-CA/CAD\"\n },\n {\n \"label\": \"CANADIAN DOLLAR ($, CAD) 12,50 $\",\n \"value\": \"fr-CA/CAD\"\n },\n {\n \"label\": \"AUSTRALIAN DOLLAR ($, AUD) $12.50\",\n \"value\": \"en-AU/AUD\"\n },\n {\n \"label\": \"EURO (�, EUR)\\t12,50 �\",\n \"value\": \"de-DE/EUR\"\n },\n {\n \"label\": \"EURO (�, EUR)\\t�12.50\",\n \"value\": \"en-IE/EUR\"\n },\n {\n \"label\": \"EURO (�, EUR)\\t�12,50\",\n \"value\": \"nl-NL/EUR\"\n },\n {\n \"label\": \"BRITISH POUNDS (�, GBP) �12.50\",\n \"value\": \"en-GB/GBP\"\n },\n {\n \"label\": \"MEXICO PESO ($, MXN) $12.50\",\n \"value\": \"es-MX/MXN\"\n },\n {\n \"label\": \"CHILEAN PESO ($, CLP) $12\",\n \"value\": \"es-CL/CLP\"\n },\n {\n \"label\": \"JAPANESE YEN (�, JPY) �1250\",\n \"value\": \"ja-JP/JPY\"\n },\n {\n \"label\": \"NEW ZEALAND DOLLAR ($, NZD) $12.50\",\n \"value\": \"en-NZ/NZD\"\n },\n {\n \"label\": \"HONG KONG DOLLAR ($, HKD) $12.50\",\n \"value\": \"zh-HK/HKD\"\n },\n {\n \"label\": \"SINGAPORE DOLLAR ($, SGD) $12.50\",\n \"value\": \"zh-SG/SGD\"\n },\n {\n \"label\": \"DANISH KRONE (KR, DKK) 12,50 kr.\",\n \"value\": \"da-DK/DKK\"\n },\n {\n \"label\": \"INDIAN RUPI (?, INR) ?12.50\",\n \"value\": \"en-IN/INR\"\n }\n ],\n \"value\": \"en-US/USD\",\n \"type\": \"select\",\n \"title\": \"Currency Format\",\n \"help\": \"\"\n }\n },\n {}\n ]\n }\n}\n /* Configuration END */\n\nwindow.recQueried = false;\nwindow.recLoaded = false;\nwindow.snippet_52_platform_other = \"\" // \"Yahoo, Netohq\";\nwindow.snippet_52_platform_storeID = \"\" //\"yhst-xyz\";\n\nfunction snippet_52_options_js(){\ntry {\n snippet_52_options.algo.options = prodRecRuleSets.map(function(val) { return {label: JSON.stringify(val.name).slice(1, -1).replace(/\"/g,\"\"), value: encodeURIComponent(val.ruleset_id)} });\n} catch(e) {/*Do Nothing*/}\n};\n\nsnippet_52_options_js();\n\n<\/script>\n<div class=\"disabler\"><\/div>\n<style>\n\n.swiper-pagination{\n bottom:-15px !important;\n}\n\n.hidden_select_container {\n width: 0;\n height: 0;\n overflow: hidden;\n}\n\n.simpleselect,\n.simpleselect * {\n box-sizing: content-box;\n}\n\n.simpleselect {\n position: relative;\n /* font-size: 13px; */\n background-color: #e05e60;\n /* color: #fff; */\n height: 36px;\n}\n\n.simpleselect .placeholder,\n.simpleselect .options .option,\n.simpleselect .options .optgroup .optgroup-label {\n padding: 9px 10px;\n line-height: 18px;\n cursor: pointer;\n border-top: 1px solid #fff;\n white-space:nowrap;\n overflow:hidden;\n font-size: 16px;\n letter-spacing: 1.5px;\n}\n\n.simpleselect .options::-webkit-scrollbar {\n -webkit-appearance: none;\n}\n\n.simpleselect .options::-webkit-scrollbar:vertical {\n width: 8px;\n}\n\n.simpleselect .options::-webkit-scrollbar-thumb {\n border-radius: 4px;\n}\n\n.simpleselect .options .option.unavailable{\n background:linear-gradient(to top left,\n rgba(0,0,0,0) 0%,\n rgba(0,0,0,0) calc(50% - 0.8px),\n rgba(255,255,255,1) 50%,\n rgba(0,0,0,0) calc(50% + 0.8px),\n rgba(0,0,0,0) 100%);\n background-color: rgba(0,0,0,.2) !important;\n color: #666;\n}\n\n.simpleselect .options .optgroup .optgroup-label {\n cursor: default;\n font-weight: bold;\n}\n\n.simpleselect .options .optgroup .option {\n padding-left: 20px;\n}\n\n.simpleselect .placeholder,\n.simpleselect .options {\n background-color: #e05e60;\n border: 1px solid #fff;\n /* -webkit-border-radius: 2px;\n -moz-border-radius: 2px;\n border-radius: 2px; */\n}\n\n.simpleselect .placeholder {\n position: relative;\n}\n\n.simpleselect .placeholder:after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 10px;\n width: 8px;\n -webkit-filter: brightness(0) invert(1);\n filter: brightness(0) invert(1);\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOCAYAAAASVl2WAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NjA0Q0FGMUI4RTU1MTFFMzhGMThCQzUzMTMxMzdBN0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NjA0Q0FGMUM4RTU1MTFFMzhGMThCQzUzMTMxMzdBN0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MDRDQUYxOThFNTUxMUUzOEYxOEJDNTMxMzEzN0E3RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2MDRDQUYxQThFNTUxMUUzOEYxOEJDNTMxMzEzN0E3RiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pq8U8ZgAAAClSURBVHjaYpw7dw4DEggEYh4gXgwTYEGS5AfiyVD6FBDfBAkyISloB2JpqAlLgZgNWYENEGciKTYG4haYFSCVKA6BglIg3gdSIAHEfQzYASfj////GfABJgYCgGXevLlyQNoDh/xrkBteAHEREKtjUeAJsuIXEKdgkewG4h0wNxwB4ulIkmeBuAbdkZVA/BSIvwBxNNRklLj4CMS50KC+CRMECDAA5ogdqmResXgAAAAASUVORK5CYII=\") 0 center no-repeat;\n}\n\n.simpleselect .options {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1000;\n width: calc(100% - 2px);\n background-color: #ccc;\n color:#333;\n}\n\n.simpleselect .options .option:first-child {\n display:none;\n}\n\n.simpleselect .options .option.active {\n background-color:rgba(255,255,255,.1);\n color: #000;\n}\n\n.simpleselect.disabled .placeholder,\n.simpleselect.disabled .placeholder:hover {\n background-color:rgba(255,255,255,.1);\n color: #fff;\n /* border-color: #fff; */\n cursor: default;\n}\n\n.simpleselect.disabled .placeholder:after {\n opacity: .5;\n}\n\n.snippet_52_plugin-wrapper {\n /* margin-left:10px; */\n overflow:hidden;\n}\n\n.snippet_52_plugin-wrapper .swiper-container {\n width: 100%;\n height:100%;\n padding-bottom: 20px;\n}\n\n.overflowVisible{\n overflow:visible;\n}\n\n.snippet_52_plugin-wrapper .swiper-slide {\n /* text-align: center; */\n /* font-size: 18px; */\n background: #fff;\n /* Center slide text vertically */\n display: -webkit-box;\n display: -ms-flexbox;\n display: -webkit-flex;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.snippet_52_plugin-wrapper .swiper-button-next, .snippet_52_plugin-wrapper .swiper-button-prev {\n width: 20px;\n height: 18px;\n margin-top: 0px;\n background-size: 17px;\n -webkit-filter: grayscale(1);\n filter: grayscale(1);\n transition: opacity .25s;\n -webkit-transition: opacity .25s;\n -moz-transition: opacity .25s;\n opacity: 0;\n background-color: rgba(255,255,255,.8);\n padding: 25px;\n position:absolute;\n display:none;\n}\n\n.snippet_52_plugin-wrapper .swiper-button-next:hover, .snippet_52_plugin-wrapper .swiper-button-prev:hover {\n background-color: rgba(255,255,255,1);\n}\n\n.snippet_52_plugin-wrapper .swiper-button-prev {\n left:2px;\n}\n\n.snippet_52_plugin-wrapper .swiper-button-next {\n right:0px;\n}\n\n.snippet_52_plugin-wrapper:hover .swiper-button-next, .snippet_52_plugin-wrapper:hover .swiper-button-prev {\n opacity: 1;\n}\n\n.snippet_52_plugin-wrapper .swiper-button-next:focus, .snippet_52_plugin-wrapper .swiper-button-prev:focus {\n outline:0;\n}\n\n.snippet_52_plugin-wrapper .swiper-slide-content {\n display:block;\n width: 100%;\n}\n\n.snippet_52_plugin-wrapper .prodAdd {\n max-width: 220px;\n margin: 0 auto;\n border-radius:5px;\n}\n\n.snippet_52_plugin-wrapper .prodLink {\n text-decoration:none;\n color:initial;\n}\n\n.snippet_52_plugin-wrapper .prodTitle {\n /* height: 25px; */\n /* line-height: 17px; */\n padding: 4px;\n /* font-size:16px; */\n font-weight:500;\n margin-top:10px;\n}\n\n.snippet_52_plugin-wrapper .prodPrice {\n /* font-size:17px; */\n font-size:1.3em;\n font-weight:400;\n padding: 4px;\n}\n\n.snippet_52_plugin-wrapper .prodActions {\n opacity:0;\n position: absolute;\n left: 0px;\n right: 0px;\n margin: 0 auto;\n transition: all .25s;\n -webkit-transition: all .25s;\n -moz-transition: all .25s;\n overflow:visible;\n}\n.snippet_52_plugin-wrapper .prodActionsCon{\n position: absolute;\n bottom: 0px;\n width: 100%;\n}\n\n.snippet_52_plugin-wrapper .prodOptions{\n width: 100%;\n max-width: 220px;\n margin: 0 auto;\n}\n\n.snippet_52_plugin-wrapper .swiper-slide-content:hover .prodActions {\n opacity:1;\n}\n\n#promo-design .snippet_52_plugin-wrapper .swiper-slide-content .prodActions, .snippet_52_plugin-wrapper.alwaysShowAddButton .swiper-slide-content .prodActions{\n opacity:1;\n}\n#promo-design .snippet_52_plugin-wrapper .swiper-button-next, #promo-design .snippet_52_plugin-wrapper .swiper-button-prev {\n opacity: 1;\n}\n\n@media only screen and (max-width: 940px) {\n .snippet_52_plugin-wrapper .swiper-slide-content .prodActions {\n opacity:1;\n }\n .snippet_52_plugin-wrapper .swiper-button-next, .snippet_52_plugin-wrapper .swiper-button-prev {\n opacity: 1;\n }\n}\n\n.snippet_52_plugin-wrapper .prodImages{\n position:relative;\n overflow:hidden;\n /* height: 220px; */\n}\n\n.snippet_52_plugin-wrapper .prodImage1, .snippet_52_plugin-wrapper .prodImage2, .snippet_52_plugin-wrapper .prodImage3, .snippet_52_plugin-wrapper .varImage1{\n position:absolute;\n left: 0;\n right: 0;\n margin: auto;\n top:0px;\n width:100%;\n height: 100%;\n object-fit: contain;\n outline:100px solid #fff;\n background-color:#fff;\n}\n\n.snippet_52_plugin-wrapper .prodImage2, .snippet_52_plugin-wrapper .prodImage3, .snippet_52_plugin-wrapper .varImage1{\n display:none;\n}\n\n.snippet_52_plugin-wrapper .addButton, .snippet_52_plugin-wrapper .selOptions, .snippet_52_plugin-wrapper .addNow {\n border:1px solid #fff;\n display:block;\n text-decoration:none;\n background-color: #e05e60;\n /* color: #fff; */\n height: 36px;\n line-height: 36px;\n font-size: 16px;\n letter-spacing: 1.5px;\n cursor: pointer;\n font-weight: 700;\n width: 100%;\n max-width: 220px;\n text-align:center;\n margin: 0 auto;\n padding:0px;\n overflow:hidden;\n border-radius:5px;\n}\n\n.snippet_52_plugin-wrapper .selOptions {\n display:none;\n background-color: rgba(0,0,0,.3);\n cursor:default;\n}\n.snippet_52_plugin-wrapper .addNow {\n display:none;\n background-color: #ec7d7e;\n}\n\n.allCaps{\n text-transform: uppercase !important;\n}\n\n.msrp{\n font-size: 80%;\n text-decoration: line-through;\n line-height: 1;\n font-weight: 300;\n color: initial;\n}\n\n<\/style>\n<script>\nif (!window.juPromo){\nclearInterval(window.snippet_52_addButton);\nwindow.snippet_52_addButton = setInterval(function(){\n if ($('.form-custom-options #algo_div label').length){\n if (prodRecStatus.account && prodRecStatus.importState==1){\n if (!$('.form-custom-options #algo_div button').length){\n var snippet_52_otherOptions = $('.form-custom-options #algo_div label').addClass('ptop-xs-5').wrap('<div><\/div>').closest('div');\n snippet_52_otherOptions.append('<button type=\"button\" onclick=\"window.__Justuno.toggleRulesetEditor();\" class=\"btn btn-secondary btn-sm pull-right mbot-5\">Add Rule<\/button>');\n }\n } else {\n if (!$('.form-custom-options #algo_div div.alert').length){\n var snippet_52_otherOptions = $('.form-custom-options #algo_div label').addClass('ptop-xs-5').wrap('<div><\/div>').closest('div');\n if (!prodRecStatus.account){\n snippet_52_otherOptions.prepend('<div class=\"alert alert-warning\">Commerce AI is not currently active<a href=\"Javascript:window.__Justuno.pushHistory(\\'/admin/v2/product-recommendations\\');\" style=\"font-weight:bold;display:block;\">Click to Activate<\/a>');\n } else {\n snippet_52_otherOptions.prepend('<div class=\"alert alert-warning\">Commerce AI has not finished importing your products<a href=\"Javascript:window.__Justuno.pushHistory(\\'/admin/v2/product-recommendations\\');\" style=\"font-weight:bold;display:block;\">Check Status<\/a>');\n }\n }\n }\n }\n},500);\n};\n\n$(document).off('.snippet_52_space');\n$(window).off('.snippet_52_space');\nvar snippet_52_fitlers;\nvar snippet_52_platform;\nvar snippet_52_algo;\nvar snippet_52_prod = [];\n\n/*\n* jQuery SimpleSelect\n* http://pioul.fr/jquery-simpleselect\n*\n* Copyright 2014, Philippe Masset\n* Dual licensed under the MIT or GPL Version 2 licenses\n*/\n;(function($) {\n\"use strict\";\n\n// Define variables and methods that all plugin instances have in common\nvar windowHeight = null,\n documentHeight = null,\n activeSimpleselects = [],\n isSsActivationForbidden = false,\n isNextDocumentClickEventDisabled = false,\n\n // Executed on the plugin's first call on a select\n init = function(options) {\n // Override default options\n options = $.extend({}, {\n fadingDuration: (options && options.fadeSpeed) || 0,\n containerMargin: 5,\n displayContainerInside: \"window\"\n }, options);\n\n // Loop through all selects\n this.each(function() {\n\n var t = $(this).addClass(\"simpleselected\");\n\n // Create the SimpleSelect\n var simpleselect = $('<div class=\"simpleselect\"><\/div>'),\n ssPlaceholder = $('<div class=\"placeholder\"><\/div>').appendTo(simpleselect),\n ssOptionsContainer = $('<div class=\"options\"><\/div>').appendTo(simpleselect);\n\n // Give an id to the SimpleSelect if the original select has one\n var selectIdAttribute = t.attr(\"id\");\n if (selectIdAttribute) {\n simpleselect.attr(\"id\", \"simpleselect_\"+ selectIdAttribute);\n }\n\n // Remove all change event listeners attached to the select before the plugin was called to avoid conflicts (see doc for more details)\n t.off(\"change\");\n\n // Set the size attribute of the select to more than 1 (makes our lives easier)\n t.attr(\"size\", 2);\n\n // SimpleSelect data\n var ssData = {\n select: t,\n selectOptions: null, // Set later, when the SimpleSelect is populated\n simpleselect: simpleselect,\n ssPlaceholder: ssPlaceholder,\n ssOptionsContainer: ssOptionsContainer,\n ssOptionsContainerHeight: null, // Set later, when the SimpleSelect is populated\n ssOptions: null, // Set later, when the SimpleSelect is populated\n canBeClosed: true,\n isActive: false,\n isScrollable: false,\n isDisabled: false,\n options: options\n };\n\n // SimpleSelect bindings\n simpleselect\n .data(\"simpleselect\", ssData)\n .on({\n mousedown: function() {\n ssData.canBeClosed = false;\n },\n click: function(e) {\n //if (touchPresent) return false;\n var eventTarget = $(e.target);\n if (eventTarget.hasClass(\"placeholder\")) {\n publicMethods.closeAllSelects.call(this);\n publicMethods.setActive.call(ssData);\n // Handle clicks on options\n } else if (eventTarget.hasClass(\"option\")) {\n isSsActivationForbidden = true; // Disable the eventual activation of the SimpleSelect if the select is focused, until a click event bubbles up to the document, at which point it's reset\n selectOption.call(ssData, eventTarget);\n publicMethods.setInactive.call(ssData);\n }\n e.preventDefault();\n },\n mouseup: function() {\n ssData.canBeClosed = true;\n },\n mouseover: function(e) {\n var eventTarget = $(e.target);\n // Handle mouseover on options\n if (eventTarget.hasClass(\"option\")) {\n selectSsOption.call(ssData, eventTarget);\n }\n }\n });\n\n // Select bindings\n t\n .data(\"simpleselect\", ssData)\n .on({\n keydown: function(e) {\n // On key enter\n if (e.keyCode == 13) {\n publicMethods.setInactive.call(ssData);\n }\n },\n focus: function() {\n // If a SimpleSelect option has just been clicked, don't activate the select\n if (!isSsActivationForbidden) {\n publicMethods.setActive.call(ssData);\n }\n },\n blur: function() {\n if (ssData.canBeClosed) {\n // publicMethods.setInactive.call(ssData);\n }\n },\n change: function(e, shouldLetChangeEventThrough) {\n if (!shouldLetChangeEventThrough) e.stopImmediatePropagation();\n var optionToSelect = getSsOptionToSelect.call(ssData);\n selectSsOption.call(ssData, optionToSelect, true);\n },\n // We don't care about that event it's only fired when the related label is clicked, and this action is already captured through the focus event on the select\n click: function(e) {\n e.stopPropagation();\n }\n });\n\n // Add the SimpleSelect to the DOM\n t.after(simpleselect);\n\n // Hide the original select\n var hiddenSelectContainer = $('<div class=\"hidden_select_container\"><\/div>');\n t.after(hiddenSelectContainer).appendTo(hiddenSelectContainer);\n\n // Update the SimpleSelect with the select's contents and state\n populateSs.call(ssData);\n updateSsState.call(ssData);\n\n // Populate variables dependent on presentation\n publicMethods.updatePresentationDependentVariables.call(ssData);\n });\n },\n\n // Update the value we stored of the window's height\n updateWindowHeightValue = function() {\n //windowHeight = $(window).height();\n var juLayer = $('.snippet_52_plugin-wrapper').closest('.design-layer');\n //console.log(juLayer.height()+juLayer.offset().top-10,juLayer.height(),juLayer.offset().top,10)\n if (snippet_52_options.direction.value=='vertical') {\n windowHeight = jju('.swiper-slide-content:first').height();\n } else {\n windowHeight = juLayer.height()+juLayer.offset().top-10;\n }\n },\n\n // Add a SimpleSelect to the array of active ones\n addToActiveSimpleselects = function(simpleselect) {\n activeSimpleselects.push(simpleselect);\n },\n\n // Remove a SimpleSelect from the array of active ones\n removeFromActiveSimpleselects = function(simpleselect) {\n activeSimpleselects = $.grep(activeSimpleselects, function(val) {\n return val !== simpleselect;\n });\n },\n\n // Populate the SimpleSelect with the select's options\n populateSs = function() {\n this.selectOptions = this.select.find(\"option\");\n var ssOptionsAndOptgroups = \"\",\n addOption = function(selectOption) {\n ssOptionsAndOptgroups += '<div class=\"option\">'+ selectOption.text() +'<\/div>';\n },\n addOptgroup = function(selectOptgroup) {\n ssOptionsAndOptgroups += '<div class=\"optgroup\">';\n var label = selectOptgroup.attr(\"label\");\n if (label) {\n ssOptionsAndOptgroups += '<div class=\"optgroup-label\">'+ htmlEncode(label) +'<\/div>';\n }\n selectOptgroup.children(\"option\").each(function() {\n addOption($(this));\n });\n ssOptionsAndOptgroups += \"<\/div>\";\n },\n htmlEncode = function(html) {\n return html.replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/<\/g, \"<\").replace(/>/g, \">\");\n },\n selectChildren = this.select.children(\"optgroup, option\"),\n selectHasOptgroups = false;\n selectChildren.each(function() {\n var t = $(this);\n if (t.is(\"optgroup\")) {\n addOptgroup(t);\n selectHasOptgroups = true;\n } else {\n addOption(t);\n }\n });\n\n this.ssOptions = this.ssOptionsContainer.html(ssOptionsAndOptgroups).find(\".option\");\n this.ssPlaceholder.text(getSsOptionToSelect.call(this).text());\n },\n\n // Enable/disable the SimpleSelect so as to replicate the select's state\n updateSsState = function() {\n this.isDisabled = this.select.prop(\"disabled\");\n this.simpleselect[(this.isDisabled? \"addClass\" : \"removeClass\")](\"disabled\");\n },\n\n // Select a SimpleSelect option among the ones in the options container\n // If the new option can be out of sight, make sure it isn't by scrolling the options container when necessary\n selectSsOption = function(ssOption, canBeOutOfSight) {\n this.ssOptions.removeClass(\"active\");\n ssOption.addClass(\"active\");\n\n // If the option that has been selected can be out of sight\n // (Can happen when changing the selected option based on the select's change event)\n if (canBeOutOfSight) {\n // If the options container is scrollable, and if the\n // to-be-selected SimpleSelect option isn't visible,\n // scroll enough (up or downward) to make it entirely visible\n if (this.isScrollable) {\n var ssOptionPosition = ssOption.position(),\n ssOptionsContainerScrollTop = this.ssOptionsContainer.scrollTop(),\n topViewOffset = ssOptionPosition.top,\n bottomViewOffset = this.ssOptionsContainer.height() - (ssOptionPosition.top + ssOption.outerHeight()),\n toScrollTo;\n\n if (topViewOffset < 0) {\n toScrollTo = ssOptionsContainerScrollTop + topViewOffset;\n } else if(bottomViewOffset < 0) {\n toScrollTo = ssOptionsContainerScrollTop - bottomViewOffset;\n }\n\n this.ssOptionsContainer.scrollTop(toScrollTo);\n }\n }\n },\n\n // Get the SimpleSelect option that has to be selected, based on the index of the currently selected select option\n // Returns a jQuery object\n getSsOptionToSelect = function() {\n var selectedOption = getSelectedOption.call(this),\n selectedOptionIndex = selectedOption.length? this.selectOptions.index(selectedOption) : 0;\n return $(this.ssOptions[selectedOptionIndex]);\n },\n\n // Select an option in the select corresponding to the given SimpleSelect option\n selectOption = function(ssOption) {\n var optionToSelect = $(this.selectOptions[this.ssOptions.index(ssOption)]);\n this.select.val(optionToSelect.val());\n },\n\n // Get the currently selected select option\n getSelectedOption = function() {\n return this.selectOptions.filter(\":selected\").first();\n },\n\n // Set the options container's initial CSS properties back (usually in order to get its dimensions)\n resetSsOptionsContainerCSS = function() {\n //console.log('resetSsOptionsContainerCSS')\n this.ssOptionsContainer.css({\n height: \"auto\",\n \"overflow-y\": \"visible\"\n });\n },\n\n // Force a layout repaint\n forceRepaint = function() {\n this.ssOptionsContainer.hide();\n this.ssOptionsContainer[0].offsetHeight;\n this.ssOptionsContainer.show();\n },\n\n // For use by Justuno to move the options up for better UI\n moveUpJu = function(t){\n // let's just reset t since I can't get it to work\n t = 0;\n var ssOptionCnt = this.ssOptionsContainer.find('.option').length-1;\n var ssOptionHeight = this.ssOptionsContainer.find('.option:first').outerHeight();\n var ssProdImageHeight = jju('.snippet_52_plugin-wrapper .prodImages').outerHeight();\n\n //console.log(ssOptionCnt,ssOptionHeight,ssProdImageHeight,jju('.snippet_52_plugin-wrapper .prodImages').offset().top,jju('.design-layer[data-layertype=\"snippet\"][data-layerid=\"'+snippet_52_layerId+'\"]').offset().top)\n\n var offsetUp = (t + (ssOptionHeight * ssOptionCnt) < ssProdImageHeight ? t + (ssOptionHeight * ssOptionCnt) : ssProdImageHeight);\n return offsetUp;\n },\n\n // Handle the size, position and (possibly) scrolling of the options container so that the currently selected option appears above the placeholder\n // 1. Identify how much visible space is available above and below the SimpleSelect\n // 2. Compute how much space remains above and below the options container after positioning it according to the selected option\n // 3. If at least one of those values is negative, the container is resized and a scrollbar is added\n // 4. The options container is positioned according to the selected option\n positionAroundSsOption = function(ssOption) {\n resetSsOptionsContainerCSS.call(this);\n\n var ssOptionsMoveUp, ssOptionPosition, freeVisibleSpaceAbove, freeVisibleSpaceBelow, spaceLeftAboveAfterPositioning, spaceLeftBelowAfterPositioning, excessSpaceAbove, excessSpaceBelow,\n shouldDisplayContainerInsideWindow = this.options.displayContainerInside == \"window\";\n\n var computePositioningValues = $.proxy(function() {\n ssOptionPosition = ssOption.position();\n ssOptionsMoveUp = moveUpJu.call(this,ssOptionPosition.top);\n //console.log('ssOptionsMoveUp',ssOptionsMoveUp)\n //console.log($(window).scrollTop(),this.ssPlaceholderOffset.top,this.options.containerMargin,shouldDisplayContainerInsideWindow)\n freeVisibleSpaceAbove = this.ssPlaceholderOffset.top - this.options.containerMargin - (shouldDisplayContainerInsideWindow? $(window).scrollTop() : 0);\n //console.log('freeVisibleSpaceAbove',freeVisibleSpaceAbove)\n freeVisibleSpaceBelow = (shouldDisplayContainerInsideWindow? windowHeight : documentHeight) - freeVisibleSpaceAbove - this.ssPlaceholderHeight - 2 * this.options.containerMargin;\n //console.log('freeVisibleSpaceBelow',freeVisibleSpaceBelow)\n spaceLeftAboveAfterPositioning = freeVisibleSpaceAbove - ssOptionsMoveUp;\n //console.log('spaceLeftAboveAfterPositioning',spaceLeftAboveAfterPositioning)\n spaceLeftBelowAfterPositioning = freeVisibleSpaceBelow - (this.ssOptionsContainerOuterHeight - ssOptionsMoveUp - this.ssPlaceholderHeight);\n //console.log('spaceLeftBelowAfterPositioning',spaceLeftBelowAfterPositioning)\n excessSpaceAbove = spaceLeftAboveAfterPositioning < 0? Math.abs(spaceLeftAboveAfterPositioning) : 0;\n //console.log('excessSpaceAbove',excessSpaceAbove)\n excessSpaceBelow = spaceLeftBelowAfterPositioning < 0? Math.abs(spaceLeftBelowAfterPositioning) : 0;\n //console.log('excessSpaceBelow',excessSpaceBelow)\n }, this);\n computePositioningValues();\n\n var wasScrollable = this.isScrollable;\n this.isScrollable = spaceLeftAboveAfterPositioning < 0 || spaceLeftBelowAfterPositioning < 0;\n\n // If the options container won't fit inside the screen after being positioned, make it shorter and scrollable\n if (this.isScrollable) {\n //console.log('scrollable')\n // Add the scrollbar\n this.ssOptionsContainer.css({\n height: \"auto\",\n \"overflow-y\": \"auto\"\n });\n\n // If the addition of the scrollbar made some text wrap, thus increased the options container's height, recompute positioning values\n if (this.ssOptionsContainer.height() != this.ssOptionsContainerHeight) {\n // Force a repaint to avoid an issue found in WebKit\n forceRepaint.call(this);\n\n publicMethods.updatePresentationDependentVariables.call(this, \"ssOptionsContainer\", false);\n computePositioningValues();\n }\n\n //console.log('this.ssOptionsContainer.height()',this.ssOptionsContainer.height())\n\n var ssOptionsContainerNewHeight = this.ssOptionsContainer.height() - excessSpaceAbove - excessSpaceBelow;\n //console.log(ssOptionPosition.top,excessSpaceAbove,ssOptionPosition.top - excessSpaceAbove)\n\n if (snippet_52_options.direction.value=='vertical') {\n this.ssOptionsContainer\n .css({\n top: - (ssOptionsMoveUp - excessSpaceAbove)\n })\n .height((jju('.swiper-slide-content:first').height()-40)>this.ssOptionsContainerHeight?this.ssOptionsContainerHeight:(jju('.swiper-slide-content:first').height()-46)); // Using .height() instead of .css(\"height\", value) gives us access to the cssHook for \"height\" that adapts the height value depending on the options container's box model (updated cssHook available since jQuery 1.8)\n } else {\n this.ssOptionsContainer\n .css({\n top: - (ssOptionsMoveUp - excessSpaceAbove)\n })\n .height((snippet_52_layerHeight()-40)>this.ssOptionsContainerHeight?this.ssOptionsContainerHeight:(snippet_52_layerHeight()-46)); // Using .height() instead of .css(\"height\", value) gives us access to the cssHook for \"height\" that adapts the height value depending on the options container's box model (updated cssHook available since jQuery 1.8)\n }\n //console.log('scrollable',ssOptionsContainerNewHeight,windowHeight)\n // If the options container doesn't need scrollbars nor resizing\n } else {\n var ssOptionCnt = this.ssOptionsContainer.find('.option').length;\n var ssOptionHeight = this.ssOptionsContainer.find('.option:first').height();\n //console.log('this.ssOptionsContainer.height()',this.ssOptionsContainer.height())\n this.ssOptionsContainer.css({\n top: - ssOptionsMoveUp\n // \"top\": - ssOptionHeight*ssOptionCnt,\n // \"max-height\": - windowHeight\n });\n //console.log('not scrollable')\n // If it had a scrollbar and it just got hidden, force a repaint to avoid an issue in WebKit\n if (wasScrollable) forceRepaint.call(this);\n }\n },\n\n publicMethods = {\n\n // Update the variables that depend on how and where the SimpleSelect is displayed\n // Can take a string as an argument describing the reduced set of variables to update (instead of all)\n // Set `updateSafely` to `false` to update values without resetting the related CSS first\n updatePresentationDependentVariables: function(variablesToUpdate, updateSafely) {\n // Update variables related to the placeholder\n if (!variablesToUpdate || variablesToUpdate == \"ssPlaceholder\") {\n this.ssPlaceholderOffset = this.ssPlaceholder.offset();\n // we need to get position relative to layer\n this.ssPlaceholderLayerOffset = jju('.design-layer[data-layertype=\"snippet\"][data-layerid=\"'+snippet_52_layerId+'\"]').offset();\n this.ssPlaceholderOffset.top = this.ssPlaceholderOffset.top - this.ssPlaceholderLayerOffset.top;\n this.ssPlaceholderOffset.left = this.ssPlaceholderOffset.left - this.ssPlaceholderLayerOffset.left;\n\n this.ssPlaceholderHeight = this.ssPlaceholder.outerHeight();\n }\n\n // Update variables related to the options container\n // Make sure the SimpleSelect's options container's CSS is reset before, if necessary, using resetSsOptionsContainerCSS()\n if (!variablesToUpdate || variablesToUpdate == \"ssOptionsContainer\") {\n if (updateSafely !== false) resetSsOptionsContainerCSS.call(this);\n this.ssOptionsContainerOuterHeight = this.ssOptionsContainer.outerHeight(true);\n this.ssOptionsContainerHeight = this.ssOptionsContainer.height();\n }\n },\n\n // close all selects\n closeAllSelects: function() {\n var activeSimpleselectsLength = activeSimpleselects.length;\n if (activeSimpleselectsLength) {\n var activeSimpleselectsCopy = activeSimpleselects.slice(0);\n for (var i = 0; i < activeSimpleselectsLength; i++) {\n activeSimpleselectsCopy[i].simpleselect(\"setInactive\");\n }\n }\n },\n\n // populateSs equivalent\n // Meant to be exposed in the public API\n refreshContents: function() {\n populateSs.call(this);\n\n // Update variables dependent on presentation\n publicMethods.updatePresentationDependentVariables.call(this);\n },\n\n // updateSsState alias\n // Meant to be exposed in the public API\n refreshState: function() {\n updateSsState.call(this);\n },\n\n // Disable the select, and update the SimpleSelect's state accordingly\n disable: function() {\n this.select.prop(\"disabled\", true);\n publicMethods.refreshState.call(this);\n },\n\n // Enable the select, and update the SimpleSelect's state accordingly\n enable: function() {\n this.select.prop(\"disabled\", false);\n publicMethods.refreshState.call(this);\n },\n\n // Set the SimpleSelect in an active state, and show the options container\n setActive: function() {\n if (!this.isActive && !this.isDisabled && this.ssOptions.length) {\n this.lastValue = this.select.val();\n this.simpleselect.addClass(\"active\");\n this.isActive = true;\n addToActiveSimpleselects.call(this, this.simpleselect);\n var optionToSelect = getSsOptionToSelect.call(this);\n selectSsOption.call(this, optionToSelect);\n documentHeight = $(document).height(); // Save the document height before it possibly changes due to the options list being made visible\n this.ssOptionsContainer\n .fadeTo(0, 0)\n .fadeTo(this.options.fadingDuration, 1);\n // if (!this.select.is(\":focus\")) {\n // this.select.focus();\n // }\n positionAroundSsOption.call(this, optionToSelect);\n isNextDocumentClickEventDisabled = true;\n }\n },\n\n // Set the SimpleSelect in an inactive state, and hide the options container\n setInactive: function() {\n if (this.isActive) {\n this.simpleselect.removeClass(\"active\");\n this.isActive = false;\n removeFromActiveSimpleselects.call(this, this.simpleselect);\n this.ssOptionsContainer.fadeOut(this.options.fadingDuration);\n // if (this.select.is(\":focus\")) {\n // this.select.blur();\n // }\n var currentValue = this.select.val();\n if (this.lastValue != currentValue) {\n this.ssPlaceholder.text(getSelectedOption.call(this).text());\n this.select.trigger(\"change\", [true]);\n }\n }\n }\n\n };\n\n$.fn.simpleselect = function(method) {\n // Additional plugin call (method call)\n // The context inside of these methods is set to the SimpleSelect's data\n if (publicMethods[method]) {\n var args = Array.prototype.slice.call(arguments, 1);\n this.each(function() {\n publicMethods[method].apply($(this).data(\"simpleselect\"), args);\n });\n // First plugin call\n // The context inside of this method is set to the select element\n } else {\n init.apply(this, arguments);\n }\n\n return this;\n};\n\n// Document and window bindings and initialization of related values\n$(document).ready(function() {\n\n updateWindowHeightValue();\n\n // Update shared windowHeight value when page is resized\n // $(window).on(\"resize.simpleselect\", function() {\n // updateWindowHeightValue();\n // });\n\n $(document).on(\"click.snippet_52_space keyup.snippet_52_space\", function(e) {\n // Detect click events once they've bubbled up to the document\n if (e.type == \"click\" || e.type == \"mousedown\") {\n // Reset the flag\n // The following statement is appended to the end of the current call stack to ensure that, when the option of a SimpleSelect placed inside a label is clicked, events (or more precisely, statements handling isSsActivationForbidden and bound to those events) are triggered in the following order while in the bubbling phase:\n // Click on SimpleSelect option -> Click on SimpleSelect -> Click on label (thus focus on associated select) -> Click on document\n // (In IE, if not interfering with the call stack, the click event finishes bubbling up before the focus event is fired on the select.)\n setTimeout(function() {\n isSsActivationForbidden = false;\n }, 0);\n\n // If that flag is activated, don't let the rest of this function be executed (and reset the flag)\n if (isNextDocumentClickEventDisabled) {\n isNextDocumentClickEventDisabled = false;\n return;\n }\n }\n\n // Disable active selects when the \"background\" is clicked or when the escape key is pressed\n if (e.type == \"click\" || e.type == \"mousedown\" || (e.type == \"keyup\" && e.keyCode == 27)) {\n var activeSimpleselectsLength = activeSimpleselects.length;\n if (activeSimpleselectsLength) {\n var activeSimpleselectsCopy = activeSimpleselects.slice(0);\n for (var i = 0; i < activeSimpleselectsLength; i++) {\n activeSimpleselectsCopy[i].simpleselect(\"setInactive\");\n }\n }\n }\n });\n});\n\n})(jQuery);<\/script>\n<div class=\"snippet_52_plugin-wrapper clear_save alwaysShowAddButton\" style=\"width: 1060px;\"><\/div>\n<script>\n\njju('.snippet_52_css').remove();\n\nwindow.shouldHideSnippetFontOptions = false;\nvar snippet_52_layerId = ('snippet_52_').split('_')[1];\nvar snippet_52_layerHeight = function(){\n return jju('.design-layer[data-layertype=\"snippet\"][data-layerid=\"'+snippet_52_layerId+'\"]').height();\n}\n\nsnippet_52_cssValues = \"\" +\n\".simpleselect, .simpleselect .placeholder, .snippet_52_plugin-wrapper .prodAdd, .snippet_52_plugin-wrapper .addButton, .snippet_52_plugin-wrapper .addNow{background-color: \"+snippet_52_options.showAddToCart.values[0].btnColor.value+\" !important;}\" +\n\".simpleselect .placeholder, .snippet_52_plugin-wrapper .addButton, .snippet_52_plugin-wrapper .selOptions, .snippet_52_plugin-wrapper .addNow {border: 1px solid \"+snippet_52_options.showAddToCart.values[0].btnBrdColor.value+\" !important; color:\"+snippet_52_options.showAddToCart.values[0].btnTextColor.value+\" !important;}\" +\n\".simpleselect .placeholder {border-top: 1px solid \"+snippet_52_options.showAddToCart.values[0].btnBrdColor.value+\" !important;}\" +\n\".snippet_52_plugin-wrapper .prodPrice{color: \"+snippet_52_options.showProductPrice.values[0].priceTextColor.value+\" !important;}\" +\n//\".snippet_52_plugin-wrapper .swiper-slide{max-height: \"+snippet_52_options.itemMaxHeight.value+\"px !important;}\" +\n\".snippet_52_plugin-wrapper .swiper-slide-content{height: \"+snippet_52_layerHeight()+\"px !important;}\" +\n\".simpleselect .options::-webkit-scrollbar-thumb {background-color: \"+snippet_52_options.showAddToCart.values[0].btnColor.value+\";}\" +\n\".simpleselect .options::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.2); -webkit-border-radius: 10px; border-radius: 4px;}\";\n\nif (snippet_52_options.direction.value=='vertical') {\n snippet_52_cssValues += \".snippet_52_plugin-wrapper .swiper-slide-content{height: \"+snippet_52_options.itemMaxHeight.value+\"px !important;}\";\n}\n\njju(\"head\").append('<style type=\"text/css\" class=\"snippet_52_css\">'+snippet_52_cssValues+'<\/style>');\n\nvar moveStuff = ju_debounce(function () {\n // let's figure out the height of the title and price and adjust the height of the image accordingly\n if (snippet_52_options.showProductName.value==0 || snippet_52_options.showProductPrice.value==0){\n var snippet_52_titleConHeight = Math.max.apply(null, jju('.snippet_52_plugin-wrapper .prodTitleCon').map(function (){return $(this).height();}).get())*(snippet_52_options.showProductPrice.value!=0 ? 1.4 : 1.15);\n var snippet_52_addToCartBottom = (snippet_52_titleConHeight-jju('.snippet_52_plugin-wrapper .prodActions:first').height()-10);\n } else {\n var snippet_52_titleConHeight = 0;\n var snippet_52_addToCartBottom = 10;\n }\n\n var snippet_52_maxImageHeight = snippet_52_options.maxImageHeight.value;\n var snippet_52_prodImageHeight = (snippet_52_layerHeight()-snippet_52_titleConHeight);\n var snippet_52_prodImagePadding = (snippet_52_maxImageHeight < snippet_52_prodImageHeight ? snippet_52_prodImageHeight-snippet_52_maxImageHeight : 0);\n\n if (snippet_52_options.showAddToCart.values[0].belowName.value){\n var snippet_52_addToCartBottom = 10;\n var snippet_52_titleConHeight = snippet_52_titleConHeight - 40;\n var snippet_52_prodImagePadding = 0;\n }\n\n snippet_52_cssValues = \"\" +\n \".snippet_52_plugin-wrapper .prodImages{height: \"+snippet_52_prodImageHeight+\"px !important;max-height: \"+snippet_52_maxImageHeight+\"px !important;}\" +\n \".snippet_52_plugin-wrapper .prodTitleCon{padding-top: \"+snippet_52_prodImagePadding+\"px !important;}\"+\n \".snippet_52_plugin-wrapper .prodActions{bottom: \"+snippet_52_addToCartBottom+\"px !important;}\"+\n \".snippet_52_plugin-wrapper .swiper-button-next.sides, .snippet_52_plugin-wrapper .swiper-button-prev.sides{display:flex;top: \"+(((snippet_52_layerHeight()-snippet_52_titleConHeight)*.5)-20)+\"px !important;}\"+\n \".snippet_52_plugin-wrapper .swiper-button-next.top, .snippet_52_plugin-wrapper .swiper-button-prev.top{display:flex;top: -60px !important;}\"+\n \".snippet_52_plugin-wrapper .swiper-button-next.bottom, .snippet_52_plugin-wrapper .swiper-button-prev.bottom{display:flex;top:auto !important;;bottom: -60px !important;}\"\n jju(\"head\").append('<style type=\"text/css\" class=\"snippet_52_css\">'+snippet_52_cssValues+'<\/style>');\n}, 50, 'End');\n\nfunction snippet_52_checkprice(prod,priceType,format,variant){\n var lowestVariantPrice = 999999;\n var lowestVariantMsrp = 999999;\n jju.each(prod.variantList,function(v,variant){\n if (prod.variantList[v].inventory>0){\n lowestVariantPrice = Math.min(lowestVariantPrice,prod.variantList[v].price);\n lowestVariantMsrp = Math.min(lowestVariantMsrp,prod.variantList[v].msrp);\n }\n });\n\n var pPrice = prod.price;\n var pMsrp = prod.msrp;\n if (variant){\n var vPrice = variant.price;\n var vMsrp = variant.msrp;\n } else {\n var vPrice = lowestVariantPrice;\n var vMsrp = lowestVariantMsrp;\n }\n var returnPrice;\n if (priceType=='price') {\n //if (pPrice==0) {\n if (vPrice==0){\n if (vMsrp==0){\n returnPrice = pMsrp;\n } else {\n returnPrice = vMsrp;\n }\n } else {\n returnPrice = vPrice;\n }\n //} else {\n // returnPrice = pPrice;\n //}\n } else {\n //if (pMsrp==0) {\n if (vMsrp==0){\n if (vPrice==0){\n returnPrice = pPrice;\n } else {\n returnPrice = vPrice;\n }\n } else {\n returnPrice = vMsrp;\n }\n //} else {\n // returnPrice = pMsrp;\n //}\n }\n if (format){\n var localeOption = snippet_52_options.showProductPrice.values[0].priceLocale.value;\n var localeOptionArr = localeOption.split('/');\n try{\n returnPrice = new Intl.NumberFormat(localeOptionArr[0], { style: 'currency', currency: localeOptionArr[1] }).format(returnPrice);\n } catch(er){\n returnPrice = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(returnPrice);\n }\n }\n return returnPrice;\n}\n\nfunction snippet_52_generateSuggestions(snippet_52_prodsArr,render){\n\n $(document).off('.snippet_52_spaceButtons');\n $(window).off('.snippet_52_spaceButtons');\n\n if (!snippet_52_options.showAddToCart.values[0].showHoverOnly.value && render) {\n jju('.snippet_52_plugin-wrapper').addClass('alwaysShowAddButton');\n }\n jju('.snippet_52_plugin-wrapper').html('').append('<div class=\"swiper-container\"><div class=\"swiper-wrapper\"><\/div><\/div>');\n\n\n jju.each(snippet_52_prodsArr,function(i,item){\n\n //snippet_52_platform = item.platform;\n\n // lets see if we shoudl change the qty to allow purchasing out of stock items based on filters\n jju.each(snippet_52_filters,function(f,filter){\n if (filter.Active.Bool){\n if (filter.FilterType.String==='inventory' && filter.Min.Int64<=0){\n jju.each(snippet_52_prodsArr[i].variantList,function(v,variant){\n snippet_52_prodsArr[i].variantList[v].inventory = 1000;\n });\n };\n if (filter.FilterType.String==='force_include_product' && filter.Include.Bool && filter.Filters.some(el => el.String === snippet_52_prodsArr[i].id)){\n jju.each(snippet_52_prodsArr[i].variantList,function(v,variant){\n snippet_52_prodsArr[i].variantList[v].inventory = 1000;\n });\n };\n };\n });\n\n\n if (item.imageURL1.indexOf('://')==-1) {\n var hostURL = document.createElement('a');\n hostURL.href = item.url;\n item.imageURL1 = 'https://' + hostURL.hostname + item.imageURL1;\n item.imageURL2 = 'https://' + hostURL.hostname + item.imageURL2;\n item.imageURL3 = 'https://' + hostURL.hostname + item.imageURL3;\n }\n\n var newItem = '' +\n '<div class=\"swiper-slide\" ' + (i==0 ? 'data-swiper-autoplay=\"8000\"' : '') + '>' +\n '<div class=\"swiper-slide-content\" data-index=\"' + i + '\">' +\n '<a class=\"prodLink\" href=\"' + item.url + '\" target=\"_top\">' +\n '<div class=\"prodImages\">' +\n '<img class=\"prodImage1\" src=\"' + this.imageURL1 + '\">';\n if (this.imageURL2!='') newItem += '<img class=\"prodImage2\" src=\"' + this.imageURL2 + '\">';\n if (this.imageURL3!='') newItem += '<img class=\"prodImage3\" src=\"' + this.imageURL3 + '\">';\n newItem += '<img class=\"varImage1\" src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\">';\n newItem += '<\/div>' +\n '<div class=\"prodTitleCon\">' +\n (snippet_52_options.showProductName.value==0 ? '<div class=\"prodTitle' + (snippet_52_options.showProductName.values[0].allCaps.value ? ' allCaps' : '') + '\">' + this.title + '<\/div>' : '') +\n (snippet_52_options.showProductPrice.value==0 ? '<div class=\"prodPrice\">' + snippet_52_checkprice(this,'price',true) + (snippet_52_options.showProductPrice.values[0].showMSRP.value && snippet_52_checkprice(this,'msrp',false)>snippet_52_checkprice(this,'price',false) ? ' <span class=\"msrp\">' + snippet_52_checkprice(this,'msrp',true) + '<\/span>' : '') + '<\/div>' : '') +\n '<\/div>' +\n '<\/a>' +\n (snippet_52_options.showAddToCart.value==0 ?\n '<div class=\"prodActions\">' +\n '<div class=\"prodActionsCon\">' +\n '<div class=\"prodOptions\"><\/div>' +\n '<div class=\"prodAdd\">' +\n '<div class=\"selOptions\">' + snippet_52_options.showAddToCart.values[0].langSelectOptions.value + '<\/div>' +\n '<button class=\"addButton\" type=\"button\" href=\"#\">' + snippet_52_options.showAddToCart.values[0].langAddToBag.value + '<\/button>' +\n '<button class=\"addNow\" type=\"button\" href=\"#\">' + snippet_52_options.showAddToCart.values[0].langAddNow.value + '<\/button>' +\n '<\/div>' +\n '<\/div>' +\n '<\/div>' +\n '<\/div>' : '') +\n '<\/div>';\n\n\n jju('.snippet_52_plugin-wrapper .swiper-wrapper').append(newItem);\n\n });\n\n jju('.snippet_52_plugin-wrapper .swiper-container').append('<div class=\"swiper-pagination\"><\/div>');\n if (snippet_52_options.navigation.value!='none'){\n jju('.snippet_52_plugin-wrapper').append('<div class=\"swiper-button-prev '+snippet_52_options.navigation.value+'\"><\/div>');\n jju('.snippet_52_plugin-wrapper').append('<div class=\"swiper-button-next '+snippet_52_options.navigation.value+'\"><\/div>');\n }\n //jju('.snippet_52_plugin-wrapper .swiper-container').append('<div class=\"swiper-scrollbar\"><\/div>');\n\n setTimeout(function(){\n if (snippet_52_options.showProductName.values[0].ellipsize.value && render) {\n snippet_52_cssValues = \".snippet_52_plugin-wrapper .prodTitle{white-space: nowrap !important; width: \"+jju('.snippet_52_plugin-wrapper .prodTitle').outerWidth()+\"px; overflow: hidden !important; text-overflow:ellipsis !important;}\";\n jju(\"head\").append('<style type=\"text/css\" class=\"snippet_52_css\">'+snippet_52_cssValues+'<\/style>');\n }\n if (snippet_52_platform=='Shopify'){\n addLinkShopify()\n } else {\n //addLink();\n }\n },75)\n\n moveStuff();\n\n\n function getWindowWidth(){\n return jju('.design-layer[data-layertype=\"snippet\"][data-layerid=\"'+snippet_52_layerId+'\"]').width();\n }\n\n function getWindowHeight(){\n return jju('.design-layer[data-layertype=\"snippet\"][data-layerid=\"'+snippet_52_layerId+'\"]').height();\n }\n\n $(document).on('click.snippet_52_spaceButtons','.swiper-slide a',function(e) {\n e.preventDefault();\n e.stopPropagation();\n getpromocode('22','',currentcp,1,(snippet_52_options.engageOnInteraction.value ? 1 : 0));\n var navurl = $(this).attr('href');\n setTimeout(function(){\n top.location.href = navurl;\n },700);\n });\n\n $(document).on('click.snippet_52_spaceButtons','div[class*=\"swiper-button-prev\"], div[class*=\"swiper-button-next\"]',function(e) {\n e.preventDefault();\n e.stopPropagation();\n });\n\n var resizeSgg = ju_debounce(function () {\n var newWindowWidth = getWindowWidth();\n if (newWindowWidth==jju('.snippet_52_plugin-wrapper').width()) return;\n jju('.snippet_52_plugin-wrapper').css({'width':newWindowWidth});\n/*\n resizeSwiper();\n setTimeout(function(){\n if (snippet_52_options.showProductName.values[0].ellipsize.value) {\n jju('.snippet_52_plugin-wrapper .prodTitle').css({'width':'auto'});\n snippet_52_cssValues = \".snippet_52_plugin-wrapper .prodTitle{white-space: nowrap !important; width: \"+jju('.snippet_52_plugin-wrapper .prodTitle').width()+\"px; overflow: hidden !important; text-overflow:ellipsis !important;}\";\n jju(\"head\").append('<style type=\"text/css\" class=\"snippet_52_css\">'+snippet_52_cssValues+'<\/style>');\n }\n },75)\n*/\n setTimeout(function(){\n snippet_52_generateSuggestions(snippet_52_prod,false);\n },200)\n }, 200, 'End');\n\n jju(window).on('resize.snippet_52_spaceButtons',function(){\n resizeSgg();\n });\n\n jju('.snippet_52_plugin-wrapper').css({'width':getWindowWidth()});\n\n jju(document).on('mouseenter.snippet_52_spaceButtons','.swiper-slide-content',function(){\n if (snippet_52_options.autoScroll.value) snippet_52_mySwiper.autoplay.stop();\n thisItem = jju(this);\n thisItem.find('.selOptions').hide();\n thisItem.find('.addNow').hide();\n thisItem.find('.addButton').show();\n if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value){\n thisItem.find('.prodImage2').stop().fadeIn(150);\n }\n })\n\n jju(document).on('mouseleave.snippet_52_spaceButtons','.swiper-slide-content',function(){\n thisItem = jju(this);\n thisItem.find('.prodOptions').hide();\n thisItem.find(\"select:visible\").simpleselect(\"setInactive\")\n jju('.swiper-container').removeClass('overflowVisible');\n jju('.prodImage2, .prodImage3').stop().fadeOut(100);\n })\n\n jju(document).on('touchstart.snippet_52_spaceButtons','.prodImages',function(){\n if (snippet_52_options.autoScroll.value) snippet_52_mySwiper.autoplay.stop();\n thisItem = jju(this);\n if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value) thisItem.find('.prodImage2').stop().fadeIn(150);\n })\n\n jju(document).on('touchend.snippet_52_spaceButtons','.prodImages',function(){\n jju('.prodImage2, .prodImage3').stop().fadeOut(100);\n })\n\n jju(document).on('click.snippet_52_spaceButtons','.addNow',function(){\n var thisButton = jju(this);\n var thisItem = thisButton.closest('.swiper-slide-content');\n addToCart(thisItem);\n });\n\n jju(document).on('click.snippet_52_spaceButtons','.addButton',function(){\n jju('.swiper-slide-content').each(function(i){\n var thisArrItem = jju(this);\n thisArrItem.find('.selOptions').hide();\n thisArrItem.find('.addNow').hide();\n thisArrItem.find('.addButton').show();\n });\n\n var thisButton = jju(this);\n var thisItem = thisButton.closest('.swiper-slide-content');\n var thisIndex = thisItem.data('index');\n var thisEl = snippet_52_prodsArr[thisIndex];\n\n if (thisItem.find('.prodImage2').length && snippet_52_options.showSecondImage.value){\n thisItem.find('.prodImage2').stop().fadeIn(150);\n }\n\n jju('.swiper-container').addClass('overflowVisible');\n thisItem.find('.prodOptions').show();\n\n if (!thisItem.hasClass('renderedOptions')){\n thisItem.addClass('renderedOptions')\n buildDropdown('',thisItem,1,thisEl);\n buildDropdown('',thisItem,2,thisEl);\n buildDropdown('',thisItem,3,thisEl);\n buildQty(thisItem,thisEl)\n\n thisItem.find(\"select:visible\").simpleselect({\n fadingDuration: 100,\n containerMargin: 20\n });\n\n resetUnavailable(thisItem,thisEl);\n }\n\n checkOptionSelected(thisItem);\n\n // automatically click the one option set if only one option set to expand\n setTimeout(function(){\n if (thisItem.find('.prodOptions select').length == 1 && !thisItem.find('.prodOptions select').has('option[value!=\"\"]:selected').length){\n thisItem.find('.prodOptions .placeholder').trigger('click');\n }\n },100)\n });\n\n jju(document).on('change.snippet_52_spaceButtons','.SlectBox:visible',function(){\n var thisItem = jju(this).closest('.swiper-slide-content');\n var thisIndex = thisItem.data('index');\n var thisEl = snippet_52_prodsArr[thisIndex];\n resetUnavailable(thisItem,thisEl);\n checkOptionSelected(thisItem);\n });\n\n function checkOptionSelected(thisItem){\n var optCount = thisItem.find('select').filter(function(){return jju(this).find('option').length>1}).length;\n if (!optCount || (thisItem.find('select option:eq(1)').val()=='' && optCount==1)){\n thisItem.find('select option:eq(1)').prop('selected', true);\n addToCart(thisItem);\n } else if (thisItem.find('select option:selected[value=\"\"]').length){\n thisItem.find('.selOptions').show();\n thisItem.find('.addButton').hide();\n thisItem.find('.addNow').hide();\n } else {\n thisItem.find('.selOptions').hide();\n thisItem.find('.addButton').hide();\n thisItem.find('.addNow').show();\n if (!thisItem.find('.simpleselect:visible').length){\n thisItem.find('select option:eq(1)').prop('selected', true);\n addToCart(thisItem);\n }\n // let's attempt to show the variant image if option is enabled\n if (snippet_52_options.showAddToCart.values[0].showVariantImage.value){\n var options1 = thisItem.find('.optionSel1');\n var options2 = thisItem.find('.optionSel2');\n var options3 = thisItem.find('.optionSel3');\n var option1sel = options1.val() || '';\n var option2sel = options2.val() || '';\n var option3sel = options3.val() || '';\n\n var thisIndex = thisItem.data('index');\n var thisEl = snippet_52_prodsArr[thisIndex];\n\n thisItem.find('.varImage1').hide();\n\n jju.each(thisEl.variantList,function(){\n if (this.option1.replace(/\"/g, \"''\")==option1sel && this.option2.replace(/\"/g, \"''\")==option2sel && this.option3.replace(/\"/g, \"''\")==option3sel){\n // update price to show selected variant price\n if (snippet_52_options.showProductPrice.value==0){\n thisItem.find('.prodPrice').html(snippet_52_checkprice(thisEl,'price',true,this) + (snippet_52_options.showProductPrice.values[0].showMSRP.value && snippet_52_checkprice(thisEl,'msrp',false,this)>snippet_52_checkprice(thisEl,'price',false,this) ? ' <span class=\"msrp\">' + snippet_52_checkprice(thisEl,'msrp',true,this) + '<\/span>' : ''))\n }\n\n // update image to show selected variatn image\n if (this.imageURL1!=''){\n if (this.imageURL1.indexOf('://')==-1) {\n var hostURL = document.createElement('a');\n hostURL.href = this.url;\n this.imageURL1 = 'https://' + hostURL.hostname + this.imageURL1;\n }\n thisItem.find('.varImage1').attr('src',this.imageURL1).show();\n }\n }\n });\n }\n }\n }\n\n function sanitizeOptions(v){\n return v.replace(/[^A-Za-z0-9- ]/g,'')\n }\n\n function resetUnavailable(thisItem,thisEl){\n var thisParent = thisItem.closest('.swiper-slide-content');\n var thisOptDif = thisParent.find('.SlectBox').length - thisParent.find('.hidden_select_container').length;\n var options1 = thisParent.find('.optionSel1');\n var options2 = thisParent.find('.optionSel2');\n var options3 = thisParent.find('.optionSel3');\n var option1sel = options1.val() || '';\n var option2sel = options2.val() || '';\n var option3sel = options3.val() || '';\n option1sel = sanitizeOptions(option1sel)\n option2sel = sanitizeOptions(option2sel)\n option3sel = sanitizeOptions(option3sel)\n\n for (var optIndex = 1; optIndex < 4; optIndex++) {\n thisParent.find('.optionSel'+optIndex).find('option:not(:first)').each(function(i){\n var thisOpt = $(this);\n var thisVal = thisOpt.val();\n thisVal = sanitizeOptions(thisVal);\n var available = false;\n jju.each(thisEl.variantList,function(){\n var thisVariant = this;\n var thisOption = sanitizeOptions(thisVariant[\"option\"+optIndex]);\n var thisQty = thisVariant.inventory;\n if (thisOption==thisVal && thisQty>0){\n\n if (optIndex==1 && (option2sel==sanitizeOptions(thisVariant[\"option2\"]) || thisVariant[\"option2\"]==\"\" || option2sel==\"\") && (option3sel==sanitizeOptions(thisVariant[\"option3\"]) || thisVariant[\"option3\"]==\"\" || option3sel==\"\")){\n available = true;\n return;\n } else if (optIndex==2 && (option1sel==sanitizeOptions(thisVariant[\"option1\"]) || thisVariant[\"option1\"]==\"\" || option1sel==\"\") && (option3sel==sanitizeOptions(thisVariant[\"option3\"]) || thisVariant[\"option3\"]==\"\" || option3sel==\"\")){\n available = true;\n return;\n } else if (optIndex==3 && (option3sel==sanitizeOptions(thisVariant[\"option3\"]) || thisVariant[\"option3\"]==\"\" || option3sel==\"\") && (option3sel==sanitizeOptions(thisVariant[\"option3\"]) || thisVariant[\"option3\"]==\"\" || option3sel==\"\")){\n available = true;\n return;\n }\n }\n });\n\n if (thisParent.find('.optionSel'+optIndex).parent('.hidden_select_container').length){\n var simSelect = thisParent.find('.optionSel'+optIndex).parent('.hidden_select_container').next('.simpleselect');\n var simOption = simSelect.find('.options .option:eq('+(i+1)+')');\n if (available){\n simOption.removeClass('unavailable');\n } else {\n simOption.addClass('unavailable');\n if (thisOpt.is(':selected')){\n thisOpt.closest(\"select:visible\").val('');\n simSelect.find('.placeholder').html(snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + thisEl[\"optionType\"+optIndex]);\n //simSelect.find('.placeholder').html(snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl[\"optionType\"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl[\"optionType\"+optIndex]));\n }\n }\n }\n })\n }\n }\n\n function buildDropdown(selType,thisItem,optIndex,thisEl){\n var html = '';\n var optionArr = [];\n //if (thisEl.variantList.length>1 || thisEl.variantList[0].title!=\"Default\") {\n\n jju.each(thisEl.variantList,function(){\n var thisVariant = this;\n var thisOption = thisVariant[\"option\"+optIndex].replace(/\"/g, \"''\");\n if (thisOption=='' || optionArr.indexOf(thisOption)>-1) return true;\n optionArr.push(thisOption);\n });\n\n if (optionArr.length>0){\n\n var sizeSortArr = [\"os\",\"xxxs\",\"3xs\",\"xxs\",\"2xs\",\"xs\",\"1xs\",\"s\",\"sm\",\"m\",\"ml\",\"l\",\"xl\",\"1xl\",\"xxl\",\"2xl\",\"xxxl\",\"3xl\"]; // sort by value\n // sort by value\n\n function testForNum(v){\n return v.match(/[0-9]/g)\n }\n\n if (!optionArr.every(testForNum)){\n // sort by sizes\n optionArr.sort(function(a, b) {\n var nameA = a.toLowerCase().replace('extra','x').replace('small','s').replace('medium','m').replace('large','l').replace('huge','xl').replace(/x[\\s|-]s/g,'xs').replace(/x[\\s|-]l/g,'xl');\n var nameB = b.toLowerCase().replace('extra','x').replace('small','s').replace('medium','m').replace('large','l').replace('huge','xl').replace(/x[\\s|-]s/g,'xs').replace(/x[\\s|-]l/g,'xl');\n\n var nameAarr = nameA.split(/[^A-Za-z0-9]/);\n var nameBarr = nameB.split(/[^A-Za-z0-9]/);\n\n for (var i = 0; i < nameAarr.length; i++) {\n if (sizeSortArr.indexOf(nameAarr[i])!=-1) {\n nameA = sizeSortArr[sizeSortArr.indexOf(nameAarr[i])];\n break;\n }\n }\n\n for (var i = 0; i < nameBarr.length; i++) {\n if (sizeSortArr.indexOf(nameBarr[i])!=-1) {\n nameB = sizeSortArr[sizeSortArr.indexOf(nameBarr[i])];\n break;\n }\n }\n\n if (sizeSortArr.indexOf(nameA) < sizeSortArr.indexOf(nameB)) {\n return -1;\n }\n if (sizeSortArr.indexOf(nameA) > sizeSortArr.indexOf(nameB)) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n\n // names must be equal\n return 0;\n });\n } else {\n // sort by value\n optionArr.sort(function (a, b) {\n return Number(a.match(/\\d+/g).join('')) - Number(b.match(/\\d+/g).join(''));\n });\n }\n }\n\n if (optionArr.length>0) {\n jju.each(optionArr,function(index, value){\n html += '<option value=\"' + value + '\" '+(optionArr.length==1 ? 'selected' : '')+'>' + value + '<\/option>';\n })\n\n html = '<option value=\"\" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + thisEl[\"optionType\"+optIndex] + '<\/option>' + html;\n //html = '<option value=\"\" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl[\"optionType\"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl[\"optionType\"+optIndex]) + '<\/option>' + html;\n html = '<select class=\"SlectBox optionSel'+optIndex+'\">' + html;\n html += '<\/select>';\n\n var $html = jju(html);\n if (optionArr.length==1) $html.css({'display':'none'});\n thisItem.find('.prodOptions').append($html);\n // now remove any options with the label \"Default Title\" if ther are more than 1 option\n if (thisItem.find('.prodOptions .optionSel1 option').length>2 && thisItem.find('.prodOptions .optionSel1 option:contains(\"Default Title\")')){\n thisItem.find('.prodOptions .optionSel1 option:contains(\"Default Title\")').remove();\n }\n if (thisItem.find('.prodOptions .optionSel2 option').length>2 && thisItem.find('.prodOptions .optionSel2 option:contains(\"Default Title\")')){\n thisItem.find('.prodOptions .optionSel2 option:contains(\"Default Title\")').remove();\n }\n if (thisItem.find('.prodOptions .optionSel3 option').length>2 && thisItem.find('.prodOptions .optionSel3 option:contains(\"Default Title\")')){\n thisItem.find('.prodOptions .optionSel3 option:contains(\"Default Title\")').remove();\n }\n thisItem.find('.prodOptions .optionSel1, .prodOptions .optionSel2, .prodOptions .optionSel3').change();\n }\n //}\n\n //return $html;\n }\n\n function buildQty(thisItem,thisEl){\n var html = '';\n if (snippet_52_options.showAddToCart.values[0].allowQty.value==0){\n var optionArr = ['1'];\n } else {\n var optionArr = [];\n var qtyDropdown = snippet_52_options.showAddToCart.values[0].allowQty.values[1].qtyDropdown.value.replace(/ /g, '');\n\n if (isNaN(qtyDropdown.replace(/,/g, ''))) qtyDropdown = '1';\n var optionArr = qtyDropdown.split(',');\n }\n\n if (optionArr.length>0) {\n jju.each(optionArr,function(index, value){\n html += '<option value=\"' + value + '\" '+(optionArr.length==1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].allowQty.values[1].langQtyPrefix.value + ' ' + value + '<\/option>';\n })\n\n html = '<option value=\"\" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].allowQty.values[1].langQtyTitle.value + '<\/option>' + html;\n //html = '<option value=\"\" '+(optionArr.length>1 ? 'selected' : '')+'>' + snippet_52_options.showAddToCart.values[0].langSelect.value + ' ' + (thisEl[\"optionType\"+optIndex].indexOf('size')!=1 ? 'Size' : thisEl[\"optionType\"+optIndex]) + '<\/option>' + html;\n html = '<select class=\"SlectBox qty\">' + html;\n html += '<\/select>';\n\n var $html = jju(html);\n if (optionArr.length==1) $html.css({'display':'none'});\n thisItem.find('.prodOptions').append($html);\n thisItem.find('.prodOptions .qty').change();\n }\n\n }\n var addToCart = ju_debounce(function (thisItem) {\n //function addToCart(thisItem){\n var options1 = thisItem.find('.optionSel1');\n var options2 = thisItem.find('.optionSel2');\n var options3 = thisItem.find('.optionSel3');\n var option1sel = options1.val() || '';\n var option2sel = options2.val() || '';\n var option3sel = options3.val() || '';\n var qty = thisItem.find('.qty').val();\n if (qty==\"\") qty = 1;\n\n var thisIndex = thisItem.data('index');\n var thisEl = snippet_52_prodsArr[thisIndex];\n var thisId = thisEl.id;\n var thisVariant;\n var thisSku;\n\n jju.each(thisEl.variantList,function(){\n if (this.option1.replace(/\"/g, \"''\")==option1sel && this.option2.replace(/\"/g, \"''\")==option2sel && this.option3.replace(/\"/g, \"''\")==option3sel){\n thisVariant = this.id;\n thisSku = this.sku;\n if (parseInt(this.inventory)<parseInt(qty)) qty = this.inventory;\n return;\n }\n });\n\n if (snippet_52_platform=='Shopify'){\n addToCartShopify(thisId,thisVariant,thisSku,qty)\n }\n\n if (snippet_52_platform=='Magento'){\n addToCartMagento(thisId,thisVariant,thisSku,qty)\n parent.require([ 'Magento_Customer/js/customer-data' ], function (customerData) { setTimeout(function(){ customerData.reload(['cart']); }, 1000); });\n }\n\n if (snippet_52_platform=='Wordpress'){\n addToCartWordpress(thisId,thisVariant,thisSku,qty)\n }\n\n if (snippet_52_platform=='BigCommerce'){\n addToCartBigCommerce(thisId,thisVariant,thisSku,qty)\n }\n if (snippet_52_platform_other=='Yahoo'){\n addToCartYahoo(thisId,thisVariant,thisSku,qty)\n }\n if (snippet_52_platform_other=='Netohq'){\n addToCartNetohq(thisId,thisVariant,thisSku,qty)\n }\n\n getpromocode('21','',currentcp,1,(snippet_52_options.engageOnInteraction.value ? 1 : 0));\n\n var addToCartPostFunUrl = snippet_52_options.showAddToCart.values[0].redirectAddToCart.values[1].redirectAddToCartUrl.value;\n if (snippet_52_options.showAddToCart.values[0].redirectAddToCart.value==1 && addToCartPostFunUrl!=''){\n setTimeout(function(){\n if (addToCartPostFunUrl.indexOf('(')!=-1){\n eval(addToCartPostFunUrl);\n } else {\n top.location.href = snippet_52_options.showAddToCart.values[0].redirectAddToCart.values[1].redirectAddToCartUrl.value;\n }\n },1000)\n }\n\n try {\n var qtySelVal = parent.jju(snippet_52_options.showAddToCart.values[0].qtySelector.value+':visible:last').text();\n if (!$.isNumeric(qtySelVal)) qtySelVal = 0;\n qtySelVal = parseFloat(qtySelVal)+qty;\n parent.jju(snippet_52_options.showAddToCart.values[0].qtySelector.value).text(qtySelVal);\n } catch(er){\n //console.log('Mini Cart Quantity Selector not found');\n }\n\n var addButton = thisItem.find('.addButton');\n addButton.html(snippet_52_options.showAddToCart.values[0].langItemAdded.value);\n setTimeout(function(){\n addButton.html(snippet_52_options.showAddToCart.values[0].langAddToBag.value)\n },3000)\n thisItem.find('.prodOptions').hide();\n thisItem.find('.addNow').hide();\n thisItem.find('.addButton').show();\n }, 150, 'End');\n\n // setup platform specific stuff\n\n function addToCartShopify(Id,Variant,Sku,Qty){\n jju.ajax({\n url: '/cart/add.js',\n type: \"post\",\n dataType: \"text\",\n data: {items:[{id: Variant,quantity: Qty}],sections: \"header\"}\n }).done(function(data) {\n var htmlHeader = '';\n try{\n parent.update_shopify_ju_cart();\n\t\t\tvar parsedData = jju.parseJSON(data);\n var htmlHeader = parsedData.sections.header;\n } catch(e){};\n\t\tif (htmlHeader.length>100){\n \tparent.jju('[data-section-id=\"header\"]').html(htmlHeader);\n }\n });\n }\n\n function addToCartMagento(Id,Variant,Sku,Qty){\n jju.ajax({\n url: '/justuno/cart/add?product='+Id+'&variant='+Variant+'&qty='+Qty,\n type: \"get\"\n }).done(function(data) {\n //\n }).fail(function (jqXHR, textStatus) {\n // incase they don't have the latest magento plugin\n jju.ajax({\n url: '/checkout/cart/add/product/'+Variant+'/qty/1',\n type: \"get\"\n }).done(function(data) {\n //\n }).fail(function (jqXHR, textStatus) {\n //\n });\n });\n }\n\n function addToCartWordpress(Id,Variant,Sku,Qty){\n jju.ajax({\n url: '/?add-to-cart='+Variant+'&quantity='+Qty,\n type: \"get\"\n }).done(function(data) {\n //\n });\n }\n\n function addLinkShopify(){\n jju('.prodLink').each(function(){\n if (jju(this).attr('href').indexOf('/products/')==-1) jju(this).attr('href','/products/'+jju(this).attr('href'))\n })\n }\n\n function addToCartBigCommerce(Id,Variant,Sku,Qty){\n jju.ajax({\n url: '/cart.php?action=add&sku='+Sku+'&qty='+Qty,\n type: \"get\",\n dataType: \"text\"\n }).done(function(data) {\n // now fetch new cart info\n try{\n parent.update_bc_ju_cart();\n } catch(e){};\n });\n }\n\n function addToCartYahoo(Id,Variant,Sku,Qty){\n setTimeout(function(){\n parent.document.location='https://order.store.yahoo.net/'+snippet_52_platform_storeID+'/ymix/MetaController.html?eventName.addEvent&cartDS.shoppingcart_ROW0_m_orderItemVector_ROW0_m_itemId='+Id+'&cartDS.shoppingcart_ROW0_m_orderItemVector_ROW0_m_quantity='+Qty+'&ysco_key_cs_item=1§ionId=ysco.cart&ysco_key_store_id='+snippet_52_platform_storeID;\n },600)\n }\n\n function addToCartNetohq(Id,Variant,Sku,Qty){\n parent.jju('#ju-sku, #ju-qty').remove();\n parent.jju('body').append('<input type=\"hidden\" id=\"ju-sku\" value=\"'+Sku+'\"><input type=\"hidden\" id=\"ju-qty\" value=\"'+Qty+'\">');\n parent.$.addCartItem('ju-sku', 'ju-qty');\n // jju.ajax({\n // url: '/_mycart?sku='+Sku+'&qty='+Qty,\n // type: \"get\",\n // dataType: \"text\"\n // }).done(function(data) {\n // //\n // });\n }\n\n function getSlidesPerView(){\n var ww = getWindowWidth();\n var wh = getWindowHeight();\n try{\n var direction = snippet_52_options.direction.value;\n var responsiveColumnOption = snippet_52_options.responsiveColumns.value;\n var responsiveColumnOptionArr = responsiveColumnOption.replace(/\\s/g,'').split(',');\n var responsiveColumnOptionArrLast = responsiveColumnOptionArr[responsiveColumnOptionArr.length-1];\n for(var i=responsiveColumnOptionArr.length; i<8;i++){\n responsiveColumnOptionArr.push(responsiveColumnOptionArrLast);\n }\n if (direction=='horizontal'){\n if (ww<575) return parseInt(responsiveColumnOptionArr[0]);\n if (ww<815) return parseInt(responsiveColumnOptionArr[1]);\n if (ww<1055) return parseInt(responsiveColumnOptionArr[2]);\n if (ww<1295) return parseInt(responsiveColumnOptionArr[3]);\n if (ww<1535) return parseInt(responsiveColumnOptionArr[4]);\n if (ww<1775) return parseInt(responsiveColumnOptionArr[5]);\n if (ww<2015) return parseInt(responsiveColumnOptionArr[6]);\n } else {\n if (wh<575) return parseInt(responsiveColumnOptionArr[0]);\n if (wh<815) return parseInt(responsiveColumnOptionArr[1]);\n if (wh<1055) return parseInt(responsiveColumnOptionArr[2]);\n if (wh<1295) return parseInt(responsiveColumnOptionArr[3]);\n if (wh<1535) return parseInt(responsiveColumnOptionArr[4]);\n if (wh<1775) return parseInt(responsiveColumnOptionArr[5]);\n if (wh<2015) return parseInt(responsiveColumnOptionArr[6]);\n }\n return parseInt(responsiveColumnOptionArr[7]);\n } catch(e){\n if (snippet_52_options.direction.value=='horizontal'){\n if (ww<575) return 2;\n if (ww<815) return 3;\n if (ww<1055) return 4;\n if (ww<1295) return 5;\n if (ww<1535) return 6;\n if (ww<1775) return 7;\n if (ww<2015) return 8;\n return 9;\n } else {\n if (ww<575) return 1;\n if (ww<1000) return 2;\n return 2;\n }\n }\n }\n\n function resizeSwiper(){\n snippet_52_mySwiper.params.slidesPerView = getSlidesPerView();\n snippet_52_mySwiper.params.slidesPerGroup = getSlidesPerView();\n snippet_52_mySwiper.update();\n }\n\n function autoPlay(){\n if (snippet_52_options.autoScroll.value){\n var autoPlayObj = {\n delay: 5000,\n disableoninteraction: true\n }\n return autoPlayObj;\n } else {\n return false;\n }\n }\n\n if (snippet_52_options.direction.value=='vertical') {\n jju('.snippet_52_plugin-wrapper .swiper-container').css({'height':getWindowHeight()+'px','overflow':'hidden'});\n } else {\n jju('.snippet_52_plugin-wrapper .swiper-container').css({'height':'auto','overflow':'visible'});\n }\n\n window.snippet_52_mySwiper = new Swiper ('.snippet_52_plugin-wrapper .swiper-container', {\n // Optional parameters\n direction: snippet_52_options.direction.value,\n height:(snippet_52_options.direction.value=='vertical' ? getWindowHeight() : null),\n slidesPerView: getSlidesPerView(),\n spaceBetween: (snippet_52_options.direction.value=='vertical' ? 20 : 10),\n slidesPerGroup: getSlidesPerView(),\n loop: true,\n shortSwipes: true,\n mousewheel: {\n forceToAxis: true\n },\n threshold: snippet_52_options.prodLimit.value,\n autoplay: autoPlay(),\n\n // If we need pagination\n\n pagination: (snippet_52_options.pagination.value ? {\n el: '.swiper-pagination',\n clickable: true,\n dynamicBullets: true\n } : false),\n\n\n\n // Navigation arrows\n navigation: (snippet_52_options.navigation.value!='none' ? {\n nextEl: '.swiper-button-next',\n prevEl: '.swiper-button-prev'\n } : false),\n\n\n // And if we need scrollbar\n /*\n scrollbar: {\n el: '.swiper-scrollbar'\n }\n */\n on: {\n slideChange: function () {\n console.log('swiper initialized');\n items = jju('.swiper-slide-content');\n items.find('.prodOptions, .options, .selOptions, .addNow').hide();\n items.find('.addButton').show();\n items.find(\"select:visible\").simpleselect(\"setInactive\")\n jju('.swiper-container').removeClass('overflowVisible');\n jju('.prodImage2, .prodImage3').stop().fadeOut(100);\n },\n },\n })\n}\n\nvar snippet_52_prodsFilter = [];\n\nif (parent.juDa){\nif (parent.juDa.prods_seen && parent.juDa.prods_seen.length>0) {\n snippet_52_prodsFilter = parent.juDa.prods_seen.map(function(item,index) {\n return item.ID;\n });\n}\n\nif (parent.juDa.cartItem){\n for (var key in parent.juDa.cartItem) {\n // skip loop if the property is from prototype\n if (!parent.juDa.cartItem.hasOwnProperty(key)) continue;\n snippet_52_prodsFilter.push(parent.juDa.cartItem[key].v.i);\n }\n}\n\nif (parent.ju_config && parent.ju_config.prodId) {\n snippet_52_prodsFilter.push(parent.ju_config.prodId);\n}\n}\n\nvar snippet_52_prodsFilterUnique = [];\njju.each(snippet_52_prodsFilter, function(i, el){\n if(jju.inArray(el, snippet_52_prodsFilterUnique) === -1) snippet_52_prodsFilterUnique.push(el);\n});\n\nif (window.juPromo){\nvar snippet_52_guid = parent.ju_num.toLowerCase();\n} else {\nvar snippet_52_guid = account_guid;\n}\n\nvar snippet_52_dataUri = 'https://recommend.jst.ai/products/v2/'+snippet_52_guid+'/'+snippet_52_options.algo.value+'?limit='+snippet_52_options.prodLimit.value+'&products='+snippet_52_prodsFilterUnique.join();\n\nwindow.reloadRec = function(algo,cartitems,vieweditems,purchaseditems,currentitem){\n\nvar snippet_52_prodsFilter = [];\n\nif (parent.juDa){\n if (vieweditems && parent.juDa.prods_seen && parent.juDa.prods_seen.length>0) {\n snippet_52_prodsFilter = parent.juDa.prods_seen.map(function(item,index) {\n return item.ID;\n });\n }\n\n if (cartitems && parent.juDa.cartItem){\n for (var key in parent.juDa.cartItem) {\n // skip loop if the property is from prototype\n if (!parent.juDa.cartItem.hasOwnProperty(key)) continue;\n snippet_52_prodsFilter.push(parent.juDa.cartItem[key].v.i);\n }\n }\n\n if (purchaseditems && parent.juDa.order){\n for (var key in parent.juDa.order) {\n // skip loop if the property is from prototype\n if (!parent.juDa.order.hasOwnProperty(key)) continue;\n\n if (purchaseditems && parent.juDa.order[key].i){\n for (var item in parent.juDa.order[key].i) {\n // skip loop if the property is from prototype\n if (!parent.juDa.order[key].i.hasOwnProperty(item)) continue;\n snippet_52_prodsFilter.push(parent.juDa.order[key].i[item].i);\n }\n }\n }\n }\n\n if (currentitem && parent.ju_config && parent.ju_config.prodId) {\n snippet_52_prodsFilter.push(parent.ju_config.prodId);\n }\n}\n\nsnippet_52_prodsFilterUnique = [];\njju.each(snippet_52_prodsFilter, function(i, el){\n if(jju.inArray(el, snippet_52_prodsFilterUnique) === -1) snippet_52_prodsFilterUnique.push(el);\n});\n\nsnippet_52_dataUri = 'https://recommend.jst.ai/products/v2/'+snippet_52_guid+'/'+algo+'?limit='+snippet_52_options.prodLimit.value+'&products='+snippet_52_prodsFilterUnique.join();\n\njju.ajax({\n type: \"GET\",\n url: snippet_52_dataUri,\n cache: true\n }).always(function(data){\n if (!data.products && (!window.juPromo || previewmode==\"1\")){\n data = {\n filters:[],\n platform:\"shopify\",\n algorithm:\"mpbyviewed\",\n products:[testProd,testProd,testProd,testProd,testProd,testProd]\n };\n }\n snippet_52_filters = data.filters;\n snippet_52_platform = data.platform;\n snippet_52_algo = data.algorithm;\n snippet_52_prod = data.products;\n if (snippet_52_prod.length>0){\n snippet_52_generateSuggestions(snippet_52_prod,false);\n } else if (window.juPromo && window.previewmode!=\"1\") {\n close_window();\n } else {\n snippet_52_prod = [testProd,testProd,testProd,testProd,testProd,testProd];\n snippet_52_generateSuggestions(snippet_52_prod,false);\n }\n window.recLoaded = true;\n })\n}\n\n// aniCallback\n\nif (typeof snippet_52_Callback!=='function'){\nvar snippet_52_Callback = aniCallback ;\naniCallback = function(){\n var snippet_52_callbackresult = snippet_52_Callback.apply(this, arguments);\n\n var thisPrePost = $('.design-layer[data-layerid=\"'+snippet_52_layerId+'\"]').data('prepost');\n if((prepoststatus === thisPrePost || thisPrePost === 'both') && (prepoststatus!=window.lastprepoststatus || !window.juPromo)) {\n window.lastprepoststatus = prepoststatus;\n if (!window.recQueried && !window.recLoaded){\n window.recQueried = true;\n jju.when(\n jju.ajax({\n type: \"GET\",\n url: 'https://unpkg.com/swiper@7/swiper-bundle.min.js',\n dataType: \"script\",\n cache: true\n }),\n jju.ajax({\n type: \"GET\",\n url: 'https://unpkg.com/swiper@7/swiper-bundle.min.css',\n cache: true\n })\n )\n .done(function( a1, a2) {\n var css = a2[0];\n jju('<style type=\"text/css\" class=\"snippet_52_css\">\\n' + css + '<\/style>').appendTo(\"head\");\n jju.ajax({\n type: \"GET\",\n url: snippet_52_dataUri,\n cache: true\n }).always(function(data){\n if (!data.products && (!window.juPromo || previewmode==\"1\")){\n data = {\n filters:[],\n platform:\"shopify\",\n algorithm:\"mpbyviewed\",\n products:[testProd,testProd,testProd,testProd,testProd,testProd]\n };\n }\n snippet_52_filters = data.filters;\n snippet_52_platform = data.platform;\n snippet_52_algo = data.algorithm;\n snippet_52_prod = data.products;\n if (snippet_52_prod.length>0){\n snippet_52_generateSuggestions(snippet_52_prod,true);\n } else if (window.juPromo && window.previewmode!=\"1\") {\n close_window();\n } else {\n snippet_52_prod = [testProd,testProd,testProd,testProd,testProd,testProd];\n snippet_52_generateSuggestions(snippet_52_prod,true);\n }\n window.recLoaded = true;\n })\n });\n\n } else if (window.recLoaded) {\n snippet_52_generateSuggestions(snippet_52_prod,false);\n }\n\n }\n\n};\n\n}\n\nvar testProd = {\n \"id\": \"10564981320\",\n \"url\": \"\",\n \"title\": \"Test Product Title\",\n \"imageURL1\": \"https://my.jst.ai/admin/img/placeholder.gif\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"score\": 1,\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"optionType1\": \"size\",\n \"optionType2\": \"color\",\n \"optionType3\": \"\",\n \"variantList\": [{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"red\",\n \"option2\": \"Large\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"red\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue\",\n \"option2\": \"Large\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue1\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue2\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue3\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue4\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue5\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue6\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue7\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue8\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue9\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n },{\n \"id\": \"xxxxxxxxxx\",\n \"imageURL1\": \"\",\n \"imageURL2\": \"\",\n \"imageURL3\": \"\",\n \"sku\": \"xxxxxxxxx\",\n \"title\": \"default\",\n \"price\": 14.99,\n \"msrp\": 29.99,\n \"inventory\": 1,\n \"option1\": \"blue10\",\n \"option2\": \"XLarge\",\n \"option3\": \"\"\n }]\n };\n<\/script>"
},
"2": {
"z-index": 50,
"visible": true,
"prepost": "post",
"layertype": "html",
"layername": "Post-Engagement Heading",
"layerid": 51,
"layerx": 239,
"layery": 6,
"layerwidth": 600,
"layerheight": 100,
"layerrotate": 0,
"effect": "fade",
"layereffect": "none",
"layereffect-speed": 1,
"layereffect-delay": 0,
"scalex": 1,
"scaley": 1,
"editable": {
"padding": 0,
"opacity": 1,
"border-style": "solid",
"border-width": 0,
"border-radius": 0,
"direction": "to top",
"box-shadow": 0,
"background-color": "rgba(255,255,255,0)",
"gradient-color": "rgba(255,255,255,0)",
"border-color": "#000",
"sticky": "none",
"offset-left": 10,
"offset-right": 10,
"offset-top": 0,
"offset-bottom": 0,
"access": "",
"tabindex": 45
},
"html": "<div style=\"text-align:center\"><span style=\"color:#40738d;\"><span style=\"font-size:32px;\"><span style=\"font-family:poppins,sans-serif;\">CUSTOMERS ALSO BOUGHT<\/span><\/span><\/span><\/div>"
}
}
},
"fonts": {
"Playfair Display": {
"cat": "serif",
"italic": true,
"bold": true
},
"Roboto": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"Lato": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"Poppins": {
"cat": "sans-serif",
"italic": false,
"bold": true
},
"Amatic SC": {
"cat": "handwriting",
"italic": false,
"bold": true
},
"Quicksand": {
"cat": "sans-serif",
"italic": false,
"bold": true
},
"Raleway": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"Open Sans": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"Open Sans Condensed": {
"cat": "sans-serif",
"italic": false,
"bold": true
},
"Oswald": {
"cat": "sans-serif",
"italic": false,
"bold": true
},
"Fjalla One": {
"cat": "sans-serif",
"italic": false,
"bold": false
},
"Montserrat": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"PT Sans": {
"cat": "sans-serif",
"italic": true,
"bold": true
},
"Abel": {
"cat": "sans-serif",
"italic": false,
"bold": false
},
"Julius Sans One": {
"cat": "sans-serif",
"italic": false,
"bold": false
}
},
"guides": {},
"react": null
}
};
jju = jQuery;
$(document).ready(function() {
if (popup_json.design.popup.layers["0"] && popup_json.design.popup.layers[0].editable.position == 4) {
setTimeout(function() {
$('.design-canvas-powered').css({
'display': 'block',
'max-width': '80px',
'padding': '5px 8px',
'opacity': 1
})
}, 1000);
$(document).on('mouseenter', '.design-canvas-powered', function() {
$(this).html('Powered by <u>Justuno</u>"').css({
'max-width': '160px',
'background-color': '#00a64b',
'-moz-box-shadow': '0px 0px 7px transparent',
'-webkit-box-shadow': '0px 0px 7px transparent',
'box-shadow': '0px 0px 7px transparent'
});
});
$(document).on('mouseleave', '.design-canvas-powered', function() {
$(this).html('Justuno"').css({
'max-width': '80px',
'background-color': 'rgba(0,0,0,.3)',
'-moz-box-shadow': '0px 0px 7px rgba(0,0,0,.3)',
'-webkit-box-shadow': '0px 0px 7px rgba(0,0,0,.3)',
'box-shadow': '0px 0px 7px rgba(0,0,0,.3)'
});
});
}
if (popup_json.design.popup.layers["0"]) {
if (ju_onboarding_steps < 3 && ju_onboarding_display > -1) {
// for onboarding, remove steps as necessary
for (key in popup_json.design.popup.layers) {
if (ju_onboarding_steps === 1 && (popup_json.design.popup.layers[key].prepost == "intro" || popup_json.design.popup.layers[key].prepost == "pre")) {
console.log('removed layer', popup_json.design.popup.layers[key].layername, popup_json.design.popup.layers[key].prepost)
delete popup_json.design.popup.layers[key];
}
if (ju_onboarding_steps === 2 && popup_json.design.popup.layers[key].prepost == "intro") {
console.log('removed layer', popup_json.design.popup.layers[key].layername, popup_json.design.popup.layers[key].prepost)
delete popup_json.design.popup.layers[key];
}
}
}
// for onboarding change frame's color if necessary
if (ju_onboarding_display === 0 && tab_json.design.overlay.dim == "yes" && (popup_json.design.popup.layers["0"].editable["background-color"] == 'transparent' || popup_json.design.popup.layers["0"].editable["background-color"].substr(popup_json.design.popup.layers["0"].editable["background-color"].length - 3) == ',0)')) {
popup_json.design.popup.layers["0"].editable["background-color"] = tab_json.design.overlay["background-color"];
popup_json.design.popup.layers["0"].editable["gradient-color"] = tab_json.design.overlay["background-color"];
tab_json.design.overlay["overlay_opacity"] = .5;
tab_json.design.overlay["background-image"] = '';
}
if (ju_onboarding_display === 3) {
popup_json.design.popup.layers["0"].editable["background-image-intro"] = 'none';
popup_json.design.popup.layers["0"].editable["background-image-pre"] = 'none';
popup_json.design.popup.layers["0"].editable["background-image-post"] = 'none';
}
CreateSavedDesignCanvas(popup_json);
} else {
close_window();
}
})
< /script> < script language = "javascript"
type = "text/javascript"
src = "https://cdn.jst.ai/ifm_4.1.js?v=2.11.56" > < /script>
< script type = "application/javascript" >
< /script> < style >
< /style>
< /head> < body style = "background-color:transparent;" >
< div id = "ju-alert" > < /div> < div id = "modal-content" >
< div id = "modal-content-inner" > < button id = "modal-close" > OK < /button></div >
< /div> < div id = "fb-root" > < /div> < form id = "justuno_form"
target = "hidden_iframe"
method = "POST" > < /form> < iframe src = ''
id = 'hidden_iframe'
name = 'hidden_iframe'
style = 'display:none' > < /iframe> < /body> < /html>