Files
Express_console_build/build/static/js/4263.b73de124.chunk.js
2026-05-25 16:32:21 +05:30

1 line
7.6 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4263],{14263:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var i=r(9950),n=r(14857),o=r(47223),s=r(16491),a=r(71525),l=r(249),c=r(26050),d=r(38614),h=r(93038),x=r(83563),u=r(74745),p=r(82917),g=r(93230),m=r(82053),v=r(88060),A=r(83239),j=r(25333),y=r(82223),f=r(99624),w=r(89379),b=r(25979),k=r(2660),C=r(2046),S=r(33425),z=r(7762),E=r(44414);const Y=e=>{let{value:t,onChange:r,sx:o,placeholder:s="Search (Ctrl + K)",delay:a=300}=e;const l=(0,n.A)(),c=(0,i.useRef)(null),[d,h]=(0,i.useState)(t||"");return(0,i.useEffect)((()=>{h(t||"")}),[t]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{d!==t&&r({target:{value:d}})}),a);return()=>clearTimeout(e)}),[d]),(0,i.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=c.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===c.current&&c.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,E.jsx)(b.A,{fullWidth:!0,children:(0,E.jsx)(k.A,{inputRef:c,placeholder:s,sx:(0,w.A)({borderRadius:0},o),value:d,onChange:e=>h(e.target.value),autoComplete:"off",size:"large",startAdornment:(0,E.jsx)(C.A,{position:"start",sx:{mr:-.5,color:l.palette.secondary.main},children:(0,E.jsx)(S.A,{})}),endAdornment:(0,E.jsx)(j.A,{sx:{visibility:d?"visible":"hidden"},onClick:()=>h(""),children:(0,E.jsx)(z.A,{style:{fontSize:"large",color:l.palette.primary.main}})})})})};var R=r(36150),I=r(81425),M=r(10523);const L={width:"100%",height:"calc(100vh - 150px)"};function W(e){var t,r;let{riderLocations:i}=e;console.log("riderLocations",i);const n={lat:Number((null===i||void 0===i||null===(t=i[0])||void 0===t?void 0:t.latitude)||11.0056),lng:Number((null===i||void 0===i||null===(r=i[0])||void 0===r?void 0:r.longitude)||76.9661)},o={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)},s={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)};return(0,E.jsx)(M.BH,{googleMapsApiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",children:(0,E.jsx)(M.u6,{mapContainerStyle:L,zoom:12,center:n,children:i&&(null===i||void 0===i?void 0:i.map(((e,t)=>{const r=Number(e.latitude),i=Number(e.longitude);return(0,E.jsxs)("div",{children:[(0,E.jsx)(M.pH,{position:{lat:r,lng:i},icon:"active"==e.status?o:s,label:{fontSize:"14px",fontWeight:"bold"}}),(0,E.jsx)(M.i3,{position:{lat:r,lng:i},mapPaneName:M.i3.OVERLAY_LAYER,children:(0,E.jsx)("div",{style:{background:"none",color:"green",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",transform:"translate(-50%, -140%)",pointerEvents:"none",ml:20},children:(0,E.jsxs)(y.A,{variant:"contained",color:"primary",size:"small",children:[" ".concat(e.username," "),(0,E.jsx)("br",{}),"(".concat(e.orderid||"",") ")]})})})]},t)})))})})}var D=r(50027),K=r(4159),_=r.n(K),F=r(96088);const H=350,N=()=>{const e=(0,n.A)(),t=(0,o.A)("(min-width:900px)"),[r,w]=(0,i.useState)(!1),[b,k]=(0,i.useState)([]),[C,S]=(0,i.useState)(""),{data:z,isLoading:M,isFetching:L,refetch:K,error:N}=(0,R.I)({queryKey:[1,_()().format("YYYY-MM-DD"),C],queryFn:I.zb,refetchInterval:3e5});return(0,i.useEffect)((()=>{k(z)}),[z]),(0,i.useEffect)((()=>{console.log("selectedRiders",b)}),[b]),(0,i.useEffect)((()=>{w(t)}),[t]),(0,E.jsx)(D.A,{content:!1,children:(0,E.jsxs)(s.A,{sx:{display:"flex",width:"100%",height:"100%",position:"relative"},children:[(0,E.jsxs)(a.Ay,{variant:t?"persistent":"temporary",open:r,onClose:()=>!t&&w(!1),ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:H,position:"absolute",left:0,top:0,height:"100%",overflowY:"auto",transition:"transform 0.35s ease-in-out",zIndex:13}},children:[(0,E.jsxs)(s.A,{sx:{position:"sticky",top:0,zIndex:1},children:[(0,E.jsx)(Y,{value:C,placeholder:"Search Rider",onChange:e=>S(e.target.value),sx:{height:60,bgcolor:"white","& .MuiOutlinedInput-notchedOutline":{borderBottom:"1px solid",borderColor:e.palette.secondary.light}}}),(0,E.jsxs)(l.A,{children:[(0,E.jsxs)(c.Ay,{sx:{cursor:"pointer","&:hover":{bgcolor:e.palette.secondary.lighter},bgcolor:"white",mt:-1},children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(h.A,{checked:(null===z||void 0===z?void 0:z.length)==(null===b||void 0===b?void 0:b.length),onChange:e=>{e.target.checked&&k(z)}})}),(0,E.jsx)(x.A,{primary:"All"})]}),(0,E.jsx)(u.A,{})]})]}),(0,E.jsx)(l.A,{children:M||L?Array.from({length:10}).map(((e,t)=>(0,E.jsxs)(i.Fragment,{children:[(0,E.jsxs)(c.Ay,{sx:{py:1.5,px:2},children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(p.A,{variant:"circular",width:24,height:24})}),(0,E.jsx)(x.A,{primary:(0,E.jsx)(p.A,{variant:"text",width:"60%",height:22}),secondary:(0,E.jsx)(p.A,{variant:"text",width:"40%",height:18})}),(0,E.jsxs)(g.A,{spacing:.5,textAlign:"right",children:[(0,E.jsx)(p.A,{variant:"text",width:50,height:18}),(0,E.jsx)(p.A,{variant:"text",width:80,height:16})]})]}),(0,E.jsx)(u.A,{})]},t))):null===z||void 0===z?void 0:z.map((t=>{var r,n,o;return(0,E.jsxs)(i.Fragment,{children:[(0,E.jsxs)(c.Ay,{sx:{cursor:"pointer",py:1,px:2,borderRadius:1,"&:hover":{bgcolor:e.palette.secondary.lighter}},secondaryAction:(0,E.jsxs)(g.A,{textAlign:"right",spacing:.5,children:[(0,E.jsx)(m.A,{variant:"body2",noWrap:!0,sx:{color:"active"==t.status?"success.main":"error.main"},children:t.userid}),(0,E.jsx)(m.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:_()(t.logdate).format("DD/MM/YYYY hh:mm A")})]}),children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(h.A,{sx:{color:"active"==t.status?"green":"red","&.Mui-checked":{color:"active"==t.status?"green":"red"}},checked:1===(null===b||void 0===b?void 0:b.length)&&(null===(r=b[0])||void 0===r?void 0:r.userid)===(null===t||void 0===t?void 0:t.userid),onChange:e=>{e.target.checked?k([t]):k(z)}})}),(0,E.jsx)(x.A,{primary:(0,E.jsxs)(m.A,{noWrap:!0,children:[(null===(n=t.username)||void 0===n?void 0:n.slice(0,25))||"",(null===(o=t.username)||void 0===o?void 0:o.length)>25&&"..."]}),secondary:(0,E.jsx)(m.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:t.contactno||"##########"})})]}),(0,E.jsx)(u.A,{})]},t.userid)}))})]}),(0,E.jsx)(v.A,{elevation:0,position:"absolute",sx:{top:0,left:r&&t?"".concat(H,"px"):0,width:r&&t?"calc(100% - ".concat(H,"px)"):"100%",transition:"left 0.3s ease, width 0.3s ease",backgroundColor:"white",borderBottom:"1px solid",borderColor:e.palette.secondary.light},children:(0,E.jsx)(A.A,{children:(0,E.jsxs)(g.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{width:"100%"},children:[(0,E.jsxs)(g.A,{direction:"row",alignItems:"center",children:[(0,E.jsx)(j.A,{color:"primary",onClick:()=>w(!r),children:(0,E.jsx)(f.A,{})}),(0,E.jsx)(m.A,{variant:"h5",color:"primary",sx:{ml:2},children:"Riders Locations"})]}),(0,E.jsx)(y.A,{variant:"outlined",color:"primary",onClick:()=>{K()},children:"Refresh"})]})})}),(0,E.jsxs)(s.A,{sx:{flexGrow:1,overflow:"auto",pt:"64px",pl:r&&t?"".concat(H,"px"):0,transition:"padding-left 0.3s ease",minHeight:"80vh"},children:[(M||L)&&(0,E.jsx)(s.A,{position:"relative",width:"100%",height:"80vh",display:"grid",placeItems:"center",children:(0,E.jsx)(p.A,{variant:"rectangular",width:"100%",height:"100%",animation:"wave",sx:{position:"absolute",top:0,left:0,borderRadius:1,zIndex:1}})}),(null===b||void 0===b?void 0:b.length)>0&&(0,E.jsx)(W,{riderLocations:b}),N&&(0,E.jsx)(s.A,{sx:{width:"100% ",height:"100%"},children:(0,E.jsx)("img",{src:F,alt:"mantis",style:{height:"100%",width:"100%"}})})]})]})})}},96088:(e,t,r)=>{e.exports=r.p+"static/media/Error500.1619a596c73d5cce4899.png"}}]);