1import{q as c,j as n,o as y}from"./vendor-react-2cb5d109.js";import{cx as g,x as v,d,cy as h}from"./vendor-vy-bde48d53.js";import{H as P}from"./vendor-misc-09f7f1da.js";import{P as I}from"./PdfViewer-2c895b77.js";import{e as u,p as f,q as r,w as b}from"./app-core-47ba8b05.js";import{u as w}from"./use-validated-params-86b4212a.js";import{u as x}from"./use-standalone-invoice-breadcrumbs-b8e2a6c4.js";import{D as p}from"./DynamicInvoiceViewPageInvoiceNotFound-3609a9db.js";import{S as E}from"./vendor-mui-c34240eb.js";import"./vendor-vy-ds-da93fbfd.js";import"./vendor-pdfjs-a174bb6b.js";import"./breadcrumbs-context-0c78adb5.js";import"./breadcrumb-routes-44c27586.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"a44d049e7c59"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b3fc501d-2341-4987-8ed6-ea6d34127fab",e._sentryDebugIdIdentifier="sentry-dbid-b3fc501d-2341-4987-8ed6-ea6d34127fab")}catch{}})();function j(e,t){const i=c(r.invoice(e),async()=>{const a=await u().getInvoice({invoiceId:e});return f(g,a)},{suspense:!0,...t});return v(i.data,`Invoice with id ${e}`),i}const R=2;async function l(e){const i=await u().getInvoicePdf({invoiceId:e});return f(h,i)}function S(e){if(!(e instanceof Error)||e.name!=="ResponseError")return!1;const{response:t}=e;return(t==null?void 0:t.status)===404}function m(e,t){return e<R&&!S(t)}function F(e,t){return c({queryKey:r.invoicePdf(e),queryFn:()=>l(e),retry:m,...t})}async function D(e,t){d(t.getQueryState(r.invoicePdf(e)))||await t.prefetchQuery(r.invoicePdf(e),()=>l(e),{retry:m})}const _=()=>{const{invoiceId:e}=w("invoiceId"),t=y();D(e,t);const{data:i}=j(e,{suspense:!0}),{data:o,isError:a}=F(e,{suspense:!0,useErrorBoundary:!1}),{invoice:s}=i;return x(s==null?void 0:s.invoiceNumber),n.jsxs(n.Fragment,{children:[n.jsx(P,{children:n.jsx("title",{children:`Invoice ${(s==null?void 0:s.name)??""}`})}),n.jsx(n.Fragment,{children:n.jsx(E,{spacing:4,sx:{width:"100%",padding:"32px",overflowY:"auto",alignItems:"center"},children:a?n.jsx(p,{title:"PDF not available",description:"We couldnât load the PDF for this invoice. Please try again later."}):d(o)&&n.jsx(I,{base64EncodedPdf:o.encodedPdf})})})]})},M=b(_,{errorBoundaryProps:{fallback:n.jsx("div",{style:{width:"100%",height:"100%"},children:n.jsx(p,{})})}});export{M as LightInvoiceViewPage};
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.