PageSourceSearch

https://portal.mpnashville615.com/assets/board.messages._id_._messageId_.attachments-D7bdsV_2.js

js mpnashville615.com collected 2026-10-07 19:04:09 UTC 3,982 bytes, 1 lines download raw bytes

1import{u as m,j as e,S as d,B as x,a7 as p,r as h,aP as f,F as l,b0 as b,b1 as j,n as i}from"./elements-5kxJS_4j.js";import{$ as u,j as g,a2 as w}from"./index-CtCeyryw.js";import{u as N}from"./board-portal-requests-Dhj4UIYh.js";import{E as y}from"./react-error-boundary.esm-DcHtxTCg.js";import"./grids-DGmfp9GI.js";import"./startOfDay-AazlW55I.js";import"./useMutation-jkV-6MpM.js";function E(){const{t:n}=m(),{id:s,messageId:t}=u(),o=g(c=>c.selectedAssociationId),{data:a=[],isLoading:r}=N({actionItemId:Number(s),messageId:Number(t),associationId:o??void 0});return e.jsxs(e.Fragment,{children:[e.jsx(y,{fallbackRender:()=>e.jsxs("div",{className:"p-6 text-center flex flex-col items-center justify-center gap-8 w-screen h-screen",children:[e.jsx("h1",{className:"text-2xl font-bold",children:n("board.attachments.anErrorOccurred")}),e.jsx("p",{className:"text-lg",children:n("board.attachments.errorMessage")}),e.jsx(x,{onClick:()=>window.location.reload(),children:n("board.attachments.errorTryAgain")})]}),children:r?e.jsx("div",{className:"p-6 text-center flex flex-col items-center justify-center gap-8 w-screen h-screen",children:e.jsx(d,{})}):e.jsx(v,{attachments:a})}),e.jsx(p,{position:"bottom-right"})]})}const v=({attachments:n})=>{const{t:s}=m(),[t,o]=h.useState(n[0]);return n.length===0?e.jsxs("div",{className:"p-6 text-center flex flex-col items-center justify-center gap-8 w-screen h-screen",children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("board.attachments.noAttachments")}),e.jsx("p",{className:"text-lg",children:s("board.attachments.noAttachmentsDetails")})]}):e.jsxs("div",{className:"h-screen w-screen flex flex-col",children:[e.jsxs("div",{className:"flex items-end justify-center p-4 gap-4",children:[e.jsx(f,{className:"flex-grow sm:flex-grow-0 sm:min-w-96",label:"",options:n,displaySelected:a=>a.humanReadableFileName,displayOption:a=>a.humanReadableFileName??e.jsx(e.Fragment,{children:" "}),deriveKey:({fileId:a})=>String(a),value:t,onChange:a=>{o(a)}}),e.jsxs("button",{className:"p-2",title:s("board.attachments.download"),onClick:()=>{t&&w({content:t.content,contentType:t.contentType,fileName:t.fileName},()=>{fetch(`data:${t.contentType};base64,${t.content}`).then(a=>a.blob()).then(a=>{const r=URL.createObjectURL(a),c=document.createElement("a");c.href=r,c.setAttribute("download",t.fileName),document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(r),i({message:s("board.attachments.downloadComplete"),type:"success",position:"top-right"})}).catch(a=>{console.error(a),i({message:s("board.attachments.downloadError",{error:String(a)}),type:"error"})})})},children:[e.jsx("span",{className:"sr-only",children:s("board.attachments.download")}),e.jsx(l,{icon:b,className:"text-base-fg text-base"})]})]}),(t==null?void 0:t.contentType)==="application/pdf"&&e.jsx(L,{fileName:t.fileName,contents:t.content}),(t==null?void 0:t.contentType.startsWith("image/"))&&e.jsx(R,{fileName:t.fileName,contents:t.content,type:t.contentType}),!["application/pdf","image/"].some(a=>t==null?void 0:t.contentType.startsWith(a))&&e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsxs("p",{className:"space-x-2",children:[e.jsx(l,{icon:j,className:"text-yellow-500"}),e.jsx("span",{children:s("board.attachments.noPreview")})]})})]})},L=({fileName:n,contents:s})=>{const t=new Blob([Uint8Array.from(atob(s),a=>
1a.charCodeAt(0))],{type:"application/pdf"}),o=URL.createObjectURL(t);return e.jsx("iframe",{className:"flex-grow overflow-auto",title:n,src:o,onLoad:()=>URL.revokeObjectURL(o)})},R=({fileName:n,contents:s,type:t})=>{const o=new Blob([Uint8Array.from(atob(s),r=>r.charCodeAt(0))],{type:t}),a=URL.createObjectURL(o);return e.jsx("div",{className:"flex-grow overflow-auto flex items-center justify-center",children:e.jsx("img",{onLoad:()=>URL.revokeObjectURL(a),className:"max-w-[calc(100%-50px)] max-h-[calc(100%-50px)] object-contain",src:a,alt:n})})};export{E as Component};

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.