!function(t){function e(e){for(var i,s,a=e[0],c=e[1],d=e[2],h=0,l=[];ht===e)}function f(t){return`${(r.onsiteAnalytics.settings.debug?"http://":(new i).getProtocol())+r.onsiteAnalytics.settings.analyticsAPIHost}/${t}`}function p(){let t=(new Date).getTime();const e=(new i).getWindow();e.performance&&"function"==typeof e.performance.now&&(t+=performance.now());return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}function y(){return Math.round(new Date/1e3)}function g(t){this.context=t||new i,this.cookies=[]}function _(t){this.context=t||new i,this.is_available=!1;const e="_kla_test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),this.is_available=!0,this.is_available}catch(t){}}g.prototype.set=function(t,e,n={}){let i;n.minsToExpire?(i=new Date,i.setTime(i.getTime()+1e3*n.minsToExpire*60)):n.daysToExpire&&(i=new Date,i.setTime(i.getTime()+864e5*n.daysToExpire)),this._set(t,n.alreadyEncoded?e:function(t,e){const n=encodeURIComponent;return n instanceof Function?e?encodeURI(t):n(t):escape(t)}(e,!0),`${a(i)?"":";expires="+i.toGMTString()};path=${n.path?n.path:"/"}${n.domain?";domain="+n.domain:""}${n.secure?";secure":""}`)},g.prototype._set=function(t,e,n){this.context.getDocument().cookie=`${t}=${e}${n}`,this.cookies.push({name:t,value:e,extras:n})},g.prototype.get=function(t){const e=new RegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(this.context.getDocument().cookie);return e?function(t,e){const n=decodeURIComponent;let i;if(t=t.split("+").join(" "),n instanceof Function)try{i=e?decodeURI(t):n(t)}catch(e){i=unescape(t)}else i=unescape(t);return i}(e[2],!0):""},g.prototype.del=function(t,e={}){e.daysToExpire=-1,this.get(t)&&this.set(t,"",e)},g.prototype.has=function(){return a(this.context.getNavigator().cookieEnabled)?this.context.getNavigator().cookieEnabled?"1":"0":(this.set("__l_testcookie","1"),"1"===this.get("__l_testcookie")?"1":"0")},_.prototype.set=function(t,e){return!!this.is_available&&(localStorage.setItem(t,e),!0)},_.prototype.get=function(t){if(this.is_available)return localStorage.getItem(t)},_.prototype.del=function(t){return!!this.is_available&&(localStorage.removeItem(t),!0)};n("../../node_modules/core-js/modules/es6.array.sort.js"),n("../../node_modules/core-js/modules/es6.regexp.search.js");var m=n("../../node_modules/unfetch/dist/unfetch.mjs");n("../../node_modules/core-js/modules/es6.regexp.replace.js");const x={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,n,i,o,r,s,a,c="",d=0;for(t=x._utf8_encode(t);d>2,r=(3&e)<<4|(n=t.charCodeAt(d++))>>4,s=(15&n)<<2|(i=t.charCodeAt(d++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),c=c+this._keyStr.charAt(o)+this._keyStr.charAt(r)+this._keyStr.charAt(s)+this._keyStr.charAt(a);return c},decode:function(t){var e,n,i,o,r,s,a="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&o)<<4|(r=this._keyStr.indexOf(t.charAt(c++)))>>2,i=(3&r)<<6|(s=this._keyStr.indexOf(t.charAt(c++))),a+=String.fromCharCode(e),64!=r&&(a+=String.fromCharCode(n)),64!=s&&(a+=String.fromCharCode(i));return a=x._utf8_decode(a)},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n127&&i<2048?(e+=String.fromCharCode(i>>6|192),e+=String.fromCharCode(63&i|128)):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128),e+=String.fromCharCode(63&i|128))}return e},_utf8_decode:function(t){for(var e="",n=0,i=0,o=i;n191&&i<224?(o=t.charCodeAt(n+1),e+=String.fromCharCode((31&i)<<6|63&o),n+=2):(o=t.charCodeAt(n+1),c3=t.charCodeAt(n+2),e+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&c3),n+=3);return e}};var b=x;const v=/^([\w\-_=]+)\.(\w+)$/,w=t=>{const e=t.match(v);return e?{encryptedString:e[1],companyId:e[2]}:{}},S=t=>t&&!!(t.$exchange_id||t.email||t.id||t.$email||t.$id||t.$anonymous||t.$phone_number);function k(t){this.context=t.context,this.cookie=t.cookie,this.local_storage=t.local_storage,this.account_id=null,this.cookie_domain=null,this.identity=null,this.has_tracked_activity=!1,this.has_tracked_interests=!1,this.is_tracking_on=!this.cookie.get("__kla_off"),this._loadIdentityFromCookie()}k.prototype._loadIdentityFromCookie=function(){const t=this.cookie.get("__kla_id");if(t)try{if(this.identity=JSON.parse(b.decode(t)),this.identity&&this.identity.$email)try{const t=JSON.parse(this.identity.$email);this.identity=this._getIdentityFromKLObject(t),this._saveIdentity(this.identity)}catch(t){}}catch(t){}},k.prototype.account=function(t){return this.is_tracking_on&&!a(t)&&(this.account_id=t),this.account_id},k.prototype.cookieDomain=function(t){return this.is_tracking_on&&!a(t)&&(this.cookie_domain=t),this.cookie_domain},k.prototype.isIdentified=function(){return S(this.identity)},k.prototype._getIdentifiers=function(){const t={};return this.isIdentified()?(this.identity.$exchange_id&&(t.$exchange_id=this.identity.$exchange_id),this.identity.$email&&(t.$email=this.identity.$email),this.identity.email&&(t.email=this.identity.email),this.identity.$id&&(t.$id=this.identity.$id),this.identity.id&&(t.id=this.identity.id),this.identity.$phone_number&&(t.$phone_number=this.identity.$phone_number),this.identity.$anonymous&&(t.$anonymous=this.identity.$anonymous),t):t},k.prototype._hasMismatchedExchangeToken=function(t){if(void 0===t)return!1;const{companyId:e}=w(t);return!(!this.account_id||!e||this.account_id===e)},k.prototype.identify=function(t,e,n,i){if(this._shouldClearIdentity(t)&&this.clearIdentity(),!1===e&&this.identity)return this._getIdentityToReturn(this.identity,i);if(!this._identityNeedsUpdate(t)||!this.account_id)return this._getIdentityToReturn(this.identity,i);const o=null==t?void 0:t._kx,r=Object.assign({},this.identity,t);return delete r._kx,S(r)||o?this._sendNewIdentifyRequest(r,{_kx:o}).then(({$exchange_id:e,should_clear_cookie:o}={})=>{if(o&&this.clearIdentity(),!1!==n){let n;n=o?Object.assign({},t,{$exchange_id:e}):Object.assign({},r,{$exchange_id:e}),delete n.$email,delete n.$phone_number,this._removeSpecialKeysPostIdentify(n),this._setIdentity(n)}else{const t=Object.assign({},this.identity,{$exchange_id:e});this._setIdentity(t)}this.trackActivity(),void 0!==i&&i()}):(!1!==n&&this._setIdentity(r),void 0!==i&&i()),this._getIdentityToReturn(r)},k.prototype._getIdentityToReturn=function(t,e){const n=Object.assign({},t);return delete n.$exchange_id,delete n._kx,void 0!==e&&e(),n},k.prototype._removeSpecialKeysPostIdentify=function(t){return d(["$append","$unappend","$unset"],(function(e){c(t,e)&&(d(t[e],(function(n,i){"$unset"===e&&(i=n),c(t,i)&&delete t[i]})),delete t[e])})),t},k.prototype.clearIdentity=function(){this.cookie.del("__kla_id"),this.identity=null,this.clearViewedItems()},k.prototype.enableAnonymousTracking=function(){this.identity&&this.identity.$anonymous||this.identify({$anonymous:p()})},k.prototype.clearViewedItems=function(){this.local_storage.del("__kla_viewed")},k.prototype.trackActivity=function(t){if(this.has_tracked_activity)return;this._saveReferrer(),this._saveLastReferrer();const{context:e}=this,n=new o(e),i={page:e.getLocation().href,browser:n.browser,os:n.os};this._parseInitialUrl(()=>{this.track("__activity__",i)&&(this.has_tracked_activity=!0),void 0!==t&&t()})},k.prototype.trackViewedItem=function(t){if(!this.local_storage.is_available)return;const e=y();let n=this.local_storage.get("__kla_viewed");try{n=JSON.parse(n)||[]}catch(t){n=[]}if(n.length){const t=n.reduce((t,e)=>e[0].LastViewedDate&&(!t||e[0].LastViewedDate>t)?e[0].LastViewedDate:t,0);(!t||t+2592e3t.ItemId===n[0].ItemId&&(n[1]+=1,n[0].LastViewedDate=e,!0))||(t.LastViewedDate=e,n.unshift([t,1]),n=n.splice(0,20)),n.sort((function(e,n){return e[1]!==n[1]?n[1]-e[1]:e[0].ItemId===t.ItemId?-1:n[0].ItemId===t.ItemId?1:0})),this.local_storage.set("__kla_viewed",JSON.stringify(n));const i={},o=n.map(t=>Object.assign({},t[0],{Views:t[1]}));i.$viewed_items=o,this.identify(i,!0,!1)},k.prototype.track=function(t,e={}){const n=this.account_id,i=this.identity||{},o=!S(i);return!(!n||o)&&(e.$use_ip=!0,e.$is_session_activity=!0,this._sendTrackRequest({url:"api/track",data:JSON.stringify({event:t,token:n,properties:e,customer_properties:i})}),!0)},k.prototype.trackOnce=function(t,e){const n={__track_once__:!0};return e=Object.assign(n,e),this.track(t,e)},k.prototype._identityNeedsUpdate=function(t){const e=this.identity,n=Object.assign({},e,t);return!e||!h(e,n)},k.prototype._setIdentity=function(t){const e=t;delete e._kx,this.identity=e,this._saveIdentity(e)},k.prototype._saveIdentity=function(t){this.cookie.set("__kla_id",b.encode(JSON.stringify(t)),{daysToExpire:730,domain:this.cookie_domain})},k.prototype._saveReferrer=function(){const t=Object.assign({},this.identity);t.$referrer||(t.$referrer={ts:y(),value:this.context.getReferrer(),first_page:this.context.getLocation().href},this._setIdentity(t))},k.prototype._saveLastReferrer=function(){const t=Object.assign({},this.identity),e=y();(!t.$last_referrer||t.$last_referrer.ts+1800{if(t.ok)return t.json();throw new Error("Failed with status "+t.status)})},k.prototype._sendTrackRequest=function(t,e){const n=new FormData;return n.append("data",t.data),Object(m.a)(f(t.url),{method:"POST",mode:"no-cors",body:n}).then(t=>{if(t.ok)return e&&e(),t.json();throw new Error("Failed with status "+t.status)}).catch(t=>{e&&e(t)})},k.prototype._shouldClearIdentity=function(t){return!(!t||!this.identity)&&(this._hasCachedIdAndNewIdDiffers(t)||!this._hasCachedId()&&this._hasCachedEmailAndNewEmailDiffers(t)||this._hasExchangeIdAndCompanyIdDiffers())},k.prototype._hasCachedEmailAndNewEmailDiffers=function(t){return this.identity.$email&&t.$email&&this.identity.$email!==t.$email},k.prototype._hasCachedIdAndNewIdDiffers=function(t){return this._hasCachedId()&&!a(t.$id)&&t.$id!==this.identity.$id},k.prototype._hasCachedId=function(){return!a(this.identity.$id)},k.prototype._hasExchangeId=function(){return!a(this.identity.$exchange_id)},k.prototype._hasExchangeIdAndCompanyIdDiffers=function(){if(!this._hasExchangeId())return!1;const{companyId:t}=w(this.identity.$exchange_id);return this.account_id&&t&&this.account_id!==t};!function(){Array.prototype.toJSON&&delete Array.prototype.toJSON;const t=new i,e=t.getWindow();let n=e._learnq;const o=new k({cookie:new g(t),local_storage:new _(t),context:t});if(n&&n._loaded)return;const r=function(t){if("function"==typeof t)t(o);else if(Array.isArray(t)&&t&&o[t[0]])return o[t[0]].apply(o,t.slice(1))};for(Array.isArray(n)||(e._learnq=[],n=e._learnq),d(n,(function(t){Array.isArray(t)&&t&&l(["account","cookieDomain","identify"],t[0])&&r(t)}));n.length;)r(n.shift());n.push=r,["account","cookieDomain","identify","track","isIdentified"].forEach((function(t){o[t]&&(n[t]=function(){return o[t].apply(o,arguments)})})),n._loaded=!0,n.push(["trackActivity"])}()},2:function(t,e,n){n("../../node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js"),t.exports=n("./src/moduleLoaders/fenderAnalytics.ts")}});