!function(){var t={247:function(){!function(t){"use strict";t.wsnc_j=function(n,i){let o={};return o.settings=t.extend({key:"shopengine_wsnc",container:t("body"),method:"get",sourceURL:"",payload:{},data:[],notificationInterval:7e3,notificationDelay:1e3,cookieExpire:1,beforeFetchCallback:function(){},onCompleteCallback:function(){}},i),o.notificationData=[],o.notificationClosed=!1,o.notificationCookie=!1,o.settings.container=n,o.notification=t("<div>",{"class":"wsnc-notification wsnc-notification__wrapper"}),o.init=function(){o.getCookie(o.settings.key)||window.frameElement||window.innerWidth<575||(o.notification.appendTo(o.settings.container),t.ajax({method:o.settings.method,url:o.settings.sourceURL,data:o.settings.payload,beforeSend:function(){o.settings.beforeFetchCallback()},success:function(t){o.notificationData=t,o.manifest()},complete:function(){o.settings.onCompleteCallback()}}))},o.titleContentHandler=function(t,n){return n?`${t} from ${n}`:t},o.pushHTML=function({customer_id:t,customer_location:n,customer_name:i,product_id:e,product_title:a,product_url:c,purchase_time:s,quantity:r,thumbnail:f,transaction_id:u}){o.notification.append(`\n\t\t\t\t<div class="wsnc-notification__body">\n\t\t\t\t\t<div class="wsnc-notification__body--thumbnail">\n\t\t\t\t\t\t<img src="${f}" alt="Product Thumbnail"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="wsnc-notification__body--content">\n\t\t\t\t\t\t<h4 class="wsnc-notification__body--title"> ${o.titleContentHandler(i,n)} </h4>\n\t\t\t\t\t\t<div class="wsnc-notification__body--desc"> \n\t\t\t\t\t\t\t<span>${o.settings.purchasedTitle}</span> <a title="Notification" class="product-name" href="${c}"> ${a} </a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="wsnc-notification__body--footer">${s}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="wsnc-notification__close"></div>\n\t\t\t\t</div>\n            `)},o.manifest=function(){for(let t=0;t<o.notificationData.data.length;t++){const n=o.notificationData.data[t];o.pushHTML(n)}let t=o.settings.container.find(".wsnc-notification__body"),n=-1;!function i(){!0!==o.notificationClosed&&(n=(n+1)%o.notificationData.data.length,t.removeClass("wsnc-notification-active"),setTimeout((function(){t.eq(n).addClass("wsnc-notification-active")}),o.settings.notificationDelay),setTimeout(i,o.settings.notificationInterval))}()},o.notificationDestroy=function(t){t.preventDefault(),o.setCookie(o.settings.key,!0,o.settings.cookieExpire),o.notification.html(""),o.notificationClosed=!0,clearInterval(o.intervalObj)},o.setCookie=function(t,n,i){var o="";if(i){var e=new Date;e.setTime(e.getTime()+24*i*60*60*1e3),o="; expires="+e.toUTCString()}document.cookie=t+"="+(n||"")+o+"; path=/"},o.getCookie=function(t){for(var n=t+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){for(var e=i[o];" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(n))return e.substring(n.length,e.length)}return null},o.eraseCookie=function(t){document.cookie=t+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"},o.init(),t(document).on("click",".wsnc-notification__close",o.notificationDestroy),this}}(jQuery)}},n={};function i(o){if(n[o])return n[o].exports;var e=n[o]={exports:{}};return t[o](e,e.exports,i),e.exports}i.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(n,{a:n}),n},i.d=function(t,n){for(var o in n)i.o(n,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},i.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},function(){"use strict";i(247);jQuery(document).ready((function(t){var n=t(".wsnc-container");t.wsnc_j(n,{sourceURL:wsnc_var.api,cookieExpire:wsnc_var.cookieExpireInDays,notificationDelay:wsnc_var.notificationDelay,notificationInterval:wsnc_var.notificationIntervalInMs,purchasedTitle:wsnc_var.purchasedTitle})}))}()}();