Files
Express_console_build/build/static/js/6165.733094c1.chunk.js

1 line
21 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6165],{23787:(e,o,r)=>{r.d(o,{FG:()=>p,nV:()=>x,pY:()=>u,pg:()=>h});var n=r(89379),i=r(80045),t=r(93230),s=r(2235),l=r(16491),c=r(82053),a=r(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:s,sx:l}=e,c=(0,i.A)(e,d);return(0,a.jsx)(t.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:s,sx:(0,n.A)((0,n.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},c),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:i,selected:t=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(s.A,{elevation:0,onClick:c,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?o:"#e2e8f0",background:t?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,a.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[r,d,i]})]})},p=e=>{let{children:o,columns:r=2,sx:i}=e;return(0,a.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},i),children:o})},u=e=>{let{label:o,value:r,children:n,full:i=!1,align:t="left"}=e;return(0,a.jsxs)(l.A,{sx:{gridColumn:i?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,a.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},26165:(e,o,r)=>{r.r(o),r.d(o,{default:()=>$});var n=r(9950),i=r(28429),t=r(36150),s=r(4159),l=r.n(s),c=r(41413),a=r(47223),d=r(2235),x=r(93230),h=r(82053),p=r(16491),u=r(60899),g=r(83274),f=r(25333),m=r(1320),b=r(15769),j=r(69780),A=r(9213),v=r(21671),w=r(34075),y=r(74745),S=r(6258),C=r(14857),k=r(31222),W=r(81425),z=r(52351),I=r(56311),R=r(96646),Y=r(23787),M=r(44414),T=r(36220);l().extend(T);const D=16,P="0 8px 24px rgba(15, 23, 42, 0.08)",L="#0f172a",F="#64748b",B="#94a3b8",H="#e2e8f0",N="#f1f5f9",E="#f8fafc",K=(e,o)=>"".concat(e).concat(o),G=e=>K(e,"08"),O=e=>K(e,"18"),U=e=>K(e,"26"),X=e=>K(e,"55"),q="#662582",_="#9255AB",V=e=>{let{color:o,selected:r,size:n=24,children:i}=e;return(0,M.jsx)(c.A,{sx:{width:n,height:n,bgcolor:r?o:O(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:i})},J={0:{key:"all",label:"All",color:q,icon:k.Uhn,countKey:"totalcount"},1:{key:"open",label:"Open",color:"#ef4444",icon:k.tX0,countKey:"pendingcount"},2:{key:"overdue",label:"Overdue",color:"#f59e0b",icon:k.tMO,countKey:"overduecount"},3:{key:"paid",label:"Paid",color:"#10b981",icon:k.mU9,countKey:"paidcount"}},Z=[0,1,2,3];function Q(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}const $=()=>{var e,o,r,s;const T=(0,i.Zp)(),K=(0,C.A)(),$=(0,a.A)(K.breakpoints.down("md")),[ee,oe]=(0,n.useState)(0),[re,ne]=(0,n.useState)(10),[ie,te]=(0,n.useState)(0),[se,le]=(0,n.useState)(!1),[ce,ae]=(0,n.useState)(""),[de,xe]=(0,n.useState)(""),he=n.useCallback((e=>{xe(e),oe(0)}),[]),{data:pe,isLoading:ue,isError:ge,error:fe}=(0,t.I)({queryKey:["invoiceInsight"],queryFn:W.Y8,refetchInterval:3e5}),{data:me,isLoading:be,isError:je,error:Ae}=(0,t.I)({queryKey:[ie],queryFn:W.XC,refetchInterval:3e5}),ve=ue||be,we=ge||je,ye=(null===fe||void 0===fe?void 0:fe.message)||(null===Ae||void 0===Ae?void 0:Ae.message),Se=(0,n.useMemo)((()=>{if(!me)return[];if(!de)return me;const e=de.toLowerCase().trim();return me.filter((o=>[o.tenantname,o.contactperson,String(o.invoiceno)].filter(Boolean).some((o=>String(o).toLowerCase().includes(e)))))}),[me,de]),Ce=(0,n.useMemo)((()=>{const e=Math.max(0,Math.ceil(Se.length/re)-1);return Math.min(ee,e)}),[Se.length,ee,re]);n.useEffect((()=>{ee!==Ce&&oe(Ce)}),[ee,Ce]);const ke=(0,n.useMemo)((()=>Se.slice(Ce*re,Ce*re+re)),[Se,Ce,re]),We=(0,n.useMemo)((()=>Se.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[Se]),ze=(0,n.useMemo)((()=>ke.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[ke]);if(we)return ye;const Ie=[{idx:0,label:"All Invoices",color:q,icon:k.Uhn,value:null!==(e=null===pe||void 0===pe?void 0:pe.totalcount)&&void 0!==e?e:0},{idx:1,label:"Open",color:"#ef4444",icon:k.tX0,value:null!==(o=null===pe||void 0===pe?void 0:pe.pendingcount)&&void 0!==o?o:0},{idx:2,label:"Overdue",color:"#f59e0b",icon:k.tMO,value:null!==(r=null===pe||void 0===pe?void 0:pe.overduecount)&&void 0!==r?r:0},{idx:3,label:"Paid",color:"#10b981",icon:k.mU9,value:null!==(s=null===pe||void 0===pe?void 0:pe.paidcount)&&void 0!==s?s:0}],Re=J[ie];return(0,M.jsxs)(M.Fragment,{children:[(se||ve)&&(0,M.jsx)(z.A,{}),(0,M.jsx)(d.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:D/8,border:"1px solid",borderColor:H,background:"linear-gradient(135deg, ".concat(G(q)," 0%, ").concat(G(_)," 100%)"),boxShadow:P},children:(0,M.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,M.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:q,color:"#fff",boxShadow:"0 6px 18px ".concat(U(q))},children:(0,M.jsx)(k.GdF,{size:22})}),(0,M.jsxs)(x.A,{children:[(0,M.jsx)(h.A,{variant:"h3",sx:{fontWeight:800,color:L,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Invoices"}),(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,M.jsx)(p.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,M.jsxs)(h.A,{variant:"caption",sx:{color:F,fontWeight:600},children:["Live \xb7 Viewing ",Re.label.toLowerCase()," invoices"]})]})]})]}),(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:1,px:1.5,py:.875,borderRadius:999,bgcolor:G(q),border:"1.5px solid ".concat(X(q)),color:q,fontWeight:800,fontSize:12},children:[(0,M.jsx)(k.YHz,{size:14}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,color:F,letterSpacing:.4,textTransform:"uppercase"},children:"Grand Total"}),(0,M.jsx)(h.A,{sx:{fontWeight:800,color:q,fontSize:13},children:Q(We)})]})]})}),(0,M.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ie.map((e=>{const o=e.icon,r=ie===e.idx;return(0,M.jsx)(u.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,M.jsxs)(d.A,{elevation:0,onClick:()=>{te(e.idx),oe(0)},sx:{position:"relative",overflow:"hidden",cursor:"pointer",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:D/8,border:"1px solid",borderColor:r?X(e.color):H,background:r?G(e.color):"#fff",boxShadow:r?"0 0 0 3px ".concat(U(e.color)):"none",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:P,borderColor:X(e.color)}},children:[(0,M.jsx)(p.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(O(e.color)," 100%)")}}),(0,M.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,M.jsxs)(x.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,M.jsx)(h.A,{sx:{fontWeight:800,color:L,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:e.value})]}),(0,M.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:O(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(X(e.color)),flexShrink:0},children:(0,M.jsx)(o,{size:20})})]})]})},e.idx)}))}),(0,M.jsx)(d.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:D/8,borderTopRightRadius:D/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:H,borderBottom:0,background:"#fff"},children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,M.jsx)(x.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:H,borderRadius:4}},children:Z.map((e=>{var o;const r=J[e],n=r.icon,i=ie===e,t=null!==(o=null===pe||void 0===pe?void 0:pe[r.countKey])&&void 0!==o?o:0;return(0,M.jsxs)(p.A,{onClick:()=>{te(e),oe(0)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?r.color:X(r.color)),bgcolor:i?r.color:G(r.color),color:i?"#fff":r.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(U(r.color)):"none",transition:"all 0.18s","&:hover":{borderColor:r.color,boxShadow:i?"0 6px 18px ".concat(U(r.color)):"0 0 0 3px ".concat(U(r.color))}},children:[(0,M.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":O(r.color),color:i?"#fff":r.color},children:(0,M.jsx)(n,{size:13})}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,M.jsx)(p.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":r.color,border:i?"none":"1px solid ".concat(X(r.color))},children:t})]},e)}))}),(0,M.jsx)(p.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,M.jsx)(I.A,{value:ce,onChange:ae,onDebouncedChange:he,placeholder:"Search invoices (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:G(q),"& fieldset":{borderColor:X(q),borderWidth:1.5},"&:hover fieldset":{borderColor:q},"&.Mui-focused fieldset":{borderColor:q,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(U(q))}}})})]})}),(0,M.jsxs)(d.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:D/8,borderBottomRightRadius:D/8,border:"1px solid",borderColor:H,overflow:"hidden",background:"#fff"},children:[$?(0,M.jsx)(M.Fragment,{children:be?(0,M.jsx)(p.A,{sx:{p:1.5},children:(0,M.jsx)(R.r,{col:4})}):0===ke.length?(0,M.jsxs)(x.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,M.jsx)(c.A,{sx:{width:64,height:64,bgcolor:O("#94a3b8"),color:B},children:(0,M.jsx)(k.GdF,{size:28})}),(0,M.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:L},children:"No invoices to show"}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,textAlign:"center"},children:ce?"Try a different keyword.":"No ".concat(Re.label.toLowerCase()," invoices for this filter.")})]}):(0,M.jsx)(Y.nV,{children:ke.map(((e,o)=>{var r;const n=2===ie||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==ie;return(0,M.jsx)(Y.pg,{accent:q,header:(0,M.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,M.jsx)(V,{color:q,size:36,children:(0,M.jsx)(k.Itr,{size:18})}),(0,M.jsxs)(x.A,{spacing:.25,sx:{minWidth:0},children:[(0,M.jsx)(h.A,{variant:"subtitle2",sx:{fontWeight:700,color:L},noWrap:!0,children:e.tenantname||"\u2014"}),e.contactperson&&(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},noWrap:!0,children:e.contactperson})]})]}),(0,M.jsx)(g.A,{title:"Preview invoice",placement:"left",children:(0,M.jsx)(f.A,{size:"small",onClick:()=>{le(!0),setTimeout((()=>{le(!1),T("/nearle/invoice/preview",{state:e})}),500)},sx:{flexShrink:0,bgcolor:O(q),color:q,border:"1px solid ".concat(X(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:(0,M.jsx)(k.U3x,{size:16})})})]}),children:(0,M.jsxs)(Y.FG,{children:[(0,M.jsx)(Y.pY,{label:"Invoice ID",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,M.jsx)(k.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,M.jsx)(Y.pY,{label:"Amount",align:"right",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G(q),border:"1px solid ".concat(X(q)),color:q,fontSize:11,fontWeight:800,justifyContent:"center"},children:[(0,M.jsx)(k.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,M.jsx)(Y.pY,{label:"Invoice Date",children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:L},noWrap:!0,children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,M.jsx)(Y.pY,{label:"Due Date",children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:n&&3!==ie?"#ef4444":B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==ie?"#ef4444":L},noWrap:!0,children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,M.jsx)(Y.pY,{label:"Items",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:G("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,M.jsx)(k.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})})]})},e.invoiceno||o)}))})}):(0,M.jsx)(m.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:X(q),borderRadius:8,"&:hover":{backgroundColor:q}},"&::-webkit-scrollbar-track":{backgroundColor:E}},children:(0,M.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1060}},children:[(0,M.jsx)(j.A,{children:(0,M.jsxs)(A.A,{sx:{"& th":{backgroundColor:E,color:F,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(H),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,M.jsx)(v.A,{children:"#"}),(0,M.jsx)(v.A,{children:"Client"}),(0,M.jsx)(v.A,{children:"Invoice ID"}),(0,M.jsx)(v.A,{children:"Invoice Date"}),(0,M.jsx)(v.A,{children:"Due Date"}),(0,M.jsx)(v.A,{align:"center",children:"Items"}),(0,M.jsx)(v.A,{align:"right",children:"Amount"}),(0,M.jsx)(v.A,{align:"center",children:"Action"})]})}),(0,M.jsxs)(w.A,{children:[be&&(0,M.jsx)(R.r,{col:4}),be||0!==ke.length?ke.map(((e,o)=>{var r;const n=2===ie||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==ie;return(0,M.jsxs)(A.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(N),py:{xs:1,md:1.5},px:{xs:1,md:2},verticalAlign:"top"},"&:hover":{backgroundColor:E}},children:[(0,M.jsx)(v.A,{children:(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:B},children:String(Ce*re+o+1).padStart(2,"0")})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,M.jsx)(V,{color:q,size:36,children:(0,M.jsx)(k.Itr,{size:18})}),(0,M.jsxs)(x.A,{spacing:.25,sx:{minWidth:0},children:[(0,M.jsx)(h.A,{variant:"subtitle2",sx:{fontWeight:700,color:L,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"}),e.contactperson&&(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},children:e.contactperson})]})]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,M.jsx)(k.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{spacing:.25,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:L,whiteSpace:"nowrap"},children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,pl:2},children:e.transactiondate?l()(e.transactiondate).utc().format("hh:mm A"):""})]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{spacing:.25,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:n&&3!==ie?"#ef4444":B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==ie?"#ef4444":L,whiteSpace:"nowrap"},children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,pl:2},children:e.duedate?l()(e.duedate).utc().format("hh:mm A"):""})]})}),(0,M.jsx)(v.A,{align:"center",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:G("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,M.jsx)(k.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})}),(0,M.jsx)(v.A,{align:"right",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G(q),border:"1px solid ".concat(X(q)),color:q,fontSize:11,fontWeight:800,minWidth:110,justifyContent:"center"},children:[(0,M.jsx)(k.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,M.jsx)(v.A,{align:"center",children:(0,M.jsx)(g.A,{title:"Preview invoice",placement:"left",children:(0,M.jsx)(f.A,{size:"small",onClick:()=>{le(!0),setTimeout((()=>{le(!1),T("/nearle/invoice/preview",{state:e})}),500)},sx:{bgcolor:O(q),color:q,border:"1px solid ".concat(X(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:(0,M.jsx)(k.U3x,{size:16})})})})]},e.invoiceno||o)})):(0,M.jsx)(A.A,{children:(0,M.jsx)(v.A,{colSpan:8,sx:{py:6},children:(0,M.jsxs)(x.A,{alignItems:"center",spacing:1.5,children:[(0,M.jsx)(c.A,{sx:{width:64,height:64,bgcolor:O("#94a3b8"),color:B},children:(0,M.jsx)(k.GdF,{size:28})}),(0,M.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:L},children:"No invoices to show"}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},children:ce?"Try a different keyword.":"No ".concat(Re.label.toLowerCase()," invoices for this filter.")})]})})})]})]})}),(0,M.jsx)(y.A,{}),(0,M.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",sx:{px:2,py:1,background:"linear-gradient(135deg, ".concat(G(q)," 0%, ").concat(G(_)," 100%)")},children:[(0,M.jsxs)(h.A,{variant:"caption",sx:{fontWeight:800,color:F,letterSpacing:.6,textTransform:"uppercase"},children:["Page total \xb7 ",Q(ze)]}),(0,M.jsx)(S.A,{rowsPerPageOptions:[5,10,25,100],component:"div",count:Se.length,rowsPerPage:re,page:Ce,onPageChange:(e,o)=>oe(o),onRowsPerPageChange:e=>{var o;ne(+(null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.value)),oe(0)},sx:{"& .MuiTablePagination-toolbar":{minHeight:40,px:0},"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{fontWeight:700,color:F}}})]})]}),(0,M.jsx)(i.sv,{})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>p});var n=r(89379),i=r(9950),t=r(2660),s=r(2046),l=r(83274),c=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const p=e=>{let{value:o,onChange:r,onDebouncedChange:p,debounceTime:u=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const m=(0,i.useRef)(null),[b]=(0,x.d7)(o,u);return(0,i.useEffect)((()=>{p&&p(b)}),[b,p]),(0,i.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=m.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(t.A,{sx:(0,n.A)({},f),inputRef:m,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},96646:(e,o,r)=>{r.d(o,{r:()=>c});var n=r(9213),i=r(21671),t=r(82917),s=r(93230),l=r(44414);const c=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,l.jsx)(i.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(t.A,{variant:"text",width:100}),(0,l.jsx)(t.A,{variant:"text",width:80})]})},o))),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:150})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(i.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(t.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(t.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]);