pxengine 0.1.142 → 0.1.143

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.
package/dist/index.mjs CHANGED
@@ -16436,6 +16436,25 @@ var EditIcon = () => /* @__PURE__ */ jsxs109("svg", { width: "14", height: "14",
16436
16436
  ] });
16437
16437
  var ChevronUpIcon = () => /* @__PURE__ */ jsx151("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx151("polyline", { points: "18 15 12 9 6 15" }) });
16438
16438
  var ChevronDownIcon = () => /* @__PURE__ */ jsx151("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx151("polyline", { points: "6 9 12 15 18 9" }) });
16439
+ var PptxIcon = () => /* @__PURE__ */ jsxs109("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
16440
+ /* @__PURE__ */ jsx151("rect", { x: "3", y: "4", width: "18", height: "13", rx: "2" }),
16441
+ /* @__PURE__ */ jsx151("path", { d: "M7 21h10M12 17v4" }),
16442
+ /* @__PURE__ */ jsx151("path", { d: "M8 13v-2M12 13V9M16 13v-3" })
16443
+ ] });
16444
+ var PdfIcon = () => /* @__PURE__ */ jsxs109("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
16445
+ /* @__PURE__ */ jsx151("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
16446
+ /* @__PURE__ */ jsx151("path", { d: "M14 3v5h5" }),
16447
+ /* @__PURE__ */ jsx151("path", { d: "M9 13h6M9 17h4" })
16448
+ ] });
16449
+ var HtmlIcon = () => /* @__PURE__ */ jsxs109("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
16450
+ /* @__PURE__ */ jsx151("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
16451
+ /* @__PURE__ */ jsx151("path", { d: "M3 9h18" }),
16452
+ /* @__PURE__ */ jsx151("path", { d: "M6.5 6.5h.01M9.5 6.5h.01" })
16453
+ ] });
16454
+ var Spinner2 = () => /* @__PURE__ */ jsxs109("svg", { className: "animate-spin", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
16455
+ /* @__PURE__ */ jsx151("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.25", strokeWidth: "3" }),
16456
+ /* @__PURE__ */ jsx151("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
16457
+ ] });
16439
16458
 
16440
16459
  // src/molecules/generic/PresentationJobCard/PresentationJobCard.tsx
16441
16460
  import { Fragment as Fragment5, jsx as jsx152, jsxs as jsxs110 } from "react/jsx-runtime";
@@ -16494,31 +16513,34 @@ var FORMATS = [
16494
16513
  key: "pptx_url",
16495
16514
  label: "PowerPoint",
16496
16515
  ext: ".pptx",
16497
- emoji: "\u{1F4CA}",
16516
+ Icon: PptxIcon,
16498
16517
  desc: "Editable slides \u2014 open in PowerPoint, Keynote, or Google Slides",
16499
- accent: { text: "text-orange-400", bg: "bg-orange-500/10 border-orange-500/20" }
16518
+ // Hue lives on the icon tile only; the row itself stays neutral so three
16519
+ // stacked formats don't read as three competing status colours.
16520
+ accent: { icon: "text-orange-300", tile: "bg-orange-500/10 ring-orange-500/20" }
16500
16521
  },
16501
16522
  {
16502
16523
  key: "pdf_url",
16503
16524
  label: "PDF",
16504
16525
  ext: ".pdf",
16505
- emoji: "\u{1F4C4}",
16526
+ Icon: PdfIcon,
16506
16527
  desc: "Print-ready, fixed layout \u2014 open in any PDF viewer",
16507
- accent: { text: "text-red-400", bg: "bg-red-500/10 border-red-500/20" }
16528
+ accent: { icon: "text-red-300", tile: "bg-red-500/10 ring-red-500/20" }
16508
16529
  },
