// All rights reserved by Omnisend Ltd. Look, but don't touch. // https://www.omnisend.com/ // v4.0.1 if(void 0===window.OMNISEND_PUSH_NOTIFICATIONS_LOADED){window.OMNISEND_PUSH_NOTIFICATIONS_LOADED=!0;try{window._omnisend=(e=>(e.config={snippetVersion:"4.0.1",snippetHost:"https://omnisnippet1.com/",appHost:"https://app.omnisend.com/",pickerAPIHost:"https://app.omnisend.com/",customEventsHost:"https://api.omnisend.com/",wtAPIHost:"https://wt.omnisendlink.com/",pnHost:"https://pn.soundestlink.com/",allowedOrigins:["https://app.omnisend.com"],shopifyAppId:"186001"},e))(window._omnisend||{}),(()=>{var e;null===document.getElementById("omnisend-dynamic-container")&&((e=document.createElement("div")).id="omnisend-dynamic-container",e.style.overflow="hidden",e.style.height="0px",document.body.appendChild(e))})(),window.soundestInShop=window.soundestInShop||{},window.SOUNDEST=window.SOUNDEST||{},window.SOUNDEST.external=window.SOUNDEST.external||{},window.SOUNDEST_EVENTS=window.SOUNDEST_EVENTS||[],window.soundest=window.soundest||[],window._omnisend=window._omnisend||{},window.omnisend=window.omnisend||[],((e,n,t)=>{for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i],t[i]=n[i]);for(i in e)e.hasOwnProperty(i)&&(n[i]=e[i],t[i]=e[i])})(window.soundestInShop,window.SOUNDEST,window._omnisend),window._omnisend=(o=>{o.utils={};var n=/^[0-9a-fA-F]{24}$/,t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return o.utils.isDefined=function(e){return void 0!==e},o.utils.isObjectEmpty=function(e){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0},o.utils.isNull=function(e){return null===e},o.utils.isArray=function(e){return"[object Array]"==={}.toString.call(e)},o.utils.isInteger=function(e){return"[object Number]"==={}.toString.call(e)&&Math.floor(e)===e},o.utils.isFloat=function(e){return"[object Number]"==={}.toString.call(e)&&Math.floor(e)!==e},o.utils.isHTMLCollection=function(e){return"[object HTMLCollection]"==={}.toString.call(e)},o.utils.isValidUrl=function(e){return/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)},o.utils.isNodeList=function(e){return"[object NodeList]"==={}.toString.call(e)},o.utils.isFunction=function(e){return"[object Function]"==={}.toString.call(e)},o.utils.isString=function(e){return"[object String]"==={}.toString.call(e)},o.utils.isObject=function(e){var n=typeof e;return"function"==n||"object"==n&&!!e},o.utils.inArray=function(e,n){return-1!==e.indexOf(n)},o.utils.forEach=function(e,n){var t,i;if(o.utils.isArray(e)||o.utils.isHTMLCollection(e)||o.utils.isNodeList(e))for(t=0;ts&&(clearInterval(t),e(!1)),i()&&(clearInterval(t),e(!0))},o)})},o})(window._omnisend),window._omnisend=((e,i)=>(e.params={},e.params.getJSON=function(e){var n={},e=(e=i.isDefined(e)?e:window.location.href).split("#");if(i.isDefined(e[1]))try{n=i.jsonParse(decodeURIComponent(e[1]))}catch(e){}return n},e.params.getQuery=function(e){var n,t={};return i.isDefined(e)||(e=window.location.href),n=e.split("#"),i.isDefined(n[0])&&(n=n[0].split("?"),i.isDefined(n[1])?(n=n[1].split("&"),i.forEach(n,function(e){n=e.split("="),i.isDefined(n[0])&&i.isDefined(n[1])&&(t[n[0]]=decodeURIComponent(n[1]))})):(n=n[0].split("&"),i.forEach(n,function(e){n=e.split("="),i.isDefined(n[0])&&i.isDefined(n[1])&&(t[n[0]]=decodeURIComponent(n[1]))}))),t},e))(window._omnisend,window._omnisend.utils),window._omnisend=((i,o)=>{function s(e,n,t){var i=this;return i.elements=[],o.isNull(e)?o.isNull(n)||o.isNull(t)?o.isNull(t)||o.forEach(document.querySelectorAll(t),function(e){i.elements.push(e)}):o.forEach(n.elements,function(e){o.forEach(e.querySelectorAll(t),function(e){i.elements.push(e)})}):i.elements.push(e),i}return s.prototype.first=function(){return new s(this.elements[0],null,null)},s.prototype.clone=function(e){return new s(this.elements[0].cloneNode(e),null,null)},s.prototype.parent=function(){return new s(this.elements[0].parentNode,null,null)},s.prototype.val=function(e){var n=null;return o.isDefined(e)?o.isDefined(this.elements[0])&&(this.elements[0].value=e):o.isDefined(this.elements[0])&&(n=this.elements[0].value),n},s.prototype.find=function(e){return new s(null,this,e)},s.prototype.html=function(n){return o.forEach(this.elements,function(e){e.innerHTML=n}),this},s.prototype.size=function(){return this.elements.length},s.prototype.attr=function(n,t){var e=null;return o.isDefined(t)?o.forEach(this.elements,function(e){e.setAttribute(n,t)}):o.isDefined(this.elements[0])&&(e=this.elements[0].getAttribute(n)),e},s.prototype.removeAttr=function(n){return o.forEach(this.elements,function(e){e.removeAttribute(n)}),this},s.prototype.prop=function(n,t){var e=null;return o.isDefined(t)?o.forEach(this.elements,function(e){e[n]=t}):o.isDefined(this.elements[0])&&(e=this.elements[0][n]),e},s.prototype.empty=function(){return o.forEach(this.elements,function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),this},s.prototype.submit=function(){o.isDefined(this.elements[0])&&this.elements[0].submit()},s.prototype.reset=function(){o.isDefined(this.elements[0])&&this.elements[0].reset()},s.prototype.height=function(){var e=0;return e=o.isDefined(this.elements[0])?this.elements[0].offsetHeight:e},s.prototype.width=function(){var e=0;return e=o.isDefined(this.elements[0])?this.elements[0].clientWidth:e},s.prototype.offsetWidth=function(){var e=0;return e=o.isDefined(this.elements[0])?this.elements[0].offsetWidth:e},s.prototype.prependTo=function(e){var t=[];return e instanceof s?t=e.elements:o.isString(e)&&(t=new s(null,null,e).elements),e=this.elements,o.forEach(e,function(n){o.forEach(t,function(e){e.insertBefore(n,e.firstChild)})}),this},s.prototype.appendTo=function(e){var t=[];return e instanceof s?t=e.elements:o.isString(e)&&(t=new s(null,null,e).elements),e=this.elements,o.forEach(e,function(n){o.forEach(t,function(e){e.appendChild(n)})}),this},s.prototype.appendAfter=function(e){var t=[];return e instanceof s?t=e.elements:o.isString(e)&&(t=new s(null,null,e).elements),e=this.elements,o.forEach(e,function(n){o.forEach(t,function(e){e.parentNode.insertBefore(n,e.nextSibling)})}),this},s.prototype.addClass=function(n){return o.forEach(this.elements,function(e){o.isDefined(e.classList)?e.classList.add(n):e.className+=" "+n}),this},s.prototype.removeClass=function(n){return o.forEach(this.elements,function(e){o.isDefined(e.classList)?e.classList.remove(n):e.className=e.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")}),this},s.prototype.hasClass=function(e){var n=!1;return n=o.isDefined(this.elements[0])?o.isDefined(this.elements[0].classList)?this.elements[0].classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(this.elements[0].className):n},s.prototype.closest=function(e){var n=new s(null,null,null);if(o.isDefined(this.elements[0])){for(var t=this.elements[0],i=new s(t,null,null);!i.hasClass(e)&&t;)i=new s(t=t.parentNode,null,null);i.hasClass(e)&&(n=i)}return n},s.prototype.visible=function(){var n=[];return o.isArray(this.elements)&&o.forEach(this.elements,function(e){e.offsetWidth&&e.offsetHeight&&e.getClientRects().length&&n.push(e)}),this.elements=n,this},s.prototype.css=function(e){return o.forEach(this.elements,function(t){o.isString(e)?t.styleSheet?t.styleSheet.cssText=e:(t.innerHTML="",t.appendChild(document.createTextNode(e))):o.forEach(e,function(e,n){t.style[n]=e})}),this},s.prototype.setStyle=function(n,t,i){return o.forEach(this.elements,function(e){e.style.setProperty(n,t,i)}),this},s.prototype.show=function(){return o.forEach(this.elements,function(e){e.style.display="block"}),this},s.prototype.softShow=function(){return o.forEach(this.elements,function(e){e.style.height="auto",e.style.opacity="1",e.style.position="initial",e.style.zIndex="initial"}),this},s.prototype.hide=function(){return o.forEach(this.elements,function(e){e.style.display="none"}),this},s.prototype.softHide=function(){return o.forEach(this.elements,function(e){e.style.height="0",e.style.opacity="0",e.style.position="absolute",e.style.zIndex="-1"}),this},s.prototype.each=function(t){var i=this;return o.forEach(i.elements,function(e,n){t(new s(e,null,null),n,i)}),i},s.prototype.on=function(n,t){return o.forEach(this.elements,function(e){o.isDefined(e.addEventListener)?e.addEventListener(n,t,!1):e.attachEvent("on"+n,function(){t.call(e)})}),this},s.prototype.done=function(n){return o.isFunction(n)&&o.forEach(this.elements,function(e){e.addEventListener?e.addEventListener("load",n):e.onreadystatechange=function(){e.elementreadyState in{loaded:1,complete:1}&&(e.onreadystatechange=null,n())}}),this},s.prototype.error=function(n){return o.isFunction(n)&&o.forEach(this.elements,function(e){e.addEventListener&&e.addEventListener("error",n)}),this},o.isDefined(i.dom)||(i.dom={},i.dom.find=function(e){return new s(null,null,e)},i.dom.findElement=function(e){return new s(e,null,null)},i.dom.create=function(e,n){var t=document.createElement(e);return o.isDefined(n)&&o.forEach(n,function(e,n){t.setAttribute(n,e)}),new s(t,null,null)},i.dom.window=new s(window,null,null),i.dom.document=new s(document,null,null),i.dom.getOffsetX=function(){var e=o.isDefined(window.pageXOffset),n="CSS1Compat"===(document.compatMode||"");return e?window.pageXOffset:(n?document.documentElement:document.body).scrollLeft},i.dom.getOffsetY=function(){var e=o.isDefined(window.pageYOffset),n="CSS1Compat"===(document.compatMode||"");return e?window.pageYOffset:(n?document.documentElement:document.body).scrollTop},i.dom.getWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},i.dom.getHeight=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},i.dom.getScrollPercent=function(){var e=document.documentElement,n=document.body,t="scrollTop",i="scrollHeight",t=(e[t]||n[t])/((e[i]||n[i])-e.clientHeight)*100;return t=isNaN(t)?0:t},i.dom.onReady=function(e){"loading"!==document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",function(){"loading"!==document.readyState&&e()})},i.dom.onLeave=function(n){i.dom.window.on("mouseout",function(e){e=e||window.event,e=e.relatedTarget||e.toElement;e&&"HTML"!==e.nodeName||n()})},i.dom.onLeaveTop=function(n){i.dom.window.on("mouseout",function(e){(e||window.event).y<=0&&n()})},i.dom.injectScript=function(e,n,t){i.dom.create("script",{type:"text/javascript",async:!0,src:e}).error(t).done(n).appendTo("head")},i.dom.injectLink=function(e,n,t){i.dom.create("link",{rel:"stylesheet",type:"text/css",href:e}).error(t).done(n).appendTo("head")},i.dom.removeElement=function(e){var n=[];e instanceof s?n=e.elements:o.isString(e)&&(n=new s(null,null,e).elements),o.forEach(n,function(e){e.parentNode.removeChild(e)})}),i})(window._omnisend,window._omnisend.utils),window._omnisend=((e,o)=>{var s,r,c;return o.isDefined(e.getID)||(s=[],r=/-|:|T/gi,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e.getID=function(e){var n,t="",i={excludeTime:!1,excludeHash:!1,hashLength:49,delimiter:"-",isReverse:!1};o.extend(i,e);do{if(t="",!1===i.excludeTime&&(t+=(new Date).toISOString().replace(r,"").slice(0,14)),!1===i.excludeTime&&!1===i.excludeHash&&(t+=i.delimiter),!1===i.excludeHash)for(n=1;n<=i.hashLength;n+=1)t+=c.charAt(Math.floor(Math.random()*c.length));if(!0===i.isReverse){if(t="",!1===i.excludeHash)for(n=1;n<=i.hashLength;n+=1)t+=c.charAt(Math.floor(Math.random()*c.length));!1===i.excludeTime&&!1===i.excludeHash&&(t+=i.delimiter),!1===i.excludeTime&&(t+=(new Date).toISOString().replace(r,"").slice(0,14))}}while(o.inArray(s,t));return s.push(t),t}),e})(window._omnisend,window._omnisend.utils),window._omnisend=((s,r)=>{var o;return r.isDefined(s.cookies)||(s.cookies={},o=location.hostname.replace(/^www\./i,""),s.cookies.SECOND=1e3,s.cookies.MINUTE=6e4,s.cookies.HOUR=36e5,s.cookies.DAY=864e5,s.cookies.set=function(e,n,t){var i=e+"="+n+"; path=/; domain=."+o;/mybigcommerce.com/.test(location.hostname)&&r.isDefined(s.shopID)&&(i=e+"-"+s.shopID+"="+n+"; path=/; domain=.mybigcommerce.com"),r.isDefined(t)&&(e=new Date,(n=new Date).setTime(e.getTime()+t),i+="; expires="+n.toUTCString()),document.cookie=i},s.cookies.get=function(e){var n,t,i,o=document.cookie.split(";");for(/mybigcommerce.com/.test(location.hostname)&&r.isDefined(s.shopID)&&(e=e+"-"+s.shopID),i=0;i(e.request=e.request||{},o.isDefined(e.request.pixel)||(s.create("div",{id:"omnisend-pixel-container"}).appendTo("#omnisend-dynamic-container"),e.request.pixel=function(e,n,t){var i=["timestamp="+(new Date).getTime()],e=(o.isDefined(e.data)&&o.forEach(e.data,function(e,n){o.isArray(e)||o.isObject(e)?i.push(n+"="+encodeURIComponent(o.jsonStringify(e))):i.push(n+"="+encodeURIComponent(e))}),s.create("img",{src:e.url+"?"+i.join("&"),alt:""}));o.isFunction(n)&&e.on("load",n),o.isFunction(t)&&e.on("error",t),e.appendTo("#omnisend-pixel-container")}),e))(window._omnisend,window._omnisend.utils,window._omnisend.dom),window._omnisend=((i,o)=>(i.localStorage={isSupported:function(){try{var e;return"localStorage"in window?(e="_omnisend_localStorage",localStorage.setItem(e,e),localStorage.removeItem(e),!0):!1}catch(e){return!1}},load:function(e){var n,t={};return localStorage.getItem("_omnisend")&&(t=o.jsonParse(localStorage.getItem("_omnisend"))),e&&t[e]&&(n=t[e]),n=e?n:t},save:function(e,n){var t;n&&e&&((t=i.localStorage.load())[e]=n,localStorage.setItem("_omnisend",o.jsonStringify(t)))}},i))(window._omnisend,window._omnisend.utils),window._omnisend=((e,n)=>{var t;return e.shopBaseURL=window.location.protocol+"//"+window.location.hostname+"/",e.shopHostname=window.location.hostname,n.isDefined(e.version)||(e.version=(new Date).toISOString().slice(0,13)),n.isDefined(e.shopType)||(e.shopType="api"),n.isDefined(e.shopType)&&"shopify"===e.shopType&&(n.isDefined(__st)&&n.isDefined(__st.s)&&(t=__st.s.split("-"),n.isDefined(t[0]))&&"products"===t[0]&&n.isDefined(t[1])&&(e.productID=t[1]),n.isDefined(__st)&&n.isDefined(__st.rid)&&n.isDefined(__st.rtyp)&&"product"===__st.rtyp&&(e.productID=__st.rid),n.isDefined(__st))&&n.isDefined(__st.a)&&(e.shopID=__st.a),n.isDefined(e.globalVersion)&&"1"===e.globalVersion&&e.sendLog({message:"Global version is 1",brandID:e.accountID,shopID:e.shopID,shopType:e.shopType,shopHostname:e.shopHostname}),e})(window._omnisend,window._omnisend.utils),window._omnisend=((i,o)=>{function s(e){i.user.sessionID=e,i.cookies.set(d,e,t)}o.isDefined(i.cookies.get("soundestID"))||i.cookies.set("soundestID",i.getID()),o.isDefined(i.user)||(i.user={callbacks:[],handle:function(n){o.forEach(i.user.callbacks,function(e){e(n)})},listen:function(e){o.isFunction(e)&&i.user.callbacks.push(e)},sessionID:""});var e,n,r="omnisendContactID",c=365*i.cookies.DAY,a="omnisendEmailID",u=30*i.cookies.DAY,d="omnisendSessionID",t=30*i.cookies.MINUTE,l="omnisendAttributionID",f=30*i.cookies.DAY,p=(o.isDefined(i.contactIdentified)||(i.contactIdentified=!1),o.isString(i.cookies.get(d))&&64===i.cookies.get(d).length&&i.cookies.clear(d),i.cookies.get(d)),p=(o.isDefined(p)||(p=i.getID({hashLength:14,isReverse:!0})),s(p),i.initContact=function(e,n,t){if(o.isDefined(e)&&o.isObjectId(e)){if(o.isDefined(n)&&o.isObjectId(n)&&t&&(i.cookies.set(a,n,u),i.cookies.set(l,t,f)),o.isDefined(i.cookies.get(r))){if(e===i.cookies.get(r))return;n=i.getID({hashLength:14,isReverse:!0});s(n)}i.cookies.set(r,e,c),i.cookies.clear(a),i.cookies.clear(l),i.contactIdentified=!0,i.user.handle({contactID:i.cookies.get(r),sessionID:i.cookies.get(d)})}},i.params.getQuery());return i.initContact(p.omnisendContactID,(n=null,n=(e=p.omnisendAttributionID)&&(e=e.split("_"),o.isDefined(e[2]))?e[2]:n),p.omnisendAttributionID),i})(window._omnisend,window._omnisend.utils),window._omnisend=((i,o)=>{function s(e){e&&e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:o.base64UrlToUint8Array(i.pushNotifications.applicationServerKey)}).then(function(e){t(e.toJSON())&&u(e.toJSON()),r("pn_subscription",e.toJSON())},function(){})}function n(e){var n,t=c("pn_status");"granted"===e&&navigator.serviceWorker.register((n="","shopify"===i.shopType?n="/apps/omnisend/service-worker.js?v="+i.config.snippetVersion:"bigcommerce"===i.shopType?n="/content/service-worker.js?v="+i.config.snippetVersion:(n="/service-worker.js?v="+i.config.snippetVersion,o.isDefined(i.pushNotifications.path)&&(n=i.pushNotifications.path+n)),n)).then(function(n){var e;n.installing?e=n.installing:n.waiting?e=n.waiting:n.active&&(e=n.active),i.pushNotifications&&i.pushNotifications.applicationServerKey&&e&&(e.state&&"activated"===e.state?s(n):e.addEventListener("statechange",function(e){e.target&&"activated"===e.target.state&&s(n)}))},function(){}),-1<["default","denied","prompt"].indexOf(e)&&"granted"===t&&o.isFetchAPISupported()&&(n=i.localStorage.load("pn_subscription"),fetch(i.config.pnHost+"REST/pushNotifications/v2/optOut",{method:"POST",body:i.utils.jsonStringify(a(n))}).catch(function(e){console.log(e)})),r("pn_status",e)}function e(){var e,n;!o.isObjectEmpty(i.pushNotifications)&&i.contactIdentified&&i.pushNotifications.enabled&&o.isFetchAPISupported()&&(e=i.localStorage.load("pn_subscription"),n=i.localStorage.load("pn_status"),e)&&n&&"granted"===n&&fetch(i.config.pnHost+"REST/pushNotifications/v2/optIn",{method:"POST",body:i.utils.jsonStringify(a(e))}).catch(function(e){console.log(e)})}i.pushNotifications=i.pushNotifications||{};var r=function(e,n){i.localStorage.save(e,n)},c=function(e){return i.localStorage.load(e)},t=function(e){var n=c("pn_subscription");if(!n)return!0;if(!o.isObjectEmpty(n)&&!o.isObjectEmpty(e)){if(n.endpoint!==e.endpoint)return!0;if(n.keys&&e.keys){if(n.keys.auth&&e.keys.auth&&n.keys.auth!==e.keys.auth)return!0;if(n.keys.p256dh&&e.keys.p256dh&&n.keys.p256dh!==e.keys.p256dh)return!0}}return!1},a=function(e){var n={},t=i.params.getQuery();return o.isDefined(i.brandID)&&o.isObjectId(i.brandID)&&(n.brandID=i.brandID),o.isDefined(i.accountID)&&o.isObjectId(i.accountID)&&(n.brandID=i.accountID),o.isDefined(i.shopType)&&(n.shopType=i.shopType),o.isDefined(i.shopID)&&(n.shopID=i.shopID.toString()),o.isDefined(i.shopHostname)&&(n.shopHostname=i.shopHostname),o.isDefined(i.cookies.get("omnisendSessionID"))&&(n.sessionID=i.cookies.get("omnisendSessionID")),o.isString(i.cookies.get("omnisendAttributionID"))&&(n.attributionID=i.cookies.get("omnisendAttributionID")),o.isDefined(i.cookies.get("omnisendContactID"))&&(n.contactID=i.cookies.get("omnisendContactID")),e&&(n.subscription=e),t.utmSource&&(n.utmSource=t.utmSource),t.utmMedium&&(n.utmMedium=t.utmMedium),t.utmCampaign&&(n.utmCampaign=t.utmCampaign),n},u=function(e){!o.isObjectEmpty(e)&&o.isFetchAPISupported()&&fetch(i.config.pnHost+"REST/pushNotifications/v2/optIn",{method:"POST",body:i.utils.jsonStringify(a(e))}).then(function(e){return e.json()}).then(function(e){o.isDefined(e)&&o.isDefined(e.contactID)&&i.initContact(e.contactID,"","")}).catch(function(e){console.log(e)})};return new Promise(function(n,t){var e=Notification.requestPermission(function(e){n(e)});e&&e.then(function(e){n(e)},function(e){t(e)})}).then(function(e){n(e),"permissions"in navigator&&navigator.permissions.query({name:"notifications"}).then(function(e){e.onchange=function(){e&&e.state&&n(e.state)}})},function(){}),e(),i.pushNotifications.contactIdentified=e,i})(window._omnisend,window._omnisend.utils)}catch(e){}}