(()=>{"use strict";function p(){0}function i(){try{return window.self!==window.top}catch(e){return 1}}function h(e,n){let r=e;if(e||(r=document.location.href),r&&n){let t=new URL(r);p(r),Object.keys(n).forEach(e=>{t.searchParams.has(e)||t.searchParams.append(e,n[e])}),p(t.href),r=t.href}return!e&&i()&&(r=document.referrer||r),r}function s(t){const n={};if(!t)return n;try{const e=new URL(t);return e.searchParams.forEach((e,t)=>{n[t]=e}),n}catch(e){return console.log("full url missing: ",t),n}}function l(e,t){t=s(t||h());return e in t?t[e]:""}function _(e){return l("utm_campaign",e)||l("campaign",e)}function v(e,t){var n=l("rf");if(n&&"string"==typeof n&&"false"==n)return"";let r;try{t&&"string"==typeof t&&(r=new URL(t).host)}catch(e){}if(e&&!e.includes(r))return e;e=l("hl_referrer");return e||(i()||!document.referrer||document.referrer.includes(document.location.origin)?"":document.referrer)}function o(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),1}catch(e){return}}function y(e){if(o("localStorage"))return localStorage.getItem(e)}function w(e,t){o("localStorage")&&localStorage.setItem(e,t)}function I(e){o("localStorage")&&localStorage.removeItem(e)}function b(e){var t=function(e){if(o("localStorage")){var t=localStorage.getItem(e);if(!t)return null;t=JSON.parse(t);const n=new Date;return n.getTime()>t.expiry?(localStorage.removeItem(e),null):t.value}}(e);if(t)return t;e=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return e&&e[2]?e[2]:""}function a(e,t,n){if(o("localStorage")){const r=new Date;n={value:t,expiry:r.getTime()+n};localStorage.setItem(e,JSON.stringify(n))}}function d(e,n,r){if(o("localStorage"))a(e,n,r?24*r*60*60*1e3:31536e6);else{let t="";if(r){let e=new Date;e.setTime(e.getTime()+24*r*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=e+"="+(n||"")+t+"; path=/"}}function S(t,n,r){if(o("localStorage"))a(t,n,60*(r=r||1)*1e3);else{let e="";if(r){const i=new Date;i.setTime(i.getTime()+60*r*1e3),e="; expires="+i.toUTCString()}document.cookie=t+"="+(n||"")+e+"; path=/"}}const t="v2_history",n="v2_contact_session_";function k(e){return(e=e||b("location_id"))?`${t}_${e}`:t}function T(e){return(e=e||b("location_id"))?`${n}${e}_session_id`:`${n}id`}function N(e){return`v2_session_history_${e=e||b("location_id")}`}function r(e){return`v2_user_session_event_${e=e||b("location_id")}_fingerprint`}function O(e){return`v3_first_session_event_${e}`}async function $(e,t){try{return await(await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}catch(e){return{}}}function D(e){if(!e)return null;try{return JSON.parse(e)}catch(e){return console.log(e),null}}class e{constructor(e,t){this.baseUrl=function(){const e=document.getElementsByTagName("script");for(var t=0;t{c&&d(T(e),c,365),await this.store(e,t,n,r,i,s,o)},u)}update(e){var t=e.sessionId||"",e=e.locationId||"";this.locationId=e,t&&(S(T(e),t,30),I(N(e)))}getCookie(e){return b(e)}setCookies(e,t){e&&t&&d(e,t)}getSessionId(e){return b(T(e||this.locationId))}getUserFingerprint(e){return b(r(e||this.locationId))}setUserFingerprint(e,t){return d(r(e||this.locationId),t)}}var c="undefined"==typeof window?{}:window;c.userSessionAttribution||(c.userSessionAttribution=new e)})();