(t=>{const{location:e,document:r,navigator:a}=t,{hostname:o,pathname:n}=e,{currentScript:i,referrer:s}=r,c=s.includes(o)?"":s;if(!i||a.userAgent.indexOf("Electron")>0)return;const g=i.getAttribute.bind(i)("data-website-id"),l=new URL(i.src).origin+"/send";let h=!0,d=!0;let u={};try{"object"!=typeof(u=JSON.parse(localStorage.getItem("_vhLastVisit"))||{})&&(u={})}catch(t){localStorage.removeItem("_vhLastVisit")}const m=u[n]||0,w=localStorage.getItem("_vhLastVisitor")||0,f=new Date,S=new Date(Number(w)),v=new Date(Number(m));f.getFullYear()===S.getFullYear()&&f.getMonth()===S.getMonth()&&f.getDate()===S.getDate()?h=!1:localStorage.setItem("_vhLastVisitor",Date.now()),Date.now()-v.getTime()<18e5?d=!1:(u[n]=Date.now(),localStorage.setItem("_vhLastVisit",JSON.stringify(u)));const y=t=>{if(!t)return"";try{if(decodeURI(t)!==t)return decodeURI(t)}catch(e){return t}return encodeURI(t)};(async()=>{if(g)try{await fetch(l,{method:"POST",body:JSON.stringify({website:g,host:o,path:y(n),referrer:y(c),visitor:h,visit:d}),headers:{"Content-Type":"application/json"}})}catch(t){/* empty */}})()})(window);