Build 555975stable
Module 994763
953 characters · in 8e06c0ab4fcf7182.jsDependencies
Source Raw
function(e,t,s){s.d(t,{z:()=>r});var a=s(64700),i=s(17928),n=s(775602);function r(e,t,s,r){!function(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"start",l=arguments.length>4?arguments[4]:void 0,c=(0,i.bG)([n.A],()=>n.A.useReducedMotion),o=a.useRef(!1);a.useEffect(()=>{if(!t||o.current)return;let s={behavior:c?"auto":"smooth",block:r,inline:l},a=e();if(null!=a&&a.offsetHeight>0){o.current=!0,a.scrollIntoView(s);return}let i=!1,n=null,d=new ResizeObserver(e=>{let t=e[0];null==t||!(t.contentRect.height>0)||o.current||i||(o.current=!0,d.disconnect(),t.target.scrollIntoView(s))}),u=performance.now(),m=()=>{if(i||performance.now()-u>5e3)return;let t=e();null!=t?t.offsetHeight>0?(o.current=!0,t.scrollIntoView(s)):d.observe(t):n=requestAnimationFrame(m)};return m(),()=>{i=!0,null!=n&&cancelAnimationFrame(n),d.disconnect()}},[t,c,r,l,...s]),a.useEffect(()=>{t||(o.current=!1)},[t])}(()=>document.getElementById(e),t,[e],s,r)}}