16509
16530
  {
16510
16531
  key: "html_url",
16511
16532
  label: "HTML",
16512
16533
  ext: ".html",
16513
- emoji: "\u{1F310}",
16534
+ Icon: HtmlIcon,
16514
16535
  desc: "Interactive web presentation \u2014 download and open in browser",
16515
- accent: { text: "text-sky-400", bg: "bg-sky-500/10 border-sky-500/20" }
16536
+ accent: { icon: "text-sky-300", tile: "bg-sky-500/10 ring-sky-500/20" }
16516
16537
  }
16517
16538
  ];
16518
16539
  var ExportModal = ({ formats, title, onClose }) => {
16519
16540
  const available = FORMATS.filter((f) => (formats ?? {})[f.key]);
16520
16541
  const filename = (title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase();
16521
16542
  const [downloadingKey, setDownloadingKey] = useState11(null);
16543
+ const panelRef = useRef10(null);
16522
16544
  const handleDownload = async (fmtKey, url, ext) => {
16523
16545
  if (downloadingKey) return;
16524
16546
  const downloadName = `${filename}${ext}`;
@@ -16536,55 +16558,120 @@ var ExportModal = ({ formats, title, onClose }) => {
16536
16558
  anchor.click();
16537
16559
  anchor.remove();
16538
16560
  window.URL.revokeObjectURL(objectUrl);
16561
+ onClose();
16539
16562
  } catch {
16540
- window.open(href, "_blank", "noopener,noreferrer");
16563
+ const popup = window.open(href, "_blank", "noopener,noreferrer");
16564
+ if (popup) onClose();
16541
16565
  } finally {
16542
16566
  setDownloadingKey(null);
16543
16567
  }
16544
16568
  };
16569
+ useEffect9(() => {
16570
+ const onKey = (e) => {
16571
+ if (e.key === "Escape") onClose();
16572
+ };
16573
+ document.addEventListener("keydown", onKey);
16574
+ return () => document.removeEventListener("keydown", onKey);
16575
+ }, [onClose]);
16576
+ useEffect9(() => {
16577
+ document.body.style.overflow = "hidden";
16578
+ panelRef.current?.focus();
16579
+ return () => {
16580
+ document.body.style.overflow = "";
16581
+ };
16582
+ }, []);
16545
16583
  return createPortal(
16546
- /* @__PURE__ */ jsxs110("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
16547
- /* @__PURE__ */ jsx152("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
16548
- /* @__PURE__ */ jsxs110("div", { className: "relative z-10 bg-zinc-900 border border-zinc-800 rounded-2xl w-full max-w-sm p-6 shadow-2xl", children: [
16549
- /* @__PURE__ */ jsxs110("div", { className: "flex items-start justify-between mb-5", children: [
16550
- /* @__PURE__ */ jsxs110("div", { className: "min-w-0 pr-3", children: [
16551
- /* @__PURE__ */ jsx152("h3", { className: "text-sm font-semibold text-zinc-100", children: "Export Presentation" }),
16552
- /* @__PURE__ */ jsx152("p", { className: "text-xs text-zinc-500 mt-0.5 truncate", children: title })
16553
- ] }),
16554
- /* @__PURE__ */ jsx152("button", { onClick: onClose, className: "text-zinc-500 hover:text-zinc-200 transition-colors flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx152(CloseIcon, {}) })
16555
- ] }),
16556
- /* @__PURE__ */ jsxs110("div", { className: "space-y-2.5", children: [
16557
- available.length === 0 && /* @__PURE__ */ jsx152("p", { className: "text-sm text-zinc-500 text-center py-6", children: "No formats available yet" }),
16558
- available.map((fmt) => {
16559
- const url = formats[fmt.key];
16560
- const isDownloading = downloadingKey === fmt.key;
16561
- return /* @__PURE__ */ jsxs110(
16562
- "button",
16563
- {
16564
- type: "button",
16565
- disabled: Boolean(downloadingKey),
16566
- onClick: () => handleDownload(fmt.key, url, fmt.ext),
16567
- className: cn(
16568
- "flex w-full items-center gap-3.5 p-3.5 rounded-xl border transition-all text-left",
16569
- "hover:brightness-110 disabled:opacity-60 disabled:cursor-not-allowed",
16570
- fmt.accent.bg
16571
- ),
16572
- children: [
16573
- /* @__PURE__ */ jsx152("span", { className: "text-xl flex-shrink-0", children: fmt.emoji }),
16574
- /* @__PURE__ */ jsxs110("div", { className: "flex-1 min-w-0", children: [
16575
- /* @__PURE__ */ jsx152("p", { className: cn("text-sm font-semibold", fmt.accent.text), children: isDownloading ? `Downloading ${fmt.label}...` : fmt.label }),
16576
- /* @__PURE__ */ jsx152("p", { className: "text-xs text-zinc-500 mt-0.5 leading-relaxed", children: isDownloading ? "Please wait while the file is being prepared." : fmt.desc })
16584
+ /* @__PURE__ */ jsxs110(
16585
+ "div",
16586
+ {
16587
+ className: "fixed inset-0 z-[100] flex items-center justify-center p-4",
16588
+ role: "dialog",
16589
+ "aria-modal": "true",
16590
+ "aria-labelledby": "pxe-export-title",
16591
+ children: [
16592
+ /* @__PURE__ */ jsx152("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
16593
+ /* @__PURE__ */ jsxs110(
16594
+ "div",
16595
+ {
16596
+ ref: panelRef,
16597
+ tabIndex: -1,
16598
+ className: "relative z-10 w-full max-w-md overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900 shadow-2xl outline-none",
16599
+ children: [
16600
+ /* @__PURE__ */ jsxs110("div", { className: "flex items-start gap-3 border-b border-zinc-800/80 px-5 py-4", children: [
16601
+ /* @__PURE__ */ jsx152("span", { className: "mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg bg-[#C0AE82]/10 text-[#DCC99B] ring-1 ring-[#C0AE82]/20", children: /* @__PURE__ */ jsx152(SlidesIcon, {}) }),
16602
+ /* @__PURE__ */ jsxs110("div", { className: "min-w-0 flex-1", children: [
16603
+ /* @__PURE__ */ jsx152("h3", { id: "pxe-export-title", className: "text-sm font-semibold text-zinc-100", children: "Export presentation" }),
16604
+ /* @__PURE__ */ jsx152("p", { className: "mt-0.5 truncate text-xs text-zinc-500", children: title })
16577
16605
  ] }),
16578
- /* @__PURE__ */ jsx152("span", { className: cn("flex-shrink-0", fmt.accent.text), children: /* @__PURE__ */ jsx152(DownloadIcon, {}) })
16579
- ]
16580
- },
16581
- fmt.key
16582
- );
16583
- })
16584
- ] }),
16585
- /* @__PURE__ */ jsx152("p", { className: "text-xs text-zinc-600 mt-4 text-center", children: "Download links expire in 90 days" })
16586
- ] })
16587
- ] }),
16606
+ /* @__PURE__ */ jsx152(
16607
+ "button",
16608
+ {
16609
+ onClick: onClose,
16610
+ "aria-label": "Close export dialog",
16611
+ className: "-mr-1 mt-0.5 flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg text-zinc-500 transition-colors hover:bg-zinc-800 hover:text-zinc-200",
16612
+ children: /* @__PURE__ */ jsx152(CloseIcon, {})
16613
+ }
16614
+ )
16615
+ ] }),
16616
+ /* @__PURE__ */ jsx152("div", { className: "space-y-2 p-4", children: available.length === 0 ? /* @__PURE__ */ jsxs110("div", { className: "py-8 text-center", children: [
16617
+ /* @__PURE__ */ jsx152("p", { className: "text-sm text-zinc-400", children: "No formats available yet" }),
16618
+ /* @__PURE__ */ jsx152("p", { className: "mt-1 text-xs text-zinc-600", children: "Exports appear here once the deck finishes generating." })
16619
+ ] }) : available.map((fmt) => {
16620
+ const url = formats[fmt.key];
16621
+ const isDownloading = downloadingKey === fmt.key;
16622
+ return /* @__PURE__ */ jsxs110(
16623
+ "button",
16624
+ {
16625
+ type: "button",
16626
+ disabled: Boolean(downloadingKey),
16627
+ onClick: () => handleDownload(fmt.key, url, fmt.ext),
16628
+ className: cn(
16629
+ "group flex w-full items-center gap-3 rounded-xl border border-zinc-800 bg-zinc-800/40 p-3 text-left transition-all",
16630
+ "hover:border-[#C0AE82]/40 hover:bg-zinc-800/70",
16631
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-[#C0AE82]/50",
16632
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-zinc-800 disabled:hover:bg-zinc-800/40"
16633
+ ),
16634
+ children: [
16635
+ /* @__PURE__ */ jsx152(
16636
+ "span",
16637
+ {
16638
+ className: cn(
16639
+ "flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg ring-1",
16640
+ fmt.accent.tile,
16641
+ fmt.accent.icon
16642
+ ),
16643
+ children: /* @__PURE__ */ jsx152(fmt.Icon, {})
16644
+ }
16645
+ ),
16646
+ /* @__PURE__ */ jsxs110("div", { className: "min-w-0 flex-1", children: [
16647
+ /* @__PURE__ */ jsxs110("div", { className: "flex items-center gap-2", children: [
16648
+ /* @__PURE__ */ jsx152("p", { className: "text-sm font-semibold text-zinc-100", children: fmt.label }),
16649
+ /* @__PURE__ */ jsx152("span", { className: "rounded bg-zinc-800 px-1.5 py-0.5 font-mono text-[10px] text-zinc-500 ring-1 ring-zinc-700/60", children: fmt.ext })
16650
+ ] }),
16651
+ /* @__PURE__ */ jsx152("p", { className: "mt-0.5 text-xs leading-relaxed text-zinc-500", children: isDownloading ? "Preparing your file\u2026" : fmt.desc })
16652
+ ] }),
16653
+ /* @__PURE__ */ jsx152(
16654
+ "span",
16655
+ {
16656
+ className: cn(
16657
+ "flex-shrink-0 transition-colors",
16658
+ isDownloading ? "text-[#DCC99B]" : "text-zinc-600 group-hover:text-[#DCC99B]"
16659
+ ),
16660
+ children: isDownloading ? /* @__PURE__ */ jsx152(Spinner2, {}) : /* @__PURE__ */ jsx152(DownloadIcon, {})
16661
+ }
16662
+ )
16663
+ ]
16664
+ },
16665
+ fmt.key
16666
+ );
16667
+ }) }),
16668
+ available.length > 0 && /* @__PURE__ */ jsx152("div", { className: "border-t border-zinc-800/80 px-5 py-3", children: /* @__PURE__ */ jsx152("p", { className: "text-center text-[11px] text-zinc-600", children: "Download links expire in 90 days" }) })
16669
+ ]
16670
+ }
16671
+ )
16672
+ ]
16673
+ }
16674
+ ),
16588
16675
  document.body
16589
16676
  );
16590
16677
  };
@@ -17738,6 +17825,7 @@ var PresentationJobCard = ({
17738
17825
 
17739
17826
  // src/molecules/generic/ResearchReportJobCard/ResearchReportJobCard.tsx
17740
17827
  import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef11, useState as useState12 } from "react";
17828
+ import { createPortal as createPortal2 } from "react-dom";
17741
17829
  import { Fragment as Fragment6, jsx as jsx153, jsxs as jsxs111 } from "react/jsx-runtime";
17742
17830
  var DEFAULT_THEME = {
17743
17831
  primary: "#C0AE82",
@@ -17824,17 +17912,19 @@ var REPORT_FORMATS = [
17824
17912
  key: "pdf",
17825
17913
  label: "PDF",
17826
17914
  ext: ".pdf",
17827
- emoji: "\u{1F4C4}",
17915
+ Icon: PdfIcon,
17828
17916
  desc: "Print-ready, fixed layout \u2014 open in any PDF viewer",
17829
- accent: { text: "text-red-400", bg: "bg-red-500/10 border-red-500/20" }
17917
+ // Hue lives on the icon tile only; the rows themselves stay neutral so
17918
+ // stacked formats don't read as competing status colours.
17919
+ accent: { icon: "text-red-300", tile: "bg-red-500/10 ring-red-500/20" }
17830
17920
  },
17831
17921
  {
17832
17922
  key: "html",
17833
17923
  label: "HTML",
17834
17924
  ext: ".html",
17835
- emoji: "\u{1F310}",
17925
+ Icon: HtmlIcon,
17836
17926
  desc: "Interactive web page \u2014 download and open in a browser",
17837
- accent: { text: "text-sky-400", bg: "bg-sky-500/10 border-sky-500/20" }
17927
+ accent: { icon: "text-sky-300", tile: "bg-sky-500/10 ring-sky-500/20" }
17838
17928
  }
17839
17929
  ];
17840
17930
  var ReportExportModal = ({ htmlUrl, pdfUrl, title, onClose }) => {
@@ -17842,6 +17932,7 @@ var ReportExportModal = ({ htmlUrl, pdfUrl, title, onClose }) => {
17842
17932
  const available = REPORT_FORMATS.filter((f) => urls[f.key]);
17843
17933
  const filename = (title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase();
17844
17934
  const [downloadingKey, setDownloadingKey] = useState12(null);
17935
+ const panelRef = useRef11(null);
17845
17936
  useEffect10(() => {
17846
17937
  const onKey = (e) => {
17847
17938
  if (e.key === "Escape") onClose();
@@ -17849,6 +17940,13 @@ var ReportExportModal = ({ htmlUrl, pdfUrl, title, onClose }) => {
17849
17940
  document.addEventListener("keydown", onKey);
17850
17941
  return () => document.removeEventListener("keydown", onKey);
17851
17942
  }, [onClose]);
17943
+ useEffect10(() => {
17944
+ document.body.style.overflow = "hidden";
17945
+ panelRef.current?.focus();
17946
+ return () => {
17947
+ document.body.style.overflow = "";
17948
+ };
17949
+ }, []);
17852
17950
  const handleDownload = async (key, url, ext) => {
17853
17951
  if (downloadingKey) return;
17854
17952
  const downloadName = `${filename}${ext}`;
@@ -17866,53 +17964,107 @@ var ReportExportModal = ({ htmlUrl, pdfUrl, title, onClose }) => {
17866
17964
  anchor.click();
17867
17965
  anchor.remove();
17868
17966
  window.URL.revokeObjectURL(objectUrl);
17967
+ onClose();
17869
17968
  } catch {
17870
- window.open(url, "_blank", "noopener,noreferrer");
17969
+ const popup = window.open(url, "_blank", "noopener,noreferrer");
17970
+ if (popup) onClose();
17871
17971
  } finally {
17872
17972
  setDownloadingKey(null);
17873
17973
  }
17874
17974
  };
17875
- return /* @__PURE__ */ jsxs111("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
17876
- /* @__PURE__ */ jsx153("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
17877
- /* @__PURE__ */ jsxs111("div", { className: "relative z-10 bg-zinc-900 border border-zinc-800 rounded-2xl w-full max-w-sm p-6 shadow-2xl", children: [
17878
- /* @__PURE__ */ jsxs111("div", { className: "flex items-start justify-between mb-5", children: [
17879
- /* @__PURE__ */ jsxs111("div", { className: "min-w-0 pr-3", children: [
17880
- /* @__PURE__ */ jsx153("h3", { className: "text-sm font-semibold text-zinc-100", children: "Download report" }),
17881
- /* @__PURE__ */ jsx153("p", { className: "text-xs text-zinc-500 mt-0.5 truncate", children: title })
17882
- ] }),
17883
- /* @__PURE__ */ jsx153("button", { onClick: onClose, className: "text-zinc-500 hover:text-zinc-200 transition-colors flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx153(CloseIcon, {}) })
17884
- ] }),
17885
- /* @__PURE__ */ jsxs111("div", { className: "space-y-2.5", children: [
17886
- available.length === 0 && /* @__PURE__ */ jsx153("p", { className: "text-sm text-zinc-500 text-center py-6", children: "No formats available yet" }),
17887
- available.map((fmt) => {
17888
- const url = urls[fmt.key];
17889
- const isDownloading = downloadingKey === fmt.key;
17890
- return /* @__PURE__ */ jsxs111(
17891
- "button",
17975
+ return createPortal2(
17976
+ /* @__PURE__ */ jsxs111(
17977
+ "div",
17978
+ {
17979
+ className: "fixed inset-0 z-[100] flex items-center justify-center p-4",
17980
+ role: "dialog",
17981
+ "aria-modal": "true",
17982
+ "aria-labelledby": "pxe-report-export-title",
17983
+ children: [
17984
+ /* @__PURE__ */ jsx153("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
17985
+ /* @__PURE__ */ jsxs111(
17986
+ "div",
17892
17987
  {
17893
- type: "button",
17894
- disabled: Boolean(downloadingKey),
17895
- onClick: () => handleDownload(fmt.key, url, fmt.ext),
17896
- className: cn(
17897
- "flex w-full items-center gap-3.5 p-3.5 rounded-xl border transition-all text-left",
17898
- "hover:brightness-110 disabled:opacity-60 disabled:cursor-not-allowed",
17899
- fmt.accent.bg
17900
- ),
17988
+ ref: panelRef,
17989
+ tabIndex: -1,
17990
+ className: "relative z-10 w-full max-w-md overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900 shadow-2xl outline-none",
17901
17991
  children: [
17902
- /* @__PURE__ */ jsx153("span", { className: "text-xl flex-shrink-0", children: fmt.emoji }),
17903
- /* @__PURE__ */ jsxs111("div", { className: "flex-1 min-w-0", children: [
17904
- /* @__PURE__ */ jsx153("p", { className: cn("text-sm font-semibold", fmt.accent.text), children: isDownloading ? `Downloading ${fmt.label}...` : fmt.label }),
17905
- /* @__PURE__ */ jsx153("p", { className: "text-xs text-zinc-500 mt-0.5 leading-relaxed", children: isDownloading ? "Please wait while the file is being prepared." : fmt.desc })
17992
+ /* @__PURE__ */ jsxs111("div", { className: "flex items-start gap-3 border-b border-zinc-800/80 px-5 py-4", children: [
17993
+ /* @__PURE__ */ jsx153("span", { className: "mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg bg-[#C0AE82]/10 text-[#DCC99B] ring-1 ring-[#C0AE82]/20", children: /* @__PURE__ */ jsx153(DocumentIcon, {}) }),
17994
+ /* @__PURE__ */ jsxs111("div", { className: "min-w-0 flex-1", children: [
17995
+ /* @__PURE__ */ jsx153("h3", { id: "pxe-report-export-title", className: "text-sm font-semibold text-zinc-100", children: "Download report" }),
17996
+ /* @__PURE__ */ jsx153("p", { className: "mt-0.5 truncate text-xs text-zinc-500", children: title })
17997
+ ] }),
17998
+ /* @__PURE__ */ jsx153(
17999
+ "button",
18000
+ {
18001
+ onClick: onClose,
18002
+ "aria-label": "Close download dialog",
18003
+ className: "-mr-1 mt-0.5 flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg text-zinc-500 transition-colors hover:bg-zinc-800 hover:text-zinc-200",
18004
+ children: /* @__PURE__ */ jsx153(CloseIcon, {})
18005
+ }
18006
+ )
17906
18007
  ] }),
17907
- /* @__PURE__ */ jsx153("span", { className: cn("flex-shrink-0", fmt.accent.text), children: /* @__PURE__ */ jsx153(DownloadIcon, {}) })
18008
+ /* @__PURE__ */ jsx153("div", { className: "space-y-2 p-4", children: available.length === 0 ? /* @__PURE__ */ jsxs111("div", { className: "py-8 text-center", children: [
18009
+ /* @__PURE__ */ jsx153("p", { className: "text-sm text-zinc-400", children: "No formats available yet" }),
18010
+ /* @__PURE__ */ jsx153("p", { className: "mt-1 text-xs text-zinc-600", children: "Downloads appear here once the report finishes generating." })
18011
+ ] }) : available.map((fmt) => {
18012
+ const url = urls[fmt.key];
18013
+ const isDownloading = downloadingKey === fmt.key;
18014
+ return /* @__PURE__ */ jsxs111(
18015
+ "button",
18016
+ {
18017
+ type: "button",
18018
+ disabled: Boolean(downloadingKey),
18019
+ onClick: () => handleDownload(fmt.key, url, fmt.ext),
18020
+ className: cn(
18021
+ "group flex w-full items-center gap-3 rounded-xl border border-zinc-800 bg-zinc-800/40 p-3 text-left transition-all",
18022
+ "hover:border-[#C0AE82]/40 hover:bg-zinc-800/70",
18023
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-[#C0AE82]/50",
18024
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-zinc-800 disabled:hover:bg-zinc-800/40"
18025
+ ),
18026
+ children: [
18027
+ /* @__PURE__ */ jsx153(
18028
+ "span",
18029
+ {
18030
+ className: cn(
18031
+ "flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg ring-1",
18032
+ fmt.accent.tile,
18033
+ fmt.accent.icon
18034
+ ),
18035
+ children: /* @__PURE__ */ jsx153(fmt.Icon, {})
18036
+ }
18037
+ ),
18038
+ /* @__PURE__ */ jsxs111("div", { className: "min-w-0 flex-1", children: [
18039
+ /* @__PURE__ */ jsxs111("div", { className: "flex items-center gap-2", children: [
18040
+ /* @__PURE__ */ jsx153("p", { className: "text-sm font-semibold text-zinc-100", children: fmt.label }),
18041
+ /* @__PURE__ */ jsx153("span", { className: "rounded bg-zinc-800 px-1.5 py-0.5 font-mono text-[10px] text-zinc-500 ring-1 ring-zinc-700/60", children: fmt.ext })
18042
+ ] }),
18043
+ /* @__PURE__ */ jsx153("p", { className: "mt-0.5 text-xs leading-relaxed text-zinc-500", children: isDownloading ? "Preparing your file\u2026" : fmt.desc })
18044
+ ] }),
18045
+ /* @__PURE__ */ jsx153(
18046
+ "span",
18047
+ {
18048
+ className: cn(
18049
+ "flex-shrink-0 transition-colors",
18050
+ isDownloading ? "text-[#DCC99B]" : "text-zinc-600 group-hover:text-[#DCC99B]"
18051
+ ),
18052
+ children: isDownloading ? /* @__PURE__ */ jsx153(Spinner2, {}) : /* @__PURE__ */ jsx153(DownloadIcon, {})
18053
+ }
18054
+ )
18055
+ ]
18056
+ },
18057
+ fmt.key
18058
+ );
18059
+ }) })
17908
18060
  ]
17909
- },
17910
- fmt.key
17911
- );
17912
- })
17913
- ] })
17914
- ] })
17915
- ] });
18061
+ }
18062
+ )
18063
+ ]
18064
+ }
18065
+ ),
18066
+ document.body
18067
+ );
17916
18068
  };
17917
18069
  function deriveJobStatusUrl2(newJobId, pollUrl, regenerateUrl) {
17918
18070
  const base = pollUrl?.replace(/\/api\/jobs\/[^/]+\/status.*$/, "") ?? regenerateUrl?.replace(/\/api\/reports\/[^/]+\/regenerate.*$/, "") ?? "";