@page-speed/lightbox 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18069,7 +18069,7 @@ var require_pdf = __commonJS({
18069
18069
  }
18070
18070
  });
18071
18071
 
18072
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18072
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18073
18073
  var dist_exports = {};
18074
18074
  __export(dist_exports, {
18075
18075
  PDFCanvas: () => PDFCanvas,
@@ -18083,10 +18083,8 @@ __export(dist_exports, {
18083
18083
  extractPageText: () => extractPageText,
18084
18084
  formatFileSize: () => formatFileSize,
18085
18085
  getOptimalRangeHeader: () => getOptimalRangeHeader,
18086
- injectPDFViewerStyles: () => injectPDFViewerStyles,
18087
18086
  isLinearizedPDF: () => isLinearizedPDF,
18088
18087
  linearizedPDFConfig: () => linearizedPDFConfig,
18089
- pdfViewerStyles: () => pdfViewerStyles,
18090
18088
  usePDFDocument: () => usePDFDocument,
18091
18089
  usePageRenderer: () => usePageRenderer,
18092
18090
  usePageState: () => usePageState,
@@ -18339,19 +18337,8 @@ function useSearch(pdfDoc) {
18339
18337
  prevResult
18340
18338
  };
18341
18339
  }
18342
- function injectPDFViewerStyles() {
18343
- if (typeof document === "undefined") return;
18344
- if (stylesInjected) return;
18345
- const styleId = "page-speed-pdf-viewer-styles";
18346
- if (document.getElementById(styleId)) {
18347
- stylesInjected = true;
18348
- return;
18349
- }
18350
- const styleElement = document.createElement("style");
18351
- styleElement.id = styleId;
18352
- styleElement.textContent = PDF_VIEWER_STYLES;
18353
- document.head.appendChild(styleElement);
18354
- stylesInjected = true;
18340
+ function cn2(...classes) {
18341
+ return classes.filter(Boolean).join(" ");
18355
18342
  }
18356
18343
  function PDFCanvas({
18357
18344
  pdfDoc,
@@ -18376,7 +18363,18 @@ function PDFCanvas({
18376
18363
  render();
18377
18364
  }
18378
18365
  }, [pdfDoc, pageNumber, scale, onRender]);
18379
- return /* @__PURE__ */ jsx4("div", { ref: containerRef, className: pdfViewerStyles.canvas });
18366
+ return /* @__PURE__ */ jsx4(
18367
+ "div",
18368
+ {
18369
+ ref: containerRef,
18370
+ className: cn2(
18371
+ "flex-1 overflow-auto",
18372
+ "flex items-center justify-center",
18373
+ "p-4 min-h-0"
18374
+ ),
18375
+ "data-pdf-viewer": "canvas"
18376
+ }
18377
+ );
18380
18378
  }
18381
18379
  async function isLinearizedPDF(url) {
18382
18380
  try {
@@ -18450,101 +18448,151 @@ function PDFControls({
18450
18448
  url
18451
18449
  }) {
18452
18450
  if (!pdfDocument) return null;
18453
- return /* @__PURE__ */ jsxs("div", { className: pdfViewerStyles.controls, children: [
18454
- /* @__PURE__ */ jsx22(
18455
- "button",
18456
- {
18457
- onClick: pageState.prevPage,
18458
- disabled: !pageState.canPrev,
18459
- title: "Previous page",
18460
- children: "<"
18461
- }
18462
- ),
18463
- /* @__PURE__ */ jsx22(
18464
- "input",
18465
- {
18466
- type: "number",
18467
- min: "1",
18468
- max: pdfDocument.numPages,
18469
- value: pageState.currentPage,
18470
- onChange: (e) => pageState.goToPage(parseInt(e.target.value, 10) || 1),
18471
- className: pdfViewerStyles.pageInput
18472
- }
18473
- ),
18474
- /* @__PURE__ */ jsxs("span", { className: pdfViewerStyles.pageTotal, children: [
18475
- "of ",
18476
- pdfDocument.numPages
18477
- ] }),
18478
- /* @__PURE__ */ jsx22(
18479
- "button",
18480
- {
18481
- onClick: pageState.nextPage,
18482
- disabled: !pageState.canNext,
18483
- title: "Next page",
18484
- children: ">"
18485
- }
18486
- ),
18487
- /* @__PURE__ */ jsx22(
18488
- "button",
18489
- {
18490
- onClick: zoom.zoomOut,
18491
- disabled: !zoom.canZoomOut,
18492
- title: "Zoom out",
18493
- children: "-"
18494
- }
18495
- ),
18496
- /* @__PURE__ */ jsxs("span", { className: pdfViewerStyles.zoomLevel, children: [
18497
- Math.round(zoom.zoomLevel * 100),
18498
- "%"
18499
- ] }),
18500
- /* @__PURE__ */ jsx22(
18501
- "button",
18502
- {
18503
- onClick: zoom.zoomIn,
18504
- disabled: !zoom.canZoomIn,
18505
- title: "Zoom in",
18506
- children: "+"
18507
- }
18508
- ),
18509
- /* @__PURE__ */ jsx22(
18510
- "input",
18511
- {
18512
- type: "text",
18513
- placeholder: "Search...",
18514
- value: search.query,
18515
- onChange: (e) => search.search(e.target.value),
18516
- className: pdfViewerStyles.searchInput
18517
- }
18518
- ),
18519
- search.results.length > 0 && /* @__PURE__ */ jsxs("span", { className: pdfViewerStyles.searchResults, children: [
18520
- search.results.length,
18521
- " results"
18522
- ] }),
18523
- enableDownload && /* @__PURE__ */ jsx22(
18524
- "button",
18525
- {
18526
- onClick: () => downloadPDF(url),
18527
- className: pdfViewerStyles.button,
18528
- title: "Download",
18529
- children: "Download"
18530
- }
18531
- ),
18532
- enablePrint && /* @__PURE__ */ jsx22("button", { onClick: () => window.print(), title: "Print", children: "Print" }),
18533
- enableFullscreen && typeof document !== "undefined" && /* @__PURE__ */ jsx22(
18534
- "button",
18535
- {
18536
- onClick: () => {
18537
- if (document.fullscreenElement) {
18538
- document.exitFullscreen();
18539
- } else {
18540
- document.documentElement?.requestFullscreen();
18541
- }
18542
- },
18543
- title: "Fullscreen",
18544
- children: "Fullscreen"
18545
- }
18546
- )
18547
- ] });
18451
+ return /* @__PURE__ */ jsxs(
18452
+ "div",
18453
+ {
18454
+ className: cn2(
18455
+ "flex items-center gap-2",
18456
+ "px-3 py-2",
18457
+ "bg-background border-b border-border",
18458
+ "overflow-x-auto flex-wrap",
18459
+ "flex-shrink-0 z-10"
18460
+ ),
18461
+ "data-pdf-viewer": "controls",
18462
+ children: [
18463
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
18464
+ /* @__PURE__ */ jsx22(
18465
+ IconButton,
18466
+ {
18467
+ onClick: pageState.prevPage,
18468
+ disabled: !pageState.canPrev,
18469
+ title: "Previous page",
18470
+ children: /* @__PURE__ */ jsx22(ChevronLeftIcon, {})
18471
+ }
18472
+ ),
18473
+ /* @__PURE__ */ jsx22(
18474
+ "input",
18475
+ {
18476
+ type: "number",
18477
+ min: "1",
18478
+ max: pdfDocument.numPages,
18479
+ value: pageState.currentPage,
18480
+ onChange: (e) => pageState.goToPage(parseInt(e.target.value, 10) || 1),
18481
+ className: cn2(
18482
+ "w-14 h-8 px-2",
18483
+ "text-center text-sm font-medium",
18484
+ "bg-background border border-input rounded-md",
18485
+ "focus:outline-none focus:ring-2 focus:ring-ring"
18486
+ )
18487
+ }
18488
+ ),
18489
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground whitespace-nowrap", children: [
18490
+ "of ",
18491
+ pdfDocument.numPages
18492
+ ] }),
18493
+ /* @__PURE__ */ jsx22(
18494
+ IconButton,
18495
+ {
18496
+ onClick: pageState.nextPage,
18497
+ disabled: !pageState.canNext,
18498
+ title: "Next page",
18499
+ children: /* @__PURE__ */ jsx22(ChevronRightIcon, {})
18500
+ }
18501
+ )
18502
+ ] }),
18503
+ /* @__PURE__ */ jsx22("div", { className: "w-px h-6 bg-border mx-1" }),
18504
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
18505
+ /* @__PURE__ */ jsx22(
18506
+ IconButton,
18507
+ {
18508
+ onClick: zoom.zoomOut,
18509
+ disabled: !zoom.canZoomOut,
18510
+ title: "Zoom out",
18511
+ children: /* @__PURE__ */ jsx22(MinusIcon, {})
18512
+ }
18513
+ ),
18514
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-foreground min-w-[3.5rem] text-center", children: [
18515
+ Math.round(zoom.zoomLevel * 100),
18516
+ "%"
18517
+ ] }),
18518
+ /* @__PURE__ */ jsx22(
18519
+ IconButton,
18520
+ {
18521
+ onClick: zoom.zoomIn,
18522
+ disabled: !zoom.canZoomIn,
18523
+ title: "Zoom in",
18524
+ children: /* @__PURE__ */ jsx22(PlusIcon, {})
18525
+ }
18526
+ )
18527
+ ] }),
18528
+ /* @__PURE__ */ jsx22("div", { className: "w-px h-6 bg-border mx-1" }),
18529
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
18530
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
18531
+ /* @__PURE__ */ jsx22(
18532
+ "input",
18533
+ {
18534
+ type: "text",
18535
+ placeholder: "Search...",
18536
+ value: search.query,
18537
+ onChange: (e) => search.search(e.target.value),
18538
+ className: cn2(
18539
+ "h-8 pl-8 pr-3 w-32",
18540
+ "text-sm",
18541
+ "bg-background border border-input rounded-md",
18542
+ "placeholder:text-muted-foreground",
18543
+ "focus:outline-none focus:ring-2 focus:ring-ring"
18544
+ )
18545
+ }
18546
+ ),
18547
+ /* @__PURE__ */ jsx22("div", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx22(SearchIcon, {}) })
18548
+ ] }),
18549
+ search.results.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
18550
+ search.results.length,
18551
+ " results"
18552
+ ] })
18553
+ ] }),
18554
+ /* @__PURE__ */ jsx22("div", { className: "flex-1" }),
18555
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
18556
+ enableDownload && /* @__PURE__ */ jsxs(
18557
+ ActionButton,
18558
+ {
18559
+ onClick: () => downloadPDF(url),
18560
+ title: "Download",
18561
+ children: [
18562
+ /* @__PURE__ */ jsx22(DownloadIcon, {}),
18563
+ /* @__PURE__ */ jsx22("span", { children: "Download" })
18564
+ ]
18565
+ }
18566
+ ),
18567
+ enablePrint && /* @__PURE__ */ jsxs(
18568
+ ActionButton,
18569
+ {
18570
+ onClick: () => window.print(),
18571
+ title: "Print",
18572
+ children: [
18573
+ /* @__PURE__ */ jsx22(PrintIcon, {}),
18574
+ /* @__PURE__ */ jsx22("span", { children: "Print" })
18575
+ ]
18576
+ }
18577
+ ),
18578
+ enableFullscreen && typeof document !== "undefined" && /* @__PURE__ */ jsx22(
18579
+ IconButton,
18580
+ {
18581
+ onClick: () => {
18582
+ if (document.fullscreenElement) {
18583
+ document.exitFullscreen();
18584
+ } else {
18585
+ document.documentElement?.requestFullscreen();
18586
+ }
18587
+ },
18588
+ title: "Fullscreen",
18589
+ children: /* @__PURE__ */ jsx22(FullscreenIcon, {})
18590
+ }
18591
+ )
18592
+ ] })
18593
+ ]
18594
+ }
18595
+ );
18548
18596
  }
