import{i as r,b as i}from"./vendor-q1sfVHxQ.js";const c=t=>{const e=r();i.useLayoutEffect(()=>{if(!t||e!=="POP")return;const n=`${window.location.pathname}${window.location.search}`;let o=0;try{o=JSON.parse(sessionStorage.getItem(n)??"{}")?.scrollY??0}catch{return}if(!o)return;window.scrollTo({top:o,behavior:"instant"});const a=requestAnimationFrame(()=>{window.scrollTo({top:o,behavior:"instant"})});return()=>cancelAnimationFrame(a)},[t,e])};export{c as u};