PageSourceSearch

https://whip.run/assets/useSurfaceExit-Ch5GyPR6.js

js whip.run collected 2026-10-02 15:05:44 UTC 2,309 bytes, 1 lines download raw bytes

1import{_ as e,b as t}from"./env-DDtwVrOu.js";var n=t(e(),1),r=120*1e3,i=new Map;function a(e,t,{idleTimeoutMs:r,keepAliveWhileExperienceFocused:a=!1,onRestart:o}={}){let s=(0,n.useRef)(t);s.current=t;let c=(0,n.useRef)(o);c.current=o,(0,n.useEffect)(()=>{let t=i.get(e);t!==void 0&&(clearTimeout(t),i.delete(e));let n=!1,o=!1,l=!1,u,d,f=Date.now(),p=!1,m=()=>a&&document.visibilityState!==`hidden`&&document.hasFocus()&&document.activeElement?.tagName===`IFRAME`&&document.activeElement.id.startsWith(`web-experience-frame-`),h=e=>{p!==e&&(p=e,d!==void 0&&clearInterval(d),e&&(d=setInterval(()=>{m()||y()},1e3)))},g=e=>{n||(n=!0,e===`pagehide`&&(o=!0),u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),p&&(f=Date.now()),s.current({reason:e,lastActivityAt:f}),p&&h(!1))},_=()=>{document.visibilityState===`hidden`?g(`visibility_hidden`):C()},v=()=>g(`pagehide`),y=()=>{if(!(r===void 0||o)){if(n){if(!c.current||document.visibilityState===`hidden`)return;n=!1,c.current()}m()||h(!1),f=Date.now(),u!==void 0&&clearTimeout(u),!p&&(u=setTimeout(()=>{if(m()){h(!0);return}g(`idle_timeout`)},r))}},b=()=>{m()&&(h(!0),u!==void 0&&clearTimeout(u))},x=()=>{y(),C()},S=()=>{window.setTimeout(()=>{l||document.activeElement?.tagName===`IFRAME`&&(y(),m()&&b())},0)},C=()=>{window.setTimeout(()=>{l||document.visibilityState===`hidden`||!document.hasFocus()||(p&&m(),y(),b())},0)};return document.addEventListener(`visibilitychange`,_),window.addEventListener(`pagehide`,v),r!==void 0&&(window.addEventListener(`pointerdown`,x,!0),window.addEventListener(`keydown`,x,!0),window.addEventListener(`touchstart`,x,!0),window.addEventListener(`scroll`,x,!0),window.addEventListener(`blur`,S),window.addEventListener(`focus`,C),document.addEventListener(`focusin`,C),y(),b()),()=>{l=!0,document.removeEventListener(`visibilitychange`,_),window.removeEventListener(`pagehide`,v),window.removeEventListener(`pointerdown`,x,!0),window.removeEventListener(`keydown`,x,!0),window.removeEventListener(`touchstart`,x,!0),window.removeEventListener(`scroll`,x,!0),window.removeEventListener(`blur`,S),window.removeEventListener(`focus`,C),document.removeEventListener(`focusin`,C),u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),i.set(e,setTimeout(()=>{i.delete(e),g(`route_change`)},0))}},[e,r,a])}export{a as n,r as t};

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.