Files
dailygrubs_console_build/build/static/js/8597.efd9e8bd.chunk.js

1 line
29 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8597],{68597:function(e,r,n){n.r(r),n.d(r,{default:function(){return we}});var o=n(74165),i=n(15861),t=n(29439),a=n(47313),l=n(56573),s=n(41962),c=n(48119),d=n(61113),x=n(57829),u=n(70501),h=n(42832),p=n(61689),g=n(69099),f=n(9019),Z=n(84488),m=n(54882),j=n(47131),b=n(51629),v=n(66835),w=n(23477),y=n(24076),S=n(67478),k=n(57861),D=n(65033),C=n(19536),W=n(94469),z=n(96467),R=n(22539),M=n(10658),P=n.n(M),B=n(25223),I=n(99004),T=n(59376),A=n(34605),Y=n(78392),N=n(41156),F=n(98589),L=n(79254),E=n(11577),H=n(19860),K=n(71049),O=n(46417),U=n(91635);P().extend(U);var _="0 14px 40px rgba(15, 23, 42, 0.10)",X="0 8px 24px rgba(15, 23, 42, 0.08)",q="#0f172a",V="#64748b",G="#94a3b8",Q="#e2e8f0",J="#f1f5f9",$="#f8fafc",ee=function(e,r){return"".concat(e).concat(r)},re=function(e){return ee(e,"08")},ne=function(e){return ee(e,"18")},oe=function(e){return ee(e,"26")},ie=function(e){return ee(e,"55")},te="#662582",ae="#9255AB",le="#f59e0b",se="#0ea5e9",ce="#6366f1",de="#06b6d4",xe="#8b5cf6",ue="#14b8a6",he="#f97316",pe="#ef4444",ge="#10b981",fe="#f59e0b",Ze="#ef4444",me="#10b981",je=function(e){var r=e.color,n=e.selected,o=e.size,i=void 0===o?24:o,t=e.children;return(0,O.jsx)(c.Z,{sx:{width:i,height:i,bgcolor:n?r:ne(r),color:n?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:t})},be=function(e){var r=e.value,n=e.color,o=e.icon,i=e.isMoney,t=void 0!==i&&i,a=e.minWidth,l=Number(r),s=t?ve(l):Number.isFinite(l)?l:r||0;return!Number.isFinite(l)||0===l?(0,O.jsx)(d.Z,{variant:"caption",sx:{color:G,fontWeight:700},children:s}):(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:re(n),border:"1px solid ".concat(ie(n)),color:n,fontSize:12,fontWeight:800,whiteSpace:"nowrap",minWidth:a},children:[o,s]})};function ve(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function we(){(0,H.Z)();var e=localStorage.getItem("tenantid"),r=(0,a.useState)(P()().format("YYYY-MM-DD")),n=(0,t.Z)(r,2),M=n[0],U=n[1],ee=(0,a.useState)(P()().format("YYYY-MM-DD")),we=(0,t.Z)(ee,2),ye=we[0],Se=we[1],ke=(0,a.useState)(!1),De=(0,t.Z)(ke,2),Ce=De[0],We=De[1],ze=(0,a.useState)("Today"),Re=(0,t.Z)(ze,2),Me=Re[0],Pe=Re[1],Be=(0,a.useState)(0),Ie=(0,t.Z)(Be,2),Te=Ie[0],Ae=Ie[1],Ye=(0,a.useState)([]),Ne=(0,t.Z)(Ye,2),Fe=Ne[0],Le=Ne[1],Ee=(0,a.useState)(null),He=(0,t.Z)(Ee,2),Ke=He[0],Oe=He[1],Ue=(0,a.useState)(""),_e=(0,t.Z)(Ue,2),Xe=_e[0],qe=_e[1],Ve=(0,a.useState)(""),Ge=(0,t.Z)(Ve,2),Qe=Ge[0],Je=Ge[1],$e=(0,a.useRef)(null);(0,a.useEffect)((function(){var e=setTimeout((function(){return Je(Xe)}),350);return function(){return clearTimeout(e)}}),[Xe]),(0,a.useEffect)((function(){var e=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),$e.current&&$e.current.focus()),"Escape"===e.key&&document.activeElement===$e.current&&$e.current.blur()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[]);var er=(0,s.a)({queryKey:[e,M,ye],queryFn:K.RQ}),rr=er.isLoading,nr=er.isError,or=er.data,ir=er.error;(0,a.useEffect)((function(){if(or){var e=0;or.forEach((function(r){e+=Number(r.Deliveryamt||r.deliveryamt||0)})),Ae(e)}}),[or]);var tr=function(){var r=(0,i.Z)((0,o.Z)().mark((function r(n){var i;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,l.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationreportsummary/?&fromdate=").concat(M,"&todate=").concat(ye,"&userid=").concat(n,"&tenantid=").concat(e));case 3:i=r.sent,Le(i.data.details||[]),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.log("tenantRes",r.t0);case 10:case"end":return r.stop()}}),r,null,[[0,7]])})));return function(e){return r.apply(this,arguments)}}();if(nr)return"An error has occurred:(isErrorReports) "+ir.message;var ar=(or||[]).filter((function(e){var r=Qe.trim().toLowerCase();return!r||(String(e.firstname||"").toLowerCase().includes(r)||String(e.lastname||"").toLowerCase().includes(r)||String(e.userid||"").toLowerCase().includes(r))})),lr=ar.reduce((function(e,r){return e.deliveries+=Number(r.totalorders||0),e.pending+=Number(r.pending||0),e.delivered+=Number(r.delivered||0),e.charges+=Number(r.deliveryamt||0),e}),{deliveries:0,pending:0,delivered:0,charges:0}),sr=[{key:"riders",label:"Riders",color:te,icon:R.te,value:ar.length},{key:"deliveries",label:"Deliveries",color:se,icon:R.ili,value:lr.deliveries},{key:"pending",label:"Pending",color:le,icon:R.Ley,value:lr.pending},{key:"delivered",label:"Delivered",color:ge,icon:R.ZSR,value:lr.delivered},{key:"charges",label:"Total Charges",color:te,icon:R.Rtn,value:lr.charges,isMoney:!0}];return(0,O.jsxs)(O.Fragment,{children:[rr&&(0,O.jsx)(E.Z,{}),(0,O.jsx)(u.Z,{elevation:0,sx:{mb:{xs:1,md:1.25},px:{xs:1.5,sm:2},py:{xs:1,sm:1.25},borderRadius:2,border:"1px solid",borderColor:Q,background:"linear-gradient(135deg, ".concat(re(te)," 0%, ").concat(re(ae)," 100%)"),boxShadow:X},children:(0,O.jsxs)(h.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:[(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,O.jsx)(c.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:te,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(oe(te))},children:(0,O.jsx)(R.te,{size:19})}),(0,O.jsxs)(h.Z,{spacing:.125,children:[(0,O.jsx)(d.Z,{variant:"h3",sx:{fontWeight:800,color:q,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Riders Summary"}),(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,O.jsx)(x.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,O.jsxs)(d.Z,{sx:{fontSize:11.5,color:V,fontWeight:600},children:["Live \xb7 ",ar.length," riders \xb7 ",Me]})]})]})]}),(0,O.jsx)(p.Z,{title:"Filter by date range",arrow:!0,children:(0,O.jsx)(g.Z,{onClick:function(){return We(!0)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,O.jsx)(R.sHf,{size:15}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,bgcolor:"#fff",borderColor:Q,color:q,"&:hover":{bgcolor:"#fff",borderColor:te,color:te,boxShadow:"0 0 0 3px ".concat(oe(te))}},children:M&&ye?"".concat(P()(M).format("DD MMM")," \u2013 ").concat(P()(ye).format("DD MMM")):"All time"})})]})}),(0,O.jsx)(f.ZP,{container:!0,spacing:{xs:1,sm:1.25,md:1.5},children:sr.map((function(e){var r=e.icon;return(0,O.jsx)(f.ZP,{item:!0,xs:6,sm:6,md:"charges"===e.key?4:2,children:(0,O.jsxs)(u.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",px:{xs:1.25,sm:1.5},py:{xs:.875,sm:1.125},borderRadius:2,border:"1px solid",borderColor:Q,background:"#fff",transition:"transform 0.15s, box-shadow 0.15s, border-color 0.15s","&:hover":{transform:"translateY(-1px)",boxShadow:X,borderColor:ie(e.color)}},children:[(0,O.jsx)(x.Z,{sx:{position:"absolute",top:0,left:0,bottom:0,width:3,background:e.color}}),(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{pl:.5},children:[(0,O.jsxs)(h.Z,{spacing:.125,sx:{minWidth:0,flex:1},children:[(0,O.jsx)(d.Z,{sx:{color:V,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:10.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.2},children:e.label}),(0,O.jsx)(d.Z,{sx:{fontWeight:800,color:q,lineHeight:1.15,fontSize:{xs:"0.95rem",sm:"1.1rem",md:"1.2rem"}},noWrap:!0,children:rr?(0,O.jsx)(Z.Z,{sx:{width:40},animation:"wave"}):e.isMoney?ve(e.value):e.value})]}),(0,O.jsx)(c.Z,{variant:"rounded",sx:{width:30,height:30,bgcolor:ne(e.color),color:e.color,borderRadius:1.25,flexShrink:0},children:(0,O.jsx)(r,{size:15})})]})]})},e.key)}))}),(0,O.jsx)(u.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:1,md:1.125},borderRadius:2,border:"1px solid",borderColor:Q,background:"#fff",boxShadow:_},children:(0,O.jsxs)(h.Z,{direction:{xs:"column",md:"row"},spacing:1.25,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",children:[(0,O.jsx)(x.Z,{sx:{width:{xs:"100%",md:360}},children:(0,O.jsxs)(x.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:re(te),border:"1.5px solid ".concat(ie(te)),transition:"all 0.18s","&:focus-within":{borderColor:te,boxShadow:"0 0 0 3px ".concat(oe(te))}},children:[(0,O.jsx)(R.vU7,{size:16,style:{color:te,flexShrink:0}}),(0,O.jsx)(m.ZP,{inputRef:$e,placeholder:"Search rider name (ctrl+k)",value:Xe,onChange:function(e){return qe(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:q,"& input::placeholder":{color:G,opacity:1}}}),Xe&&(0,O.jsx)(j.Z,{size:"small",onClick:function(){return qe("")},sx:{p:.25,color:te},children:(0,O.jsx)(R.lUB,{size:14})})]})}),(0,O.jsxs)(h.Z,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:re(te),border:"1px solid ".concat(ie(te)),color:te,fontSize:11,fontWeight:800},children:[(0,O.jsx)(R.VHP,{size:12})," Orders \xb7 ",Me]}),M&&ye&&(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:re("#f59e0b"),border:"1px solid ".concat(ie("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,O.jsx)(R.dKE,{size:12})," ",P()(M).format("DD/MM/YY")," \u2013 ",P()(ye).format("DD/MM/YY")]})]})]})}),(0,O.jsxs)(u.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},borderRadius:2,border:"1px solid",borderColor:Q,overflow:"hidden",background:"#fff"},children:[(0,O.jsx)(b.Z,{sx:{minHeight:320,maxHeight:{xs:"calc(100vh - 320px)",md:"calc(100vh - 300px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:ie(te),borderRadius:8,"&:hover":{backgroundColor:te}},"&::-webkit-scrollbar-track":{backgroundColor:$}},children:(0,O.jsxs)(v.Z,{stickyHeader:!0,size:"small",sx:{minWidth:1300},children:[(0,O.jsx)(w.Z,{children:(0,O.jsxs)(y.Z,{sx:{"& th":{backgroundColor:$,color:V,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Q),py:.75,px:1}},children:[(0,O.jsx)(S.Z,{children:"#"}),(0,O.jsx)(S.Z,{children:"Rider"}),(0,O.jsx)(S.Z,{align:"center",children:"Deliveries"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(le," !important")},children:"Pending"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(se," !important")},children:"Assigned"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(ce," !important")},children:"Accepted"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(de," !important")},children:"Arrived"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(xe," !important")},children:"Picked"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(ue," !important")},children:"Active"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(he," !important")},children:"Skipped"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(pe," !important")},children:"Cancelled"}),(0,O.jsx)(S.Z,{align:"center",sx:{color:"".concat(ge," !important")},children:"Delivered"}),(0,O.jsx)(S.Z,{align:"center",children:"Kms"}),(0,O.jsx)(S.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(S.Z,{align:"right",children:"Charges"}),(0,O.jsx)(S.Z,{align:"center",children:"Action"})]})}),(0,O.jsxs)(k.Z,{children:[rr&&0===ar.length&&Array.from({length:10}).map((function(e,r){return(0,O.jsx)(y.Z,{children:Array.from({length:16}).map((function(e,r){return(0,O.jsx)(S.Z,{sx:{borderBottom:"1px solid ".concat(J),py:.625,px:1},children:(0,O.jsx)(Z.Z,{animation:"wave",height:20})},r)}))},"sk-".concat(r))})),!rr&&0===ar.length&&(0,O.jsx)(y.Z,{children:(0,O.jsx)(S.Z,{colSpan:16,sx:{py:7,borderBottom:"none"},children:(0,O.jsxs)(h.Z,{alignItems:"center",spacing:1.25,children:[(0,O.jsx)(c.Z,{variant:"rounded",sx:{width:56,height:56,bgcolor:ne("#94a3b8"),color:G,borderRadius:2},children:(0,O.jsx)(R.te,{size:26})}),(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:q,fontSize:14},children:"No riders to show"}),(0,O.jsx)(d.Z,{sx:{color:V,fontSize:12},children:Xe?"Try a different rider name or clear the search.":"Adjust the date range above."}),Xe&&(0,O.jsx)(g.Z,{size:"small",onClick:function(){return qe("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:te,borderRadius:1.25,"&:hover":{bgcolor:re(te)}},startIcon:(0,O.jsx)(R.lUB,{size:14}),children:"Clear search"})]})})}),ar.map((function(e,r){return(0,O.jsxs)(a.Fragment,{children:[(0,O.jsxs)(y.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s","& td":{borderBottom:"1px solid ".concat(J),py:.625,px:1,verticalAlign:"middle"},backgroundColor:Ke===e.userid?re(te):"transparent",boxShadow:Ke===e.userid?"inset 3px 0 0 ".concat(te):"none","&:hover":{backgroundColor:Ke===e.userid?ne(te):re(te),boxShadow:"inset 3px 0 0 ".concat(te)}},children:[(0,O.jsx)(S.Z,{children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,fontSize:12,color:G},children:r+1})}),(0,O.jsx)(S.Z,{children:(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,O.jsx)(je,{color:te,size:28,selected:!0,children:String(e.firstname||"?").charAt(0).toUpperCase()}),(0,O.jsxs)(h.Z,{spacing:.125,children:[(0,O.jsxs)(d.Z,{sx:{fontSize:12.5,fontWeight:700,color:q,lineHeight:1.25},noWrap:!0,children:[e.firstname," ",e.lastname]}),(0,O.jsxs)(d.Z,{sx:{fontSize:10.5,fontWeight:600,color:G,lineHeight:1.3},children:["Id : ",e.userid]})]})]})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.totalorders,color:te,icon:(0,O.jsx)(R.ByW,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.pending,color:le,icon:(0,O.jsx)(R.Ley,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.assigned,color:se,icon:(0,O.jsx)(R.Z5O,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.accepted,color:ce,icon:(0,O.jsx)(R.ZSR,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.arrived,color:de,icon:(0,O.jsx)(R.ZSR,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.picked,color:xe,icon:(0,O.jsx)(R.ili,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.active,color:ue,icon:(0,O.jsx)(R.ili,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.skipped,color:he,icon:(0,O.jsx)(R.B4e,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.cancelled,color:pe,icon:(0,O.jsx)(R.B4e,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.delivered,color:ge,icon:(0,O.jsx)(R.ZSR,{size:11})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(p.Z,{title:"Cumulative Kms",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:fe,icon:(0,O.jsx)(R.v93,{size:11})})})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsxs)(h.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(p.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.payondelivery,color:Ze,icon:(0,O.jsx)(R.vCl,{size:11}),isMoney:!0})})}),(0,O.jsx)(p.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.Paylater,color:me,icon:(0,O.jsx)(R.vCl,{size:11}),isMoney:!0})})})]})}),(0,O.jsx)(S.Z,{align:"right",children:(0,O.jsx)(p.Z,{title:"Total Charges",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.deliveryamt,color:te,icon:(0,O.jsx)(R.vCl,{size:11}),isMoney:!0})})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(p.Z,{title:Ke===e.userid?"Collapse locations":"View locations",children:(0,O.jsx)(j.Z,{size:"small",onClick:function(){tr(e.userid),Oe(Ke===e.userid?null:e.userid)},sx:{bgcolor:Ke===e.userid?te:re(te),border:"1px solid ".concat(Ke===e.userid?te:ie(te)),color:Ke===e.userid?"#fff":te,borderRadius:999,p:.75,transition:"all 0.18s","&:hover":{bgcolor:Ke===e.userid?te:ne(te),borderColor:te,boxShadow:"0 0 0 3px ".concat(oe(te))}},children:Ke===e.userid?(0,O.jsx)(R.rWj,{size:14}):(0,O.jsx)(R.Ix0,{size:14})})})})]}),Ke===e.userid&&(0,O.jsx)(y.Z,{children:(0,O.jsx)(S.Z,{colSpan:16,sx:{p:0,borderBottom:"1px solid ".concat(J),bgcolor:$},children:(0,O.jsx)(D.Z,{in:Ke===e.userid,timeout:"auto",unmountOnExit:!0,children:(0,O.jsxs)(x.Z,{sx:{p:{xs:1.5,md:2}},children:[(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,O.jsx)(je,{color:te,size:22,selected:!0,children:(0,O.jsx)(R.c7Z,{size:12})}),(0,O.jsxs)(d.Z,{variant:"subtitle2",sx:{fontWeight:800,color:q},children:["Locations \xb7 ",e.firstname," ",e.lastname]})]}),(0,O.jsx)(u.Z,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:Q,overflow:"hidden",background:"#fff"},children:(0,O.jsxs)(v.Z,{size:"small",children:[(0,O.jsx)(w.Z,{children:(0,O.jsxs)(y.Z,{sx:{"& th":{backgroundColor:re(te),color:te,fontSize:10.5,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(ie(te)),py:.75}},children:[(0,O.jsx)(S.Z,{align:"center",children:"#"}),(0,O.jsx)(S.Z,{children:"Location"}),(0,O.jsx)(S.Z,{align:"center",children:"All"}),(0,O.jsx)(S.Z,{align:"center",children:"Pending"}),(0,O.jsx)(S.Z,{align:"center",children:"Completed"}),(0,O.jsx)(S.Z,{align:"center",children:"Cancelled"}),(0,O.jsx)(S.Z,{align:"center",children:"Kms"}),(0,O.jsx)(S.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(S.Z,{align:"right",children:"Amount"})]})}),(0,O.jsx)(k.Z,{children:Fe&&Fe.length>0?Fe.map((function(e,r){return(0,O.jsxs)(y.Z,{sx:{"& td":{borderBottom:"1px solid ".concat(J),py:.5,px:1},"&:hover":{backgroundColor:re(te),boxShadow:"inset 3px 0 0 ".concat(te)}},children:[(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:V,fontSize:12},children:r+1})}),(0,O.jsx)(S.Z,{children:(0,O.jsxs)(h.Z,{children:[(0,O.jsx)(d.Z,{variant:"caption",sx:{fontWeight:700,color:q},noWrap:!0,children:e.locationname}),(0,O.jsxs)(d.Z,{variant:"caption",sx:{color:G,fontSize:10},children:["Id : ",e.locationid]})]})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.totalorders,color:te,icon:(0,O.jsx)(R.ByW,{size:10})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriespending,color:le,icon:(0,O.jsx)(R.Ley,{size:10})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriescompleted,color:ge,icon:(0,O.jsx)(R.ZSR,{size:10})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriescancelled,color:pe,icon:(0,O.jsx)(R.B4e,{size:10})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsx)(be,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:fe,icon:(0,O.jsx)(R.v93,{size:10})})}),(0,O.jsx)(S.Z,{align:"center",children:(0,O.jsxs)(h.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(p.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.payondelivery,color:Ze,icon:(0,O.jsx)(R.vCl,{size:10}),isMoney:!0})})}),(0,O.jsx)(p.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.paylater,color:me,icon:(0,O.jsx)(R.vCl,{size:10}),isMoney:!0})})})]})}),(0,O.jsx)(S.Z,{align:"right",children:(0,O.jsx)(be,{value:e.charges,color:te,icon:(0,O.jsx)(R.vCl,{size:10}),isMoney:!0})})]},"".concat(e.locationid,"-").concat(r))})):(0,O.jsx)(y.Z,{children:(0,O.jsx)(S.Z,{colSpan:9,sx:{py:3,borderBottom:"none"},children:(0,O.jsxs)(h.Z,{alignItems:"center",spacing:1,children:[(0,O.jsx)(c.Z,{sx:{width:40,height:40,bgcolor:ne("#94a3b8"),color:G},children:(0,O.jsx)(R.c7Z,{size:18})}),(0,O.jsx)(d.Z,{variant:"caption",sx:{color:V,fontWeight:700},children:"No location data for this rider"})]})})})})]})})]})})})})]},"".concat(e.userid,"-").concat(r))}))]})]})}),(0,O.jsx)(C.Z,{}),ar.length>0&&(0,O.jsx)(h.Z,{direction:{xs:"column",sm:"row"},spacing:1.25,alignItems:"center",justifyContent:"flex-end",sx:{p:{xs:1.25,md:1.75},background:"linear-gradient(135deg, ".concat(re(te)," 0%, ").concat(re(ae)," 100%)"),borderTop:"1px solid ".concat(ie(te))},children:(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:"#fff",border:"1.5px solid ".concat(ie(te)),color:te,fontWeight:800,fontSize:13},children:[(0,O.jsx)(R.Rtn,{size:13})," Total Amount \xb7 ",ve(Te)]})})]}),(0,O.jsxs)(W.Z,{open:Ce,onClose:function(){return We(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,O.jsx)(x.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(re(te)," 0%, ").concat(re(ae)," 100%)"),borderBottom:"1px solid ".concat(Q)},children:(0,O.jsxs)(h.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,O.jsx)(c.Z,{sx:{bgcolor:te,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(oe(te))},children:(0,O.jsx)(R.sHf,{size:20})}),(0,O.jsxs)(h.Z,{children:[(0,O.jsx)(d.Z,{variant:"h5",sx:{fontWeight:800,color:q},children:"Select Date Range"}),(0,O.jsx)(d.Z,{variant:"caption",sx:{color:V,fontWeight:600},children:"Filter rider activity by a date range or preset"})]})]})}),(0,O.jsx)(z.Z,{sx:{width:"100%"},className:"datedialog",children:(0,O.jsx)(B.D,{open:Ce,toggle:function(){return We(!Ce)},id:"daterange1",onChange:function(e){"All"===e.label?(U(""),Se(""),Pe("All"),We(!1)):(U(P()(e.startDate).format("YYYY-MM-DD")),Se(P()(e.endDate).format("YYYY-MM-DD")),Pe(e.label||""))},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,I.Z)(new Date,-1),endDate:(0,I.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,I.Z)(new Date,1),endDate:(0,I.Z)(new Date,1)},{label:"This Week",startDate:(0,T.Z)(new Date),endDate:(0,A.Z)(new Date)},{label:"Last Week",startDate:(0,T.Z)((0,Y.Z)(new Date,-1)),endDate:(0,A.Z)((0,Y.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,Y.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,N.Z)(new Date),endDate:(0,F.Z)(new Date)},{label:"Last Month",startDate:(0,N.Z)((0,L.Z)(new Date,-1)),endDate:(0,F.Z)((0,L.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,I.Z)(new Date,-1)}]})}),(0,O.jsxs)(h.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat(J)},children:[(0,O.jsx)(g.Z,{variant:"outlined",onClick:function(){return We(!1)},sx:{borderRadius:999,px:2.5,borderColor:Q,color:V,fontWeight:700,"&:hover":{borderColor:V,bgcolor:$}},children:"Cancel"}),(0,O.jsx)(g.Z,{variant:"contained",onClick:function(){return We(!1)},sx:{borderRadius:999,px:3,bgcolor:te,fontWeight:700,boxShadow:"0 6px 18px ".concat(oe(te)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]})]})}},96467:function(e,r,n){n.d(r,{Z:function(){return m}});var o=n(4942),i=n(63366),t=n(87462),a=n(47313),l=n(83061),s=n(21921),c=n(17592),d=n(77342),x=n(77430),u=n(32298);function h(e){return(0,u.Z)("MuiDialogContent",e)}(0,x.Z)("MuiDialogContent",["root","dividers"]);var p=n(93174),g=n(46417),f=["className","dividers"],Z=(0,c.ZP)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return[r.root,n.dividers&&r.dividers]}})((function(e){var r=e.theme,n=e.ownerState;return(0,t.Z)({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},n.dividers?{padding:"16px 24px",borderTop:"1px solid ".concat((r.vars||r).palette.divider),borderBottom:"1px solid ".concat((r.vars||r).palette.divider)}:(0,o.Z)({},".".concat(p.Z.root," + &"),{paddingTop:0}))})),m=a.forwardRef((function(e,r){var n=(0,d.Z)({props:e,name:"MuiDialogContent"}),o=n.className,a=n.dividers,c=void 0!==a&&a,x=(0,i.Z)(n,f),u=(0,t.Z)({},n,{dividers:c}),p=function(e){var r=e.classes,n={root:["root",e.dividers&&"dividers"]};return(0,s.Z)(n,h,r)}(u);return(0,g.jsx)(Z,(0,t.Z)({className:(0,l.Z)(p.root,o),ownerState:u,ref:r},x))}))},93174:function(e,r,n){n.d(r,{a:function(){return t}});var o=n(77430),i=n(32298);function t(e){return(0,i.Z)("MuiDialogTitle",e)}var a=(0,o.Z)("MuiDialogTitle",["root"]);r.Z=a},94469:function(e,r,n){var o=n(4942),i=n(63366),t=n(87462),a=n(47313),l=n(83061),s=n(21921),c=n(28334),d=n(91615),x=n(10387),u=n(32530),h=n(70501),p=n(77342),g=n(17592),f=n(85560),Z=n(63909),m=n(91554),j=n(19860),b=n(46417),v=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],w=(0,g.ZP)(m.Z,{name:"MuiDialog",slot:"Backdrop",overrides:function(e,r){return r.backdrop}})({zIndex:-1}),y=(0,g.ZP)(x.Z,{name:"MuiDialog",slot:"Root",overridesResolver:function(e,r){return r.root}})({"@media print":{position:"absolute !important"}}),S=(0,g.ZP)("div",{name:"MuiDialog",slot:"Container",overridesResolver:function(e,r){var n=e.ownerState;return[r.container,r["scroll".concat((0,d.Z)(n.scroll))]]}})((function(e){var r=e.ownerState;return(0,t.Z)({height:"100%","@media print":{height:"auto"},outline:0},"paper"===r.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===r.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})})),k=(0,g.ZP)(h.Z,{name:"MuiDialog",slot:"Paper",overridesResolver:function(e,r){var n=e.ownerState;return[r.paper,r["scrollPaper".concat((0,d.Z)(n.scroll))],r["paperWidth".concat((0,d.Z)(String(n.maxWidth)))],n.fullWidth&&r.paperFullWidth,n.fullScreen&&r.paperFullScreen]}})((function(e){var r=e.theme,n=e.ownerState;return(0,t.Z)({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===n.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===n.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!n.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===n.maxWidth&&(0,o.Z)({maxWidth:"px"===r.breakpoints.unit?Math.max(r.breakpoints.values.xs,444):"".concat(r.breakpoints.values.xs).concat(r.breakpoints.unit)},"&.".concat(f.Z.paperScrollBody),(0,o.Z)({},r.breakpoints.down(Math.max(r.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})),n.maxWidth&&"xs"!==n.maxWidth&&(0,o.Z)({maxWidth:"".concat(r.breakpoints.values[n.maxWidth]).concat(r.breakpoints.unit)},"&.".concat(f.Z.paperScrollBody),(0,o.Z)({},r.breakpoints.down(r.breakpoints.values[n.maxWidth]+64),{maxWidth:"calc(100% - 64px)"})),n.fullWidth&&{width:"calc(100% - 64px)"},n.fullScreen&&(0,o.Z)({margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0},"&.".concat(f.Z.paperScrollBody),{margin:0,maxWidth:"100%"}))})),D=a.forwardRef((function(e,r){var n=(0,p.Z)({props:e,name:"MuiDialog"}),o=(0,j.Z)(),x={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},g=n["aria-describedby"],m=n["aria-labelledby"],D=n.BackdropComponent,C=n.BackdropProps,W=n.children,z=n.className,R=n.disableEscapeKeyDown,M=void 0!==R&&R,P=n.fullScreen,B=void 0!==P&&P,I=n.fullWidth,T=void 0!==I&&I,A=n.maxWidth,Y=void 0===A?"sm":A,N=n.onBackdropClick,F=n.onClose,L=n.open,E=n.PaperComponent,H=void 0===E?h.Z:E,K=n.PaperProps,O=void 0===K?{}:K,U=n.scroll,_=void 0===U?"paper":U,X=n.TransitionComponent,q=void 0===X?u.Z:X,V=n.transitionDuration,G=void 0===V?x:V,Q=n.TransitionProps,J=(0,i.Z)(n,v),$=(0,t.Z)({},n,{disableEscapeKeyDown:M,fullScreen:B,fullWidth:T,maxWidth:Y,scroll:_}),ee=function(e){var r=e.classes,n=e.scroll,o=e.maxWidth,i=e.fullWidth,t=e.fullScreen,a={root:["root"],container:["container","scroll".concat((0,d.Z)(n))],paper:["paper","paperScroll".concat((0,d.Z)(n)),"paperWidth".concat((0,d.Z)(String(o))),i&&"paperFullWidth",t&&"paperFullScreen"]};return(0,s.Z)(a,f.D,r)}($),re=a.useRef(),ne=(0,c.Z)(m),oe=a.useMemo((function(){return{titleId:ne}}),[ne]);return(0,b.jsx)(y,(0,t.Z)({className:(0,l.Z)(ee.root,z),closeAfterTransition:!0,components:{Backdrop:w},componentsProps:{backdrop:(0,t.Z)({transitionDuration:G,as:D},C)},disableEscapeKeyDown:M,onClose:F,open:L,ref:r,onClick:function(e){re.current&&(re.current=null,N&&N(e),F&&F(e,"backdropClick"))},ownerState:$},J,{children:(0,b.jsx)(q,(0,t.Z)({appear:!0,in:L,timeout:G,role:"presentation"},Q,{children:(0,b.jsx)(S,{className:(0,l.Z)(ee.container),onMouseDown:function(e){re.current=e.target===e.currentTarget},ownerState:$,children:(0,b.jsx)(k,(0,t.Z)({as:H,elevation:24,role:"dialog","aria-describedby":g,"aria-labelledby":ne},O,{className:(0,l.Z)(ee.paper,O.className),ownerState:$,children:(0,b.jsx)(Z.Z.Provider,{value:oe,children:W})}))})}))}))}));r.Z=D},63909:function(e,r,n){var o=n(47313).createContext({});r.Z=o},85560:function(e,r,n){n.d(r,{D:function(){return t}});var o=n(77430),i=n(32298);function t(e){return(0,i.Z)("MuiDialog",e)}var a=(0,o.Z)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);r.Z=a},41962:function(e,r,n){n.d(r,{a:function(){return t}});var o=n(18948),i=n(51695);function t(e,r){return(0,i.r)(e,o.z,r)}}}]);