PageSourceSearch

https://hellobus.nl/assets/InvoiceScreen--A6-_F6p.js

js hellobus.nl collected 2026-10-08 18:43:59 UTC 7,332 bytes, 2 lines download raw bytes

1import{aF as w,aG as P,aH as k,aI as S,j as e,u as N,P as I,r as p,M as j,aJ as E}from"./index-W61GlO1C.js";import{f as R}from"./invoiceApi-BU5IU8Ld.js";import{t as M,I as O}from"./InvoiceRow-DUG4eXRX.js";import{e as F}from"./PaymentAmountModal-CcQe9H87.js";import"./DownloadIcon-CbYtlDP2.js";import"./useCreateMolliePaymentMutation-B_aTLKKE.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"2026-10.11"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="fd179074-77e8-4cf7-9b6f-05d0919ebd56",s._sentryDebugIdIdentifier="sentry-dbid-fd179074-77e8-4cf7-9b6f-05d0919ebd56")}catch{}})();var _=class extends w{constructor(s,t){super(s,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,t){var i,c;const{state:r}=s,d=super.createResult(s,t),{isFetching:n,isRefetching:l,isError:h,isRefetchError:m}=d,o=(c=(i=r.fetchMeta)==null?void 0:i.fetchMore)==null?void 0:c.direction,x=h&&o==="forward",a=n&&o==="forward",u=h&&o==="backward",b=n&&o==="backward";return{...d,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:k(t,r.data),hasPreviousPage:P(t,r.data),isFetchNextPageError:x,isFetchingNextPage:a,isFetchPreviousPageError:u,isFetchingPreviousPage:b,isRefetchError:m&&!x&&!u,isRefetching:l&&!a&&!b}}};function D(s,t){return S(s,_,t)}const g=10;function L(){return D({queryKey:["myInvoices"],queryFn:({pageParam:s,signal:t})=>R(g,s,t),initialPageParam:0,getNextPageParam:(s,t)=>{if(!(s.length<g))return t.length*g},staleTime:3e4})}function v({label:s,value:t,accent:r=!1}){return e.jsxs("div",{className:"bg-hb-bg-card border border-hb-line rounded-hb-lg px-6 py-5 flex-1",children:[e.jsx("div",{className:"text-hb-small font-semibold text-hb-ink-mute mb-2 uppercase",children:s}),e.jsx("div",{className:`text-hb-figure-lg font-bold ${r?"text-hb-primary":"text-hb-ink"}`,children:t})]})}function A(s,t){const r=new Map,d=[];for(const n of s){const l=t(n);r.has(l)||(r.set(l,[]),d.push(l)),r.get(l).push(n)}return d.flatMap(n=>r.get(n))}function T(){return e.jsx("div",{className:"border border-hb-line rounded-2xl pt-2 overflow-hidden bg-white",children:e.jsxs("div",{className:"w-full flex items-center gap-4 px-6 py-5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-hb-bg-warm shrink-0 animate-pulse"}),e.jsxs("div",{className:"min-w-[180px] animate-pulse",children:[e.jsx("div",{className:"w-32 h-4 bg-hb-ink/15 rounded mb-2"}),e.jsx("div",{className:"w-24 h-3 bg-hb-bg-warm rounded"})]}),e.jsxs("div",{className:"flex-1 hidden sm:block animate-pulse",children:[e.jsx("div",{className:"w-64 h-4 bg-hb-ink/15 rounded mb-2"}),e.jsx("div",{className:"w-40 h-3 bg-hb-bg-warm rounded"})]}),e.jsx("div",{className:"w-24 h-6 bg-hb-bg-warm rounded-full animate-pulse"}),e.jsx("div",{className:"w-4 h-4 bg-hb-bg-warm rounded animate-pulse"})]})})}function q(){const{t:s}=N("invoice");return e.jsxs(e.Fragment,{children:[e.jsx(I,{title:s("invoiceScreen.meta.title"),metaRobots:"NOINDEX,FOLLOW"}),e.jsx(H,{})]})}function H(){const{t:s}=N("invoice"),{data:t,isLoading:r,isError:d,error:n,refetch:l,fetchNextPage:h,hasNextPage:m,isFetchingNextPage:o}=L(),x=(t==null?void 0:t.pages.flat())??[],a=A(x.map(M),i=>i.booking),u=a.filter(i=>i.status==="outstanding"||i.status==="failed").reduce((i,c)=>i+c.total,0),b=a.filter(i=>i.status==="paid").length,f=p.useRef(null);return p.useEffect(()=>{const i=f.current;if(!i||!m)return;const c=new IntersectionObserver(y=>{y[0].isIntersecting&&!o&&h()},{rootMargin:"200px"});return c.observe(i),()=>c.disconnect()},[m,o,h]),r?e.jsx("div",{className:"min-h-screen",children:e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("div",{className:"text-hb-small font-semibold tracking-widest text-hb-ink-mute mb-6",children:e.jsx(j,{children:s("invoiceScreen.eyebrow")})}),e.jsx("div",{className:"flex items-start justify-between mb-8",children:e.jsxs("h1",{className:"text-hb-h2 font-extrabold text-hb-ink",children:[s("invoiceScreen.titleLead")," ",e.jsx("span",{className:"text-hb-primary",children:s("invoiceScreen.titleAccent")})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-8 animate-pulse",children:[e.jsx("div",{className:"flex-1 h-26 bg-hb-bg-warm rounded-2xl"}),e.jsx("div",{className:"flex-1 h-26 bg-hb-bg-warm rounded-2xl"}),e.jsx("div",{className:"flex-1 h-26 bg-hb-bg-warm rounded-2xl"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:4}).map((i,c)=>e.jsx(T,{},c))})]})}):d?e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3 text-hb-ink-mute",children:[e.jsxs("div",{children:[s("invoiceScreen.loadError"),n instanceof Error?` ${n.message}`:""]}),e.jsx("button",{onClick:()=>l(),className:"rounded-full border border-hb-line-strong px-4 py-2 text-hb-body-sm font-semibold hover:bg-hb-creme-300",children:s("invoiceScreen.retry")})]}):e.jsx("div",{className:"min-h-screen",children:e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("div",{className:"text-hb-small font-semibold tracking-widest text-hb-ink-mute mb-6",children:e.jsx(j,{children:s("invoiceScreen.eyebrow")})}),e.jsx("div",{className:"flex items-start justify-between mb-8",children:e.jsxs("h1",{className:"text-hb-h2 font-extrabold text-hb-ink",children:[s("invoiceScreen.titleLead")," ",e.jsx("span",{className:"text-hb-primary",children:s("invoiceScreen.titleAccent")})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-8",children:[e.jsx(v,{label:s("invoiceScreen.summary.outstanding"),value:F(u),accent:!0}),e.jsx(v,{label:s("invoiceScreen.summary.totalInvoices"),value:a.length}),e.jsx(v,{label:s("invoiceScreen.summary.paid"),value:s("invoiceScreen.summary.paidOfTotal",{paid:b,total:a.length})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"hidden sm:flex items-center px-2 mb-3 text-hb-small font-semibold tracking-wider text-hb-ink-mute",children:[e.jsx("div",{className:"min-w-45 uppercase",children:s("invoiceScreen.tableHeader.invoiceBooking")}),e.jsx("div",{className:"w-15 mr-4"}),e.jsx("div",{className:"flex-1 uppercase",children:s("invoiceScreen.tableHeader.trip")}),e.jsx("div",{className:"mr-4 uppercase",children:s("invoiceScreen.tableHeader.status")}),e.jsx("div",{className:"w-5"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:a.length===0?e.jsx("div",{className:"text-center text-hb-ink-mute py-12",children:s("invoiceScreen.empty")}):a.map(i=>e.jsx(O,{invoice:i},i.id))}),m?e.jsx("div",{ref:f,className:"flex justify-center py-6",children:o&&e.jsx("span",{className:"text-hb-body-sm text-hb-ink-mute",children:e.jsx(E,{label:s("invoiceScreen.loadingMore")})})}):a.length>0&&e.jsx("div",{className:"text-center text-hb-body-sm text-hb-ink-mute py-6",children:s("invoiceScreen.noMoreInvoices")})]})]})})}export{q as InvoiceScreen,q as default};
2//# sourceMappingURL=InvoiceScreen--A6-_F6p.js.map

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.