PageSourceSearch

https://terabitit.com/assets/PDFModalLight-hhkQJJT-.js

js terabitit.com collected 2026-10-09 01:41:11 UTC 3,299 bytes, 1 lines download raw bytes

1import{j as e}from"./index-BHKWHNqP.js";import{b as r,f as x}from"./vendor-react-DTF1y61S.js";import"./vendor-icons-Bx5hBfGb.js";function b({isOpen:s,onClose:o,pdfPath:n}){const i=r.useRef(null),u=r.useRef(null),[m,d]=r.useState(!0),[c,a]=r.useState(null);return r.useEffect(()=>{const t=u.current;if(!t||!s)return;const l=f=>{f.preventDefault(),t.scrollTop+=f.deltaY*.35};return t.addEventListener("wheel",l,{passive:!1}),()=>t.removeEventListener("wheel",l)},[s,m]),r.useEffect(()=>{if(s){const t=window.scrollY,l=document.documentElement;return l.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.body.style.overflow="hidden",()=>{l.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",window.scrollTo(0,t)}}},[s]),r.useEffect(()=>{if(!s)return;const t=l=>{i.current&&!i.current.contains(l.target)&&o()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[s,o]),r.useEffect(()=>{if(!s)return;const t=l=>{l.key==="Escape"&&o()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[s,o]),r.useEffect(()=>{s&&(n?(d(!0),a(null)):(d(!1),a("Image not available")))},[s,n]),s?x.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50",onClick:o}),e.jsxs("div",{ref:i,className:"bg-white rounded-2xl z-10 w-[95vw] sm:w-[90vw] md:w-[85vw] lg:w-[800px] xl:w-[900px] h-[90vh] sm:h-[85vh] md:h-[80vh] lg:h-[85vh] overflow-hidden relative mx-4 flex flex-col",children:[e.jsx("div",{className:"flex justify-end px-3 pt-3 pb-1 shrink-0",children:e.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center bg-gray-100 hover:bg-gray-200 rounded-full transition-colors",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),m&&!c&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 bg-white rounded-2xl",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-t-4 border-blue-500 border-solid"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Loading image..."})]})}),c&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 bg-white rounded-2xl",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-center p-4",children:[e.jsx("p",{className:"text-red-500",children:c}),e.jsx("button",{onClick:o,className:"px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",children:"Close"})]})}),e.jsx("div",{ref:u,className:"flex-1 min-h-0 overflow-y-auto px-2 sm:px-4 pb-4 mb-2",style:{scrollbarWidth:"thin"},children:n&&e.jsx("div",{className:"flex flex-col items-center",children:e.jsx("img",{src:n,alt:"Content",className:"w-full max-w-[850px] h-auto shadow-lg rounded-lg",fetchpriority:"high",onLoad:()=>d(!1),onError:()=>{a("Failed to load image"),d(!1)}})})})]})]}),document.body):null}export{b as default};

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.