PageSourceSearch

https://mostreams-com.lovable.app/assets/EngagementBeacon-BiRu1H3m.js

js mostreams-com.lovable.app collected 2026-10-03 03:34:13 UTC 2,535 bytes, 1 lines download raw bytes

1import{u as f,r as w}from"./index-BNrdOJig.js";function h(){if(typeof window>"u")return"";let t=window.sessionStorage.getItem("mo_session_id");return t||(t=crypto.randomUUID(),window.sessionStorage.setItem("mo_session_id",t)),t}function g(){const t=f({select:e=>e.location.pathname}),v=w.useRef({start:0,maxScroll:0,clicked:!1,mouseMoved:!1,keyPressed:!1,videoPlay:!1,downloadClick:!1});return w.useEffect(()=>{if(typeof window>"u"||!t)return;const e=v.current;e.start=Date.now(),e.maxScroll=0,e.clicked=!1,e.mouseMoved=!1,e.keyPressed=!1,e.videoPlay=!1,e.downloadClick=!1;const r=()=>{const o=document.documentElement,s=Math.max(1,o.scrollHeight-window.innerHeight),a=Math.min(100,Math.max(0,window.scrollY/s*100));e.maxScroll=Math.max(e.maxScroll,o.scrollHeight<=window.innerHeight+40?100:a)},d=o=>{e.clicked=!0;const s=o.target?.closest?.("a,button"),a=`${s?.getAttribute("href")??""} ${s?.textContent??""}`.toLowerCase();/download|redeem|buy|get the disc/.test(a)&&(e.downloadClick=!0),s?.closest("[data-play],[aria-label*='play' i]")&&(e.videoPlay=!0)},i=()=>{e.mouseMoved=!0},l=()=>{e.keyPressed=!0},c=()=>{e.videoPlay=!0};r(),window.addEventListener("scroll",r,{passive:!0}),window.addEventListener("click",d,!0),window.addEventListener("mousemove",i,{passive:!0,once:!0}),window.addEventListener("touchstart",i,{passive:!0,once:!0}),window.addEventListener("keydown",l,{once:!0}),document.addEventListener("play",c,!0);const n=()=>{const o=Math.round((Date.now()-e.start)/1e3);o<2&&!e.clicked||fetch("/api/public/engagement",{method:"POST",headers:{"content-type":"application/json"},keepalive:!0,body:JSON.stringify({sessionId:h(),path:t,timeSeconds:o,scrollDepth:Math.round(e.maxScroll),clicked:e.clicked,mouseMoved:e.mouseMoved,keyPressed:e.keyPressed,videoPlay:e.videoPlay,downloadClick:e.downloadClick,webdriver:!!navigator.webdriver,languagesCount:navigator.languages?.length??0,referrer:document.referrer||null})}).catch(()=>{})},u=()=>{document.visibilityState==="hidden"&&n()};document.addEventListener("visibilitychange",u),window.addEventListener("pagehide",n);const m=window.setInterval(n,3e4);return()=>{window.removeEventListener("scroll",r),window.removeEventListener("click",d,!0),window.removeEventListener("mousemove",i),window.removeEventListener("touchstart",i),window.removeEventListener("keydown",l),document.removeEventListener("play",c,!0),document.removeEventListener("visibilitychange",u),window.removeEventListener("pagehide",n),window.clearInterval(m),n()}},[t]),null}export{g as EngagementBeacon};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.