18549
18597
  function PDFThumbnails({
18550
18598
  pdfDoc,
@@ -18582,32 +18630,55 @@ function PDFThumbnails({
18582
18630
  };
18583
18631
  generateThumbnails();
18584
18632
  }, [pdfDoc, numPages]);
18585
- return /* @__PURE__ */ jsx32("div", { className: pdfViewerStyles.thumbnails, children: thumbnails.map((thumb, idx) => /* @__PURE__ */ jsxs2(
18633
+ return /* @__PURE__ */ jsx32(
18586
18634
  "div",
18587
18635
  {
18588
- className: `${pdfViewerStyles.thumbnail} ${idx + 1 === currentPage ? pdfViewerStyles.active : ""}`,
18589
- onClick: () => onSelectPage(idx + 1),
18590
- children: [
18591
- /* @__PURE__ */ jsx32(
18592
- "canvas",
18593
- {
18594
- width: thumb.width,
18595
- height: thumb.height,
18596
- ref: (el) => {
18597
- if (el && thumb) {
18598
- const ctx = el.getContext("2d");
18599
- if (ctx) {
18600
- ctx.drawImage(thumb, 0, 0);
18601
- }
18602
- }
18603
- }
18604
- }
18605
- ),
18606
- /* @__PURE__ */ jsx32("span", { className: pdfViewerStyles.pageNumber, children: idx + 1 })
18607
- ]
18608
- },
18609
- idx
18610
- )) });
18636
+ className: cn2(
18637
+ "w-32 flex-shrink-0",
18638
+ "overflow-y-auto",
18639
+ "bg-muted/50 border-r border-border",
18640
+ "p-2 space-y-2"
18641
+ ),
18642
+ "data-pdf-viewer": "thumbnails",
18643
+ children: thumbnails.map((thumb, idx) => /* @__PURE__ */ jsxs2(
18644
+ "div",
18645
+ {
18646
+ className: cn2(
18647
+ "cursor-pointer rounded-md overflow-hidden",
18648
+ "border-2 transition-colors duration-150",
18649
+ idx + 1 === currentPage ? "border-primary ring-2 ring-primary/20" : "border-transparent hover:border-muted-foreground/30"
18650
+ ),
18651
+ onClick: () => onSelectPage(idx + 1),
18652
+ "data-pdf-viewer": "thumbnail",
18653
+ "data-active": idx + 1 === currentPage,
18654
+ children: [
18655
+ /* @__PURE__ */ jsx32(
18656
+ "canvas",
18657
+ {
18658
+ width: thumb.width,
18659
+ height: thumb.height,
18660
+ ref: (el) => {
18661
+ if (el && thumb) {
18662
+ const ctx = el.getContext("2d");
18663
+ if (ctx) {
18664
+ ctx.drawImage(thumb, 0, 0);
18665
+ }
18666
+ }
18667
+ },
18668
+ className: "w-full h-auto"
18669
+ }
18670
+ ),
18671
+ /* @__PURE__ */ jsx32("span", { className: cn2(
18672
+ "block text-center text-xs py-1",
18673
+ "text-muted-foreground",
18674
+ idx + 1 === currentPage && "text-primary font-medium"
18675
+ ), children: idx + 1 })
18676
+ ]
18677
+ },
18678
+ idx
18679
+ ))
18680
+ }
18681
+ );
18611
18682
  }
