!function(){function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},o(t)}"object"===o(window.Pepperjam)&&null!==window.Pepperjam||(window.Pepperjam={})}(); !function(){"use strict";function t(e){if(this.constructor===t)throw new Error("Cannot instantiate abstract class");this._data=null,this.window=e}function e(e,i,a){t.call(this,e),this._cookieName=i,this._cookieMaxAge=a;var r=this;return this.getCookieName=function(){return this._cookieName},this.getCookieMaxAge=function(){return this._cookieMaxAge},this.saveData=function(t){this._data=t,this.window.document.cookie=this._cookieName+"="+t+";path=/;max-age="+this._cookieMaxAge},this.getData=function(){var t=null;return this.window.document.cookie.split(";").forEach((function(e){var i=(e=e.trim()).split("="),a=i[0],s=i[1];a===r._cookieName&&(t=s)})),t},this}function i(e,i){return t.call(this,e),this._storageKey=i,this.getStorageKey=function(){return this._storageKey},this.saveData=function(t){this._data=t,e.localStorage.setItem(this._storageKey,t)},this.getData=function(){return e.localStorage.getItem(this._storageKey)},this}function a(t,e,i){var a=t,r=e||"pjIframeParsed",s=i||[];function o(t){var e=a.document.createElement("a");return e.href=t,e}return this.getTrackingIframeUrls=function(){return function(){for(var t=[],e=a.document.querySelectorAll("iframe"),i=0;i=0&&!n.className.match(h)&&!n.id.match(l)&&(t.push(c),""===n.className?n.className=r:n.className+=" "+r)}return t}()},this}function r(t){var e=t;return this.validateMessageOrigin=function(t,i){var a,r,s=(a=t.origin,(r=e.document.createElement("a")).href=a,r);return i.indexOf(s.hostname)>=0},this}t.prototype.getData=function(){return this._data},t.prototype.setData=function(t){this._data=t},e.prototype=Object.create(t.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,enumerable:!1,writable:!0}),i.prototype=Object.create(t.prototype),Object.defineProperty(i.prototype,"constructor",{value:i,enumerable:!1,writable:!0}),window.PepperjamTracking=function(t,s){var o=this;return this.window=t,this.clickIdQueryParamIframe="CLICK_ID",this.clickIdQueryParam=["clickId"],this.obfuscatedClickIdQueryParams=[],this.gclidQueryParam="gclid",this.cookieName="pjn-click",this.cookieMaxAge=5184e3,this.localStorageKey="pjnClickData",this.domains=["t.pepperjamnetwork.com"],this.messageNoCookies="pjn-no-cookies",this.messageCookiesOk="pjn-cookies-ok",this.pjPrefix="p",this.gclidPrefix="g",this.iframeAdded=!1,this.maxClicks=20,this.lookBackPeriod=60,this.platformKey="PLATFORM",this.platform="ITC2",this.parsedIframeClass="pjIframeParsed",this.invalidClickIdRegex=/[;%&#+=?,]/,this.invalidGclidRegex=/[;%&#+=?,]|{gclid}/i,this.cookieStorage=new e(this.window,this.cookieName,this.cookieMaxAge),this.localStorage=new i(this.window,this.localStorageKey),this.messageValidator=new r(this.window),this.getClickIdQueryParamUsed=function(t,e){var i=e.split("&");try{for(var a=0;a0&&(a=a.sort((function(t,e){return i.daySort(t,e)}))).forEach((function(t){var e=t.id,i=t.type;0===r.filter((function(t){return t.id===e&&t.type===i})).length&&r.push(t)})),this.trimCookie(r,!1)},this.handleClickId=function(t,e){var i=t,a="g"===e?this.invalidGclidRegex:this.invalidClickIdRegex;if(i&&!i.match(a)){for(var r=this.getToday(),s=this.getClickData(),o=!1,n=s,c=0;cthis.maxClicks&&(s=this.trimCookie(s,!0)),this.saveCookieData(JSON.stringify(s)))}},this.trimCookie=function(t,e){return t.length>this.maxClicks&&(t=e?(t=t.reverse().splice(0,this.maxClicks)).reverse():t.splice(0,this.maxClicks)),t},this.clickWithinLookback=function(t,e){return Math.abs(e-t.days)<=this.lookBackPeriod},this.handleConversion=function(t){if((t.data===o.messageNoCookies||t.data===o.messageCookiesOk)&&o.messageValidator.validateMessageOrigin(t,o.domains)){var e=o.iframeParser.getTrackingIframeUrls();e.length&&!o.iframeAdded&&(e.forEach((function(t,e){var i=o.window.document.createElement("iframe"),a=t.href,r=a.split("?")[0],s=t.search.substring(1),n=o.clickDataToQueryParam(o.getQueryParam("INT",s)),c=[o.clickIdQueryParamIframe].concat(o.obfuscatedClickIdQueryParams),h=o.getClickIdQueryParamUsed(c,s),l=new RegExp("&"+h+"(=[^&]*)?|^"+h+"(=[^&]*)?&?","i"),d=o.getQueryParam(c,s);if(d){var u=d.split(","),f=n?n.split(","):[],m=[],g=u.length,k=f.length,p=o.getPjClickData();if(o.getQueryParam("INT",s)&&"dynamic"===o.getQueryParam("INT",s).toLowerCase()||0===p.length)for(var y=0;y0&&""!==o.obfuscatedClickIdQueryParams[0]?o.obfuscatedClickIdQueryParams[0]:o.clickIdQueryParamIframe)+"="+n;w+="&"+o.platformKey+"="+o.platform,i.setAttribute("src",w),o.window.document.body.appendChild(i)})),o.iframeAdded=!0)}},this.handle=function(){var t=s.obfuscatedClickIdQueryParams.filter((function(t){return""!==t}));this.obfuscatedClickIdQueryParams=t,this.maxClicks=parseInt(s.maxClicks),this.domains=s.domains,this.iframeParser=new a(this.window,this.parsedIframeClass,this.domains),this.handleClickId(this.getClickId(),this.pjPrefix),this.handleClickId(this.getGclid(),this.gclidPrefix),this.window.addEventListener("message",this.handleConversion);var e=this.mergeClickData();e&&e.length>0&&(this.saveCookieData(JSON.stringify(e)),this.saveLocalStorageData(JSON.stringify(e)))},this.setIframeParser=function(t,e,i){this.iframeParser=new a(t,e,i)},this.handle()},new window.PepperjamTracking(window,{obfuscatedClickIdQueryParams:[""],domains:["t.pepperjamnetwork.com"],maxClicks:"20"})}();