!function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=16)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],n=P.createElement("script");return n.type="text/javascript",n.src=t,n.async=e,P.body.appendChild(n)},k=function(){function t(e){i()(this,t),this.pixels=e,this.parameters={sku:"",orderId:"",qty:"",revenue:"",ltv:""}}return u()(t,[{key:"dropPixel",value:function(t,e){var n=this.pixels[t]||[],a=this.parameters;e&&Object.keys(e).forEach((function(t){return a[t]=e[t],!1})),n.forEach((function(t){var e=t,n="img";return"string"!=typeof t&&(e=t[0],(n=t[1])||(n="img")),e=(e=(e=(e=(e=(e=e.replace(/\[\[SKU\]\]/g,a.sku)).replace(/\[\[ORDERID\]\]/g,a.orderId)).replace(/\[\[QTY\]\]/g,a.qty)).replace(/\[\[REVENUE\]\]/g,a.revenue)).replace(/\[\[LTV\]\]/g,a.ltv)).replace(/\[\[ITEMS\]\]/g,(a.items||[]).map((function(t){return t.id||""})).join(",")),"img"===n?S(e):"script"===n?E(e):"iframe"===n&&A(e)}))}}]),t}(),x=window.auvars["".concat("30")].t,_=(window.auvars["".concat("30")].p,function(t){function e(){var t;return i()(this,e),(t=d()(this,h()(e).call(this))).brand=window.Shopify.shop,t}return w()(e,t),u()(e,[{key:"captureProduct",value:function(t){try{var e=window.ShopifyAnalytics.meta.selectedVariantId,n=window.ShopifyAnalytics.meta.product.variants[0];return t?n=window.ShopifyAnalytics.meta.product.variants.find((function(e){return e.public_title===t})):e&&(n=window.ShopifyAnalytics.meta.product.variants.find((function(t){return t.id.toString()===e.toString()}))),n||((n=window.ShopifyAnalytics.meta.product.variants[0]).id=window.ShopifyAnalytics.meta.product.id),{id:"".concat(n.id,"-").concat(x),name:n.name,price:parseInt(n.price,10)/100,brand:this.brand}}catch(t){return console.error(t),null}}},{key:"sendProductEvents",value:function(){var t=this,e=this.captureProduct();if(e){this.sendViewProductEventToGA(e),this.appendPageLoadPixelCheck("view");var n=document.querySelector('button[name="add"]')||document.querySelector("form#add-item-form button")||document.querySelector("button.shopify_add_to_cart")||document.querySelector('input[name="add"]')||document.querySelector(".ProductForm__AddToCart")||document.querySelector("#AddToCart")||document.querySelector('.product-add input[type="submit"]');n&&window.au.push({category:"ListenerAttacher",input:n,method:function(){t.sendAddProductEventToGA(e),window.au.push({category:"behavior",action:"purchase-intent"});var n={event:"addToCart",data:e};t.profilerServiceRequest(n)}})}}},{key:"captureCart",value:function(){try{for(var t=document.querySelector("#order-summary").querySelectorAll("tr.product"),e=[],n=0;n0)for(var o=function(e){var n=r[e],a=n.querySelector("button").dataset.cartAdd,o=n.querySelector('[class$="item__title"]').textContent;if(n.querySelector(".js-option-value")){var i=n.querySelector(".js-option-value").textContent.split(": ");o+=i[i.length-1]}var c={id:a,name:o,price:parseFloat(n.querySelector(".product-price__price").textContent.replace(/[^0-9.]/g,"")),brand:t.brand};window.au.push({category:"ListenerAttacher",input:n,method:function(){t.sendAddProductEventToGA(c);var e={event:"addToCart",data:c};window.au.push({category:"behavior",action:"purchase-intent"}),t.profilerServiceRequest(e)}})},i=0;i0)for(window.addEventListener("ProductMetaUpdated",(function(){t.sendProductEvents()})),i=0;i=e.decoratorTarget))return null;var a=L.querySelectorAll("meta"),o=["og:title","og:description","og:image","og:url","og:type","og:name","og:locale"];a.forEach((function(t){var e=t.getAttribute("property");o.includes(e)&&(n[e.replace("og:","")]=t.getAttribute("content")),"keywords"===t.getAttribute("name")&&(n.keywords=(t.getAttribute("content")||"").split(","))})),n.url||(n.url=e.u.href),n.title||(n.title=L.title),n=q({},n,{},t.decor_dict);var i=[].concat(r()(e.metatags),r()(t.tags));i=i.filter((function(t){return"string"==typeof t||t instanceof String})).map((function(t){return t.replace(/,/g,"")})),n.tags=i.join(),n.tagger_id=e.auvars.t,n.partner_id=e.auvars.p;var c=new XMLHttpRequest,u="".concat("https://p.ad.gt","/api/v1/dec");return c.open("POST",u,!0),c.setRequestHeader("Content-type","application/json"),c.send(JSON.stringify(n)),c})),b()(this,"setupGA",(function(){var t,n,a,r,o;R.ga||(n=L,a="script","ga",(t=R).GoogleAnalyticsObject="ga",t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,r=n.createElement(a),o=n.getElementsByTagName(a)[0],r.async=1,r.src="https://www.google-analytics.com/analytics.js",o.parentNode.insertBefore(r,o)),ga("create","UA-87198801-1","auto","auPassiveTagger"),ga("".concat("auPassiveTagger",".require"),"ecommerce"),ga("".concat("auPassiveTagger",".require"),"ec"),ga("".concat("auPassiveTagger",".set"),"anonymizeIp",!0),ga("".concat("auPassiveTagger",".set"),"dimension1",e.auvars.a),ga("".concat("auPassiveTagger",".set"),"dimension2","none"),ga("".concat("auPassiveTagger",".set"),"dimension3",e.auvars.p),ga("".concat("auPassiveTagger",".set"),"dimension4",e.u.hostname),ga("".concat("auPassiveTagger",".set"),"dimension5",e.u.pathname),ga("".concat("auPassiveTagger",".set"),"dimension6","Passive Tagger"),ga("".concat("auPassiveTagger",".set"),"dimension7",e.auvars.t),e.randNum>=.85&&ga("".concat("auPassiveTagger",".send"),"pageview")})),b()(this,"ListenerIterator",(function(t,n){Array.prototype.forEach.call(L.querySelectorAll(t),(function(t){e.ListenerAttacher({input:t,method:n})}))})),b()(this,"ListenerAttacher",(function(t){var e=t.input,n=t.method;e.addEventListener?(e.addEventListener("mousedown",n),e.addEventListener("touchstart",n)):e.attachEvent&&(e.attachEvent("mousedown",n),e.attachEvent("touchstart",n))})),b()(this,"sendOffsiteClick",(function(t){var n=t.url;S("".concat("https://a.ad.gt","/api/v1/off-site-click/").concat(e.auvars.p,"?tagger_id=").concat(e.auvars.t,"&url=").concat(n))})),b()(this,"clickHandler",(function(t){var n=t.currentTarget.getAttribute("href");null!==n&&e.include_internal_links.includes(window.location.hostname)&&window.au.push({category:"sendSPAPageView",url:n})})),b()(this,"sendUserBehaviour",(function(t){var n={click_url:t.action,tagger_id:e.auvars.t,audigent_id:e.auvars.a},a=new XMLHttpRequest,r="".concat("https://p.ad.gt","/api/v1/ubh");a.open("POST",r,!0),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(n))})),b()(this,"behavior",(function(t){var n=encodeURIComponent("".concat(e.u.protocol,"//").concat(e.u.hostname).concat(e.u.pathname,"__audigent-behavior-").concat(t.action).concat(e.u.search).concat(e.u.hash));e.sendOffsiteClick({url:n}),e.sendGAEvent({eventCategory:"audigent-behavior",eventAction:t.action,eventLabel:e.auvars.t})})),b()(this,"sendEvent",(function(t){var n=t.event;n=q({tagger_id:e.auvars.t,partner_id:e.auvars.p,audigent_id:e.auvars.a},n);var a=new XMLHttpRequest,r="".concat("https://p.ad.gt","/api/v1/event");a.open("POST",r,!0),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(n))})),b()(this,"sendGAEvent",(function(t){var e=t.eventCategory,n=t.eventAction,a=t.eventLabel,r=t.skipSQS;ga("".concat("auPassiveTagger",".send"),{hitType:"event",eventCategory:e,eventAction:n,eventLabel:a}),r||window.au.push({category:"sendEvent",event:{type:e,eventAction:n,eventLabel:a}})})),b()(this,"otpTrack",(function(){var t=window.au_seg;if(t&&t.segments){var n=t.segments.filter((function(t){return t.match(/AU_SEG_(AGE|GENDER)/gi)}));e.randNum>=.9&&e.sendGAEvent({eventCategory:"otpTracker",eventAction:n.join("|"),eventLabel:e.u.hostname,skipSQS:!0})}if(e.randNum>=.99||e.randNum>=.85&&[220,158,134].includes(e.auvars.p)){var a=e.u.hostname,r=new XMLHttpRequest,o="".concat("https://seg.ad.gt","/api/v1/demo?au_id=").concat(e.auvars.a,"&tagger_id=").concat(e.auvars.t);r.open("get",o,!0),r.setRequestHeader("Content-type","application/json"),r.addEventListener("load",(function(){var t=JSON.parse(this.responseText).segments||[];t.length&&window.au.push({category:"sendGAEvent",eventCategory:"otpTester",eventAction:t.join("|"),eventLabel:a,skipSQS:!0})})),r.send()}})),b()(this,"pixels",(function(){var t="".concat("https://pixels.ad.gt","/api/v1/getpixels?tagger_id=").concat(e.auvars.t,"&url=").concat(encodeURIComponent(e.u.href),"&code='none'");E(t,!0)})),b()(this,"sendSPAPageView",(function(t){var n=t.url;if(n){n.startsWith("//")&&(n="http://"+n),!n.startsWith("/")&&n.includes("://")||(n=L.location.protocol+"//"+L.location.host+(n.startsWith("/")?"":"/")+n);try{var a=new URL(n);a.host===L.location.host&&(e.sendOffsiteClick(a.href),ga("".concat("auPassiveTagger",".send"),"pageview",a.pathname+a.hash))}catch(t){}}})),b()(this,"tags",(function(t){e.metatags=e.metatags.concat(t.action.map((function(t){return t.toUpperCase()})))})),b()(this,"conversion",(function(t){console.log("Audigent Conversion Event - ".concat(t.action))})),b()(this,"pageView",(function(t){console.log("Audigent PageView Event - ".concat(t.action))})),b()(this,"beopEvent",(function(t){var n=t.partnerId||e.auvars.p;e.sendEvent({event:q({},t.data||{},{partner_id:n,type:"beop"})})})),b()(this,"trackEvent",(function(t){return!1})),b()(this,"DispatchEvent",(function(t){var e=function(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=!1,n=!1,a=void 0,r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e,n,a),r}(t.eventName);window.dispatchEvent(e)})),b()(this,"optout",(function(){S("".concat("https://ids.ad.gt","/api/v1/optout"))})),this.u=R.location,this.metatags=[],this.auvars=R.auvars["".concat("30")],this.randNum=Math.random(),this.docReady=this.docReady.bind(this),this.facebook=this.facebook.bind(this),this.decoratorTarget=I.includes(this.auvars.p)?.99:.999,this.pixels(),this.facebook(),this.setupGA(),this.ListenerIterator("a",this.clickHandler),this.include_internal_links=[],R.addEventListener("hashchange",(function(){e.sendSPAPageView({url:e.u.href}),e.pixels()}))}return u()(t,[{key:"valueOf",value:function(){return null}},{key:"docReady",value:function(){if(window.Shopify){var t=new _;t.initialize(),window.addEventListener("aupixels",(function(){t.updatePixels()}))}this.DispatchEvent({eventName:"aufp"}),window.auvars.fp=!0,this.otpTrack()}},{key:"facebook",value:function(){return"57"!==this.auvars.p&&(t=window,e=document,n="script",t.fbq||(a=t.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},t._fbq||(t._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(r=e.createElement(n)).async=!0,r.src="https://connect.facebook.net/en_US/fbevents.js",(o=e.getElementsByTagName(n)[0]).parentNode.insertBefore(r,o)),fbq("init","1853083501571805"),fbq("trackSingle","1853083501571805","PageView"),fbq("trackSingleCustom","1853083501571805","Audience",{partner_id:this.auvars.p,tagger_id:this.auvars.t}),this.randNum>=.99&&A("https://cdn.ad.gt/fbanalytics.html?tagger_id=".concat(this.auvars.t)),!0);var t,e,n,a,r,o}}]),t}());O=(C=window).au&&C.au.valueOf()&&C.au.valueOf().length?r()(C.au):[],j=new G,C.autag=C.autag||[],C.autag.push(j),C.au={push:function(t){(C.autag||[]).forEach((function(e){return e.push(t)}))}},O.forEach((function(t){return C.au.push(t)})),docReady((function(){return window.au.push({category:"docReady"})}))}]);