18612
18683
  function PDFViewer({
18613
18684
  url,
@@ -18633,9 +18704,6 @@ function PDFViewer({
18633
18704
  initialZoom = "auto",
18634
18705
  withCredentials = false
18635
18706
  } = config;
18636
- useEffect42(() => {
18637
- injectPDFViewerStyles();
18638
- }, []);
18639
18707
  const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
18640
18708
  const pageState = usePageState({
18641
18709
  totalPages: document2?.numPages || 0,
@@ -18658,19 +18726,48 @@ function PDFViewer({
18658
18726
  }
18659
18727
  }, [search.results, onSearchResults]);
18660
18728
  if (error) {
18661
- return /* @__PURE__ */ jsx42("div", { className: pdfViewerStyles.error, style: { height, width }, children: /* @__PURE__ */ jsxs3("p", { children: [
18662
- "Failed to load PDF: ",
18663
- error.message
18664
- ] }) });
18729
+ return /* @__PURE__ */ jsx42(
18730
+ "div",
18731
+ {
18732
+ className: cn2(
18733
+ "flex items-center justify-center",
18734
+ "bg-background rounded-lg",
18735
+ className
18736
+ ),
18737
+ style: { height, width },
18738
+ children: /* @__PURE__ */ jsxs3("p", { className: "text-destructive text-base", children: [
18739
+ "Failed to load PDF: ",
18740
+ error.message
18741
+ ] })
18742
+ }
18743
+ );
18665
18744
  }
18666
18745
  if (loading) {
18667
- return /* @__PURE__ */ jsx42("div", { className: pdfViewerStyles.loading, style: { height, width }, children: /* @__PURE__ */ jsx42("p", { children: "Loading PDF..." }) });
18746
+ return /* @__PURE__ */ jsx42(
18747
+ "div",
18748
+ {
18749
+ className: cn2(
18750
+ "flex items-center justify-center",
18751
+ "bg-background rounded-lg",
18752
+ className
18753
+ ),
18754
+ style: { height, width },
18755
+ children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-base", children: "Loading PDF..." })
18756
+ }
18757
+ );
18668
18758
  }
18669
18759
  return /* @__PURE__ */ jsxs3(
18670
18760
  "div",
18671
18761
  {
18672
- className: `${pdfViewerStyles.viewer} ${className || ""}`,
18762
+ className: cn2(
18763
+ "flex flex-col",
18764
+ "bg-muted/30 rounded-lg overflow-hidden",
18765
+ "shadow-sm border border-border",
18766
+ "font-sans",
18767
+ className
18768
+ ),
18673
18769
  style: { height, width, ...style },
18770
+ "data-pdf-viewer": "root",
18674
18771
  children: [
18675
18772
  showControls && /* @__PURE__ */ jsx42(
18676
18773
  PDFControls,
@@ -18685,7 +18782,7 @@ function PDFViewer({
18685
18782
  url
18686
18783
  }
18687
18784
  ),
18688
- /* @__PURE__ */ jsxs3("div", { className: pdfViewerStyles.content, children: [
18785
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-1 overflow-hidden min-h-0", "data-pdf-viewer": "content", children: [
18689
18786
  showThumbnails && document2 && /* @__PURE__ */ jsx42(
18690
18787
  PDFThumbnails,
18691
18788
  {
@@ -18733,82 +18830,80 @@ function createProgressiveFetchHandler(onProgress) {
18733
18830
  return response.arrayBuffer();
18734
18831
  };
18735
18832
  }
18736
- var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDF_VIEWER_STYLES, stylesInjected, pdfViewerStyles, linearizedPDFConfig;
18833
+ var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, ChevronLeftIcon, ChevronRightIcon, MinusIcon, PlusIcon, DownloadIcon, PrintIcon, FullscreenIcon, SearchIcon, IconButton, ActionButton, linearizedPDFConfig;
18737
18834
  var init_dist = __esm({
18738
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18835
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18739
18836
  "use client";
18740
18837
  DEFAULT_SCALE = 1.5;
18741
18838
  CACHE_SIZE = 50 * 1024 * 1024;
18742
18839
  MIN_ZOOM = 0.5;
18743
18840
  MAX_ZOOM = 3;
18744
18841
  ZOOM_STEP = 0.25;
18745
- PDF_VIEWER_STYLES = `
18746
- /* Core viewer layout */
18747
- .PDFViewer_viewer { display: flex; flex-direction: column; background: #f5f5f5; font-family: system-ui, -apple-system, sans-serif; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); height: 100%; width: 100%; }
18748
-
18749
- /* Controls */
18750
- .PDFViewer_controls { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e0e0e0; overflow-x: auto; flex-wrap: wrap; flex-shrink: 0; z-index: 10; position: relative; }
18751
- .PDFViewer_controls button { padding: 8px 14px; background: #007bff; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background 150ms, box-shadow 150ms; white-space: nowrap; }
18752
- .PDFViewer_controls button:hover:not(:disabled) { background: #0056b3; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
18753
- .PDFViewer_controls button:disabled { opacity: 0.5; cursor: not-allowed; background: #6c757d; }
18754
-
18755
- .PDFViewer_pageInput { width: 60px; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; text-align: center; font-weight: 500; }
18756
- .PDFViewer_pageInput:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.1); }
18757
- .PDFViewer_pageTotal { font-size: 14px; color: #666; font-weight: 500; white-space: nowrap; }
18758
- .PDFViewer_zoomLevel { font-size: 14px; color: #333; min-width: 60px; text-align: center; font-weight: 600; }
18759
-
18760
- .PDFViewer_searchInput { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
18761
- .PDFViewer_searchResults { font-size: 12px; color: #666; }
18762
-
18763
- .PDFViewer_button { padding: 6px 12px; background: #28a745; color: #fff; border: none; border-radius: 4px; text-decoration: none; cursor: pointer; transition: background 150ms; font-size: 14px; font-weight: 500; }
18764
- .PDFViewer_button:hover { background: #218838; }
18765
-
18766
- /* Main content */
18767
- .PDFViewer_content { display: flex; flex: 1; overflow: hidden; min-height: 0; }
18768
- .PDFViewer_canvas { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: #fff; padding: 20px; }
18769
- .PDFViewer_canvas canvas { max-width: 100%; height: auto !important; box-shadow: 0 2px 8px rgba(0,0,0,0.15); display: block; }
18770
-
18771
- /* Thumbnails */
18772
- .PDFViewer_thumbnails { width: 120px; overflow-y: auto; background: #fff; border-right: 1px solid #e0e0e0; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
18773
- .PDFViewer_thumbnail { position: relative; cursor: pointer; border: 2px solid transparent; border-radius: 4px; overflow: hidden; transition: border-color 150ms, box-shadow 150ms; }
18774
- .PDFViewer_thumbnail:hover { border-color: #007bff; box-shadow: 0 2px 4px rgba(0,123,255,0.2); }
18775
- .PDFViewer_thumbnail.PDFViewer_active { border-color: #007bff; box-shadow: 0 2px 8px rgba(0,123,255,0.4); }
18776
- .PDFViewer_thumbnail canvas { width: 100%; height: auto; display: block; }
18777
- .PDFViewer_pageNumber { position: absolute; bottom: 4px; right: 4px; font-size: 11px; background: rgba(0,0,0,0.7); color: #fff; padding: 2px 4px; border-radius: 2px; }
18778
-
18779
- /* Loading & error */
18780
- .PDFViewer_loading, .PDFViewer_error { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; }
18781
- .PDFViewer_loading p, .PDFViewer_error p { font-size: 16px; color: #666; }
18782
- .PDFViewer_error p { color: #dc3545; }
18783
-
18784
- /* Responsive tweaks */
18785
- @media (max-width: 768px) {
18786
- .PDFViewer_controls { gap: 6px; padding: 8px 12px; }
18787
- .PDFViewer_controls button { padding: 4px 8px; font-size: 12px; }
18788
- .PDFViewer_pageInput { width: 50px; }
18789
- .PDFViewer_thumbnails { width: 80px; }
18790
- .PDFViewer_searchInput { padding: 4px 8px; font-size: 12px; }
18791
- }
18792
- `;
18793
- stylesInjected = false;
18794
- pdfViewerStyles = {
18795
- viewer: "PDFViewer_viewer",
18796
- controls: "PDFViewer_controls",
18797
- pageInput: "PDFViewer_pageInput",
18798
- pageTotal: "PDFViewer_pageTotal",
18799
- zoomLevel: "PDFViewer_zoomLevel",
18800
- searchInput: "PDFViewer_searchInput",
18801
- searchResults: "PDFViewer_searchResults",
18802
- button: "PDFViewer_button",
18803
- content: "PDFViewer_content",
18804
- canvas: "PDFViewer_canvas",
18805
- thumbnails: "PDFViewer_thumbnails",
18806
- thumbnail: "PDFViewer_thumbnail",
18807
- active: "PDFViewer_active",
18808
- pageNumber: "PDFViewer_pageNumber",
18809
- loading: "PDFViewer_loading",
18810
- error: "PDFViewer_error"
18811
- };
18842
+ ChevronLeftIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M15 18l-6-6 6-6" }) });
18843
+ ChevronRightIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M9 18l6-6-6-6" }) });
18844
+ MinusIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M5 12h14" }) });
18845
+ PlusIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M12 5v14M5 12h14" }) });
18846
+ DownloadIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }) });
18847
+ PrintIcon = () => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
18848
+ /* @__PURE__ */ jsx22("polyline", { points: "6 9 6 2 18 2 18 9" }),
18849
+ /* @__PURE__ */ jsx22("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
18850
+ /* @__PURE__ */ jsx22("rect", { x: "6", y: "14", width: "12", height: "8" })
18851
+ ] });
18852
+ FullscreenIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) });
18853
+ SearchIcon = () => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
18854
+ /* @__PURE__ */ jsx22("circle", { cx: "11", cy: "11", r: "8" }),
18855
+ /* @__PURE__ */ jsx22("path", { d: "M21 21l-4.35-4.35" })
18856
+ ] });
18857
+ IconButton = ({
18858
+ onClick,
18859
+ disabled,
18860
+ title,
18861
+ children,
18862
+ className
18863
+ }) => /* @__PURE__ */ jsx22(
18864
+ "button",
18865
+ {
18866
+ type: "button",
18867
+ onClick,
18868
+ disabled,
18869
+ title,
18870
+ className: cn2(
18871
+ "inline-flex items-center justify-center",
18872
+ "h-8 w-8 rounded-md",
18873
+ "bg-secondary text-secondary-foreground",
18874
+ "hover:bg-secondary/80",
18875
+ "transition-colors duration-150",
18876
+ "disabled:opacity-50 disabled:pointer-events-none",
18877
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18878
+ className
18879
+ ),
18880
+ children
18881
+ }
18882
+ );
18883
+ ActionButton = ({
18884
+ onClick,
18885
+ title,
18886
+ children,
18887
+ className
18888
+ }) => /* @__PURE__ */ jsx22(
18889
+ "button",
18890
+ {
18891
+ type: "button",
18892
+ onClick,
18893
+ title,
18894
+ className: cn2(
18895
+ "inline-flex items-center justify-center gap-1.5",
18896
+ "h-8 px-3 rounded-md",
18897
+ "bg-primary text-primary-foreground",
18898
+ "hover:bg-primary/90",
18899
+ "text-sm font-medium",
18900
+ "transition-colors duration-150",
18901
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18902
+ className
18903
+ ),
18904
+ children
18905
+ }
18906
+ );
18812
18907
  linearizedPDFConfig = {
18813
18908
  rangeChunkSize: 65536,
18814
18909
  // 64 KB chunks for streaming
@@ -22737,7 +22832,7 @@ var DEFAULT_CONTROLS = {
22737
22832
  function mergeControls(overrides) {
22738
22833
  return { ...DEFAULT_CONTROLS, ...overrides || {} };
22739
22834
  }
22740
- var IconButton = ({
22835
+ var IconButton2 = ({
22741
22836
  onClick,
22742
22837
  disabled,
22743
22838
  ariaLabel,
@@ -22766,8 +22861,8 @@ var IconButton = ({
22766
22861
  var ArrowLeftIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
22767
22862
  var ArrowRightIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M5 12h14M12 5l7 7-7 7" }) });
22768
22863
  var CloseIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M18 6L6 18M6 6l12 12" }) });
22769
- var FullscreenIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) });
22770
- var DownloadIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }) });
22864
+ var FullscreenIcon2 = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) });
22865
+ var DownloadIcon2 = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }) });
22771
22866
  var ShareIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M16 6l-4-4-4 4M12 2v13" }) });
22772
22867
  function LightboxChrome({
22773
22868
  currentIndex,
@@ -22905,23 +23000,23 @@ function LightboxChrome({
22905
23000
  className
22906
23001
  ), children: [
22907
23002
  resolved.navigation && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
22908
- /* @__PURE__ */ jsx8(IconButton, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
22909
- /* @__PURE__ */ jsx8(IconButton, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
23003
+ /* @__PURE__ */ jsx8(IconButton2, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
23004
+ /* @__PURE__ */ jsx8(IconButton2, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
22910
23005
  ] }),
22911
23006
  /* @__PURE__ */ jsx8("div", { className: "flex flex-col", children: resolved.captions && currentItem && /* @__PURE__ */ jsxs4(Fragment, { children: [
22912
23007
  currentItem.title && /* @__PURE__ */ jsx8("div", { className: "text-sm font-semibold", children: currentItem.title }),
22913
23008
  currentItem.caption && /* @__PURE__ */ jsx8("div", { className: "text-xs text-white/70", children: currentItem.caption })
22914
23009
  ] }) }),
22915
23010
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
22916
- resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
22917
- resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon, {}) }),
22918
- resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon, {}) }),
23011
+ resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
23012
+ resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon2, {}) }),
23013
+ resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon2, {}) }),
22919
23014
  resolved.counter && totalItems > 0 && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-white/70", children: [
22920
23015
  currentIndex + 1,
22921
23016
  " / ",
22922
23017
  totalItems
22923
23018
  ] }),
22924
- resolved.closeButton && /* @__PURE__ */ jsx8(IconButton, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
23019
+ resolved.closeButton && /* @__PURE__ */ jsx8(IconButton2, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
22925
23020
  ] })
22926
23021
  ] });
22927
23022
  }
@@ -22931,14 +23026,14 @@ function LightboxChrome({
22931
23026
  "flex items-center gap-2",
22932
23027
  className
22933
23028
  ), children: [
22934
- resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
22935
- resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon, {}) }),
22936
- resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon, {}) }),
22937
- resolved.closeButton && /* @__PURE__ */ jsx8(IconButton, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
23029
+ resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
23030
+ resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon2, {}) }),
23031
+ resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon2, {}) }),
23032
+ resolved.closeButton && /* @__PURE__ */ jsx8(IconButton2, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
22938
23033
  ] }),
22939
23034
  resolved.navigation && /* @__PURE__ */ jsxs4("div", { className: "fixed bottom-6 right-6 z-50 flex items-center gap-3", children: [
22940
- /* @__PURE__ */ jsx8(IconButton, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
22941
- /* @__PURE__ */ jsx8(IconButton, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
23035
+ /* @__PURE__ */ jsx8(IconButton2, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
23036
+ /* @__PURE__ */ jsx8(IconButton2, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
22942
23037
  ] }),
22943
23038
  resolved.captions && currentItem && (currentItem.title || currentItem.caption) && /* @__PURE__ */ jsxs4("div", { className: cn(
22944
23039
  "fixed bottom-6 left-6 z-50",