PageSourceSearch

https://neuland-it.de/assets/useFocusTrap-cJfgH0Oi.js

js neuland-it.de collected 2026-10-09 23:15:55 UTC 1,023 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./framer-motion-P_OBDBM7.js";var n=e(t(),1);function r(e,t,r){(0,n.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let i=r?.restoreFocusTo??document.activeElement,a=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`input:not([disabled]):not([type="hidden"])`,`select:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`),o=()=>Array.from(n.querySelectorAll(a)).filter(e=>e instanceof HTMLElement&&e.offsetParent!==null);if(!n.contains(document.activeElement)){let e=o()[0];e?e.focus():n.focus()}let s=e=>{if(e.key!==`Tab`)return;let t=o();if(t.length===0){e.preventDefault(),n.focus();return}let r=t[0],i=t[t.length-1],a=document.activeElement;e.shiftKey?(a===r||!n.contains(a))&&(e.preventDefault(),i.focus()):(a===i||!n.contains(a))&&(e.preventDefault(),r.focus())};return n.addEventListener(`keydown`,s),()=>{if(n.removeEventListener(`keydown`,s),i instanceof HTMLElement)try{i.focus()}catch{}}},[e,t])}export{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.