Files
dailygrubs_console_build/build/static/js/8675.38b207b2.chunk.js

1 line
38 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8675],{7519:function(e,t,o){o.d(t,{ZZ:function(){return x}});var r=o(1413),n=(o(47313),o(17592)),i=o(61689),l=o(69099),c=o(85281),s=o(42832),a=o(36287),d=o(53245),u=o(6986),h=o(46417),x=((0,n.ZP)("div")((function(e){var t=e.theme,o=e.x,r=e.y;return{color:t.palette.text.secondary,position:"fixed",pointerEvents:"none",left:12,top:24,transform:"translate(".concat(o,"px, ").concat(r,"px)"),opacity:.6}})),function(e){var t=e.data,o=e.filename,n=e.headers,s=e.label,a=e.style,x=e.btnLoading,p=e.onClick;return(0,h.jsx)(d.CSVLink,{data:t,filename:o,headers:n,children:(0,h.jsx)(i.Z,{title:"CSV Export",children:(0,h.jsx)(l.Z,{startIcon:!x&&(0,h.jsx)(u.Z,{}),variant:x?"outlined":"contained",sx:(0,r.Z)({},a),disabled:x,onClick:function(e){null===p||void 0===p||p(e)},children:x?(0,h.jsx)(c.Z,{size:20,thickness:5}):s||"Download"})})})});(0,n.ZP)(s.Z)((function(e){var t=e.theme;return{height:"400px","& .ant-empty-img-1":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary[200]:t.palette.secondary[400]},"& .ant-empty-img-2":{fill:t.palette.secondary.light},"& .ant-empty-img-3":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary.A200:t.palette.secondary[200]},"& .ant-empty-img-4":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary.A300:t.palette.secondary.A100},"& .ant-empty-img-5":{fillOpacity:t.palette.mode===a.hY.DARK?"0.09":"0.95",fill:t.palette.mode===a.hY.DARK?t.palette.secondary.darker:t.palette.secondary.light}}}))},78457:function(e,t,o){o.r(t),o.d(t,{default:function(){return Te}});var r=o(74165),n=o(15861),i=o(4942),l=o(29439),c=o(1413),s=o(47313),a=o(56573),d=o(25963),u=o(41962),h=o(19860),x=(o(90842),o(70501)),p=o(48119),f=o(57829),g=o(61113),m=o(42832),b=o(61689),v=o(69099),Z=o(9019),j=o(84488),y=o(76088),w=o(16783),k=o(54882),S=o(47131),W=o(51629),z=o(66835),D=o(23477),C=o(24076),M=o(67478),I=o(57861),A=o(85281),R=o(79601),P=o(70024),Y=o(94469),L=o(96467),H=o(22539),E=o(10658),O=o.n(E),T=o(25223),B=o(99004),V=o(59376),K=o(34605),N=o(78392),F=o(41156),q=o(98589),U=o(79254),_=o(71049),J=o(7519),$=o(11577),G=o(93433),X=o(74580),Q=o(88153),ee=o(39062),te=o(73999),oe=o(98817),re=o(87248),ne=o.n(re),ie=(o(63331),o(66212)),le=o(16132),ce=o(5049),se=o(46417),ae=o(91635);O().extend(ae);var de=new(ne().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),ue=new(ne().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),he=function(e){var t=e.coordinates,o=e.additionalProps,r=e.order,n=e.setMapOpen;console.log("setMapOpen:",typeof n),console.log("coordinates",t),console.log(o.riderStart),console.log(o.riderEnd),console.log("order",r);var i=(0,s.useRef)(null);le.u;(0,s.useEffect)((function(){if(i.current&&t.length>0){var e=l(t);i.current.fitBounds(e)}}),[t]);var l=function(e){var t=e.map((function(e){return e.lat})),o=e.map((function(e){return e.lng})),r=Math.min.apply(Math,(0,G.Z)(t)),n=Math.max.apply(Math,(0,G.Z)(t));return[[r,Math.min.apply(Math,(0,G.Z)(o))],[n,Math.max.apply(Math,(0,G.Z)(o))]]},c=t.length,a=Math.round(t.length/2),d=t[0],u=t[c-1],h=t[a],x=function(e,t){return(0,se.jsxs)(m.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,se.jsxs)(g.Z,{variant:"h5",color:"text.primary",sx:{fontSize:13},children:[e,":"]}),(0,se.jsx)(ie.Z,{label:t||"N/A",color:"primary",variant:"combined",size:"small",sx:{fontWeight:1e3,fontSize:14}})]})};return t&&t.length>0&&(0,se.jsxs)("div",{id:"map",style:{width:"100%",height:"90vh",margin:"0 auto",position:"relative"},children:[(0,se.jsx)(ie.Z,{label:"close",color:"primary",variant:"combined",onClick:function(){return n(!1)},size:"large",sx:{position:"absolute",top:8,right:8,zIndex:1e3,"&:hover":{},cursor:"pointer"},icon:(0,se.jsx)(ce.Z,{})}),(0,se.jsxs)(m.Z,{direction:"row",gap:2,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start",sx:{position:"absolute",bottom:0,zIndex:1e3,left:0,right:0,px:{xs:1,custom500:2,custom700:2},py:{xs:1,custom500:2,custom900:4},backgroundColor:"rgba(255, 255, 255, 0.95)",maxWidth:"100%",width:"auto",boxShadow:function(e){return e.shadows[3]}},children:[x("Tenant",null===r||void 0===r?void 0:r.tenantname),x("Rider",null===r||void 0===r?void 0:r.ridername),x("Pickup",null===r||void 0===r?void 0:r.pickupcustomer),x("Drop",null===r||void 0===r?void 0:r.deliverycustomer),x("Kms",null===r||void 0===r?void 0:r.kms),x("Actual kms",null===r||void 0===r?void 0:r.actualkms),x("Rider kms",null===r||void 0===r?void 0:r.riderkms)]}),(0,se.jsxs)(X.h,{center:h,zoom:15,scrollWheelZoom:!1,style:{height:"100%",width:"100%"},ref:i,children:[(0,se.jsx)(Q.I,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,se.jsx)(ee.J,{position:d,icon:de,children:(0,se.jsx)(te.u,{direction:"bottom",children:(0,se.jsx)("span",{children:"Pickup Point: ".concat(O()(o.riderStart).utc().format("DD-MM-YYYY")," (").concat(O()(o.riderStart).utc().format("hh:mm A"),")")})})}),(0,se.jsx)(ee.J,{position:u,icon:ue,children:(0,se.jsx)(te.u,{direction:"bottom",children:(0,se.jsx)("span",{children:"Drop Point: ".concat(O()(o.riderEnd).utc().format("DD-MM-YYYY")," (").concat(O()(o.riderEnd).utc().format("hh:mm A"),")")})})}),(0,se.jsx)(oe.a,{pathOptions:{color:"blue",weight:8,dashArray:"4 4"},positions:t})]})]})},xe=o(91635);O().extend(xe);var pe=999,fe="0 14px 40px rgba(15, 23, 42, 0.10)",ge="0 8px 24px rgba(15, 23, 42, 0.08)",me="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",Ze="#94a3b8",je="#e2e8f0",ye="#f1f5f9",we="#f8fafc",ke=function(e,t){return"".concat(e).concat(t)},Se=function(e){return ke(e,"08")},We=function(e){return ke(e,"18")},ze=function(e){return ke(e,"26")},De=function(e){return ke(e,"55")},Ce="#662582",Me="#9255AB",Ie={created:{label:"Created",color:"#3b82f6",icon:H.ili},pending:{label:"Pending",color:"#f59e0b",icon:H.Ley},accepted:{label:"Accepted",color:"#6366f1",icon:H.Z5O},arrived:{label:"Arrived",color:"#06b6d4",icon:H.ZSR},picked:{label:"Picked",color:"#8b5cf6",icon:H.ili},active:{label:"Active",color:"#0ea5e9",icon:H.ili},processing:{label:"Processing",color:"#3b82f6",icon:H.dKE},onhold:{label:"On Hold",color:"#8b5cf6",icon:H.Y8K},"on hold":{label:"On Hold",color:"#8b5cf6",icon:H.Y8K},delivered:{label:"Delivered",color:"#10b981",icon:H.ZSR},skipped:{label:"Skipped",color:"#f97316",icon:H.B4e},failed:{label:"Failed",color:"#991b1b",icon:H.B4e},cancelled:{label:"Cancelled",color:"#ef4444",icon:H.B4e}},Ae=[{id:0,status:"All",statusLow:"All",color:Ce,icon:H.YgO},{id:1,status:"Pending",statusLow:"pending",color:"#f59e0b",icon:H.Ley},{id:2,status:"Accepted",statusLow:"accepted",color:"#6366f1",icon:H.Z5O},{id:3,status:"Arrived",statusLow:"arrived",color:"#06b6d4",icon:H.ZSR},{id:4,status:"Picked",statusLow:"picked",color:"#8b5cf6",icon:H.ili},{id:5,status:"Active",statusLow:"active",color:"#14b8a6",icon:H.ili},{id:6,status:"Delivered",statusLow:"delivered",color:"#10b981",icon:H.ZSR},{id:7,status:"Skipped",statusLow:"skipped",color:"#f97316",icon:H.B4e},{id:8,status:"Cancelled",statusLow:"cancelled",color:"#ef4444",icon:H.B4e}],Re=function(e){return(0,se.jsx)(x.Z,(0,c.Z)((0,c.Z)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:me,border:"1px solid",borderColor:"divider",overflow:"hidden"}}))},Pe=function(e){var t=e.color,o=e.selected,r=e.size,n=void 0===r?24:r,i=e.children;return(0,se.jsx)(p.Z,{sx:{width:n,height:n,bgcolor:o?t:We(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:i})},Ye=function(e){return{"& .MuiOutlinedInput-root":{borderRadius:pe+"px",bgcolor:Se(e),fontWeight:600,"& fieldset":{borderColor:De(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ze(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}},Le=function(e){var t=e.status,o=Ie[String(t||"").toLowerCase()]||{label:t||"\u2014",color:Ze,icon:H.Y8K},r=o.icon;return(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.125,py:.375,borderRadius:999,bgcolor:o.color,color:"#fff",fontSize:11,fontWeight:700,letterSpacing:.2,whiteSpace:"nowrap",minWidth:86,justifyContent:"center",boxShadow:"0 1px 2px ".concat(ze(o.color))},children:[(0,se.jsx)(r,{size:12})," ",o.label]})},He=function(e){var t=e.value,o=e.color,r=e.icon,n=e.isMoney,i=void 0!==n&&n,l=Number(t),c=i?Oe(l):Number.isFinite(l)?l:t||0;return!Number.isFinite(l)||0===l?(0,se.jsx)(g.Z,{variant:"caption",sx:{color:Ze,fontWeight:700},children:c}):(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:Se(o),border:"1px solid ".concat(De(o)),color:o,fontSize:12,fontWeight:800,whiteSpace:"nowrap"},children:[r,c]})},Ee=function(e){var t=e.value;return t?(0,se.jsxs)(m.Z,{spacing:0,sx:{lineHeight:1.1},children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:800,color:be,letterSpacing:.1,lineHeight:1.15},noWrap:!0,children:O()(t).format("hh:mm A")}),(0,se.jsx)(g.Z,{sx:{fontSize:10.5,fontWeight:600,color:Ze,lineHeight:1.2},noWrap:!0,children:O()(t).format("DD MMM YYYY")})]}):(0,se.jsx)(g.Z,{sx:{fontSize:12,color:Ze,fontWeight:700},children:"\u2014"})};function Oe(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function Te(){(0,h.Z)();var e,t,o=localStorage.getItem("tenantid"),E=(0,s.useRef)(null),G=(0,s.useRef)(),X=(0,s.useRef)(),Q=(0,s.useState)(O()().format("YYYY-MM-DD")),ee=(0,l.Z)(Q,2),te=ee[0],oe=ee[1],re=(0,s.useState)(O()().format("YYYY-MM-DD")),ne=(0,l.Z)(re,2),ie=ne[0],le=ne[1],ce=(0,s.useState)(!1),ae=(0,l.Z)(ce,2),de=ae[0],ue=ae[1],xe=(0,s.useState)("Today"),pe=(0,l.Z)(xe,2),ke=pe[0],Ie=pe[1],Te=(0,s.useState)(0),Be=(0,l.Z)(Te,2),Ve=(Be[0],Be[1]),Ke=(0,s.useState)(0),Ne=(0,l.Z)(Ke,2),Fe=(Ne[0],Ne[1]),qe=(0,s.useState)(""),Ue=(0,l.Z)(qe,2),_e=Ue[0],Je=Ue[1],$e=(0,s.useState)((function(){try{return localStorage.getItem("ordersDetails.density")||"compact"}catch(e){return"compact"}})),Ge=(0,l.Z)($e,2),Xe=Ge[0],Qe=Ge[1],et="compact"===Xe,tt=et?.5:1;(0,s.useEffect)((function(){try{localStorage.setItem("ordersDetails.density",Xe)}catch(e){}}),[Xe]);var ot=[{key:"index",label:"#",group:"Core",required:!0,defaultVisible:!0,width:36},{key:"location",label:"Location / Order",group:"Core",required:!0,defaultVisible:!0,minWidth:150},{key:"pickup",label:"Pickup",group:"Core",defaultVisible:!0,minWidth:140},{key:"drop",label:"Drop",group:"Core",defaultVisible:!0,minWidth:140},{key:"status",label:"Status",group:"Core",required:!0,defaultVisible:!0,width:110},{key:"assigned",label:"Assigned",group:"Lifecycle",defaultVisible:!0,minWidth:110},{key:"accepted",label:"Accepted",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"arrived",label:"Arrived",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"picked",label:"Picked",group:"Lifecycle",defaultVisible:!0,minWidth:90},{key:"delivered",label:"Delivered",group:"Lifecycle",defaultVisible:!0,minWidth:90},{key:"cancelled",label:"Cancelled",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"kms",label:"Kms",group:"Metrics",defaultVisible:!0,width:70,align:"center"}],rt=ot.reduce((function(e,t){return(0,c.Z)((0,c.Z)({},e),{},(0,i.Z)({},t.key,t.defaultVisible))}),{}),nt=(0,s.useState)((function(){try{var e=JSON.parse(localStorage.getItem("ordersDetails.cols")||"null");return e&&"object"===typeof e?(0,c.Z)((0,c.Z)({},rt),e):rt}catch(t){return rt}})),it=(0,l.Z)(nt,2),lt=it[0],ct=it[1];(0,s.useEffect)((function(){try{localStorage.setItem("ordersDetails.cols",JSON.stringify(lt))}catch(e){}}),[lt]);var st=function(e){var t=ot.find((function(t){return t.key===e}));return(null===t||void 0===t?void 0:t.required)||!1!==lt[e]},at=ot.filter((function(e){return st(e.key)})).length,dt=ot.length-at,ut=(0,s.useState)(null),ht=(0,l.Z)(ut,2),xt=ht[0],pt=ht[1],ft=function(e){return ct((function(t){return(0,c.Z)((0,c.Z)({},t),{},(0,i.Z)({},e,!(!1!==t[e])))}))},gt=ot.every((function(e){return st(e.key)===!!e.defaultVisible})),mt=(0,s.useState)([]),bt=(0,l.Z)(mt,2),vt=bt[0],Zt=(bt[1],(0,s.useState)()),jt=(0,l.Z)(Zt,2),yt=jt[0],wt=(jt[1],(0,s.useState)()),kt=(0,l.Z)(wt,2),St=kt[0],Wt=(kt[1],(0,s.useState)(!1)),zt=(0,l.Z)(Wt,2),Dt=zt[0],Ct=zt[1],Mt=(0,s.useState)({}),It=(0,l.Z)(Mt,2),At=It[0],Rt=(It[1],(0,s.useState)("All")),Pt=(0,l.Z)(Rt,2),Yt=Pt[0],Lt=Pt[1],Ht=(0,s.useState)(0),Et=(0,l.Z)(Ht,2),Ot=Et[0],Tt=Et[1],Bt=(0,s.useState)(Ae[0]),Vt=(0,l.Z)(Bt,2),Kt=Vt[0],Nt=Vt[1],Ft=(0,s.useState)([]),qt=(0,l.Z)(Ft,2),Ut=qt[0],_t=qt[1],Jt=(0,s.useState)(0),$t=(0,l.Z)(Jt,2),Gt=$t[0],Xt=$t[1],Qt=(0,s.useState)("All Locations"),eo=(0,l.Z)(Qt,2),to=eo[0],oo=eo[1],ro=(0,s.useState)(null),no=(0,l.Z)(ro,2),io=no[0],lo=no[1],co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,o=(0,s.useState)(e),r=(0,l.Z)(o,2),n=r[0],i=r[1];return(0,s.useEffect)((function(){var o=setTimeout((function(){i(e)}),t);return function(){return clearTimeout(o)}}),[e,t]),n}(_e,500),so=function(){var e=(0,n.Z)((0,r.Z)().mark((function e(t){var o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(t));case 3:o=e.sent,_t(o.data.details||[]),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("gettenantlocations",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}();(0,s.useEffect)((function(){so(o)}),[]);(0,s.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 ao=(0,d.N)({queryKey:[te,ie,Yt,Gt,co],queryFn:_.$w,getNextPageParam:function(e){return e.nextPage}}),uo=ao.data,ho=ao.isError,xo=ao.error,po=ao.fetchNextPage,fo=ao.isLoading,go=ao.hasNextPage,mo=ao.isFetchingNextPage,bo=(null===uo||void 0===uo?void 0:uo.pages.flatMap((function(e){return e.details})))||[];(0,s.useEffect)((function(){if(go){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&po()}),{root:null,rootMargin:"0px 0px 400px 0px",threshold:0});return G.current&&e.observe(G.current),function(){G.current&&e.unobserve(G.current)}}}),[go,po]);var vo=(0,u.a)({queryKey:["deliverycount",te,ie,Yt,Gt],queryFn:_.Vf}).data;if((0,s.useEffect)((function(){var e,t={All:null===vo||void 0===vo?void 0:vo.total,pending:null===vo||void 0===vo?void 0:vo.pending,accepted:null===vo||void 0===vo?void 0:vo.accepted,arrived:null===vo||void 0===vo?void 0:vo.arrived,picked:null===vo||void 0===vo?void 0:vo.picked,active:null===vo||void 0===vo?void 0:vo.active,delivered:null===vo||void 0===vo?void 0:vo.delivered,cancelled:null===vo||void 0===vo?void 0:vo.cancelled};Tt(null!==(e=t[Yt])&&void 0!==e?e:0)}),[Yt,vo]),(0,s.useEffect)((function(){var e=0,t=0;bo&&bo.forEach((function(o){e+=o.deliverycharges,t+=o.deliveryamt})),Ve(e),Fe(t)}),[bo]),ho)return"An error has occurred:(isErrorOrderDetails) "+xo.message;var Zo=bo.map((function(e){return{tenantname:e.tenantname,tenantcity:e.tenantcity,tenantcontactno:e.tenantcontactno,rider:e.rider,orderid:e.orderid,orderdate:e.orderdate,deliverydate:e.deliverydate,orderstatus:e.orderstatus,deliverystatus:e.deliverystatus,ordernotes:e.ordernotes,kms:e.kms,actualkms:e.actualkms,assigntime:e.assigntime,starttime:e.starttime,arrivaltime:e.arrivaltime,pickuptime:e.pickuptime,deliverytime:e.deliverytime,canceltime:e.canceltime,deliverycharge:e.deliverycharge,deliveryamt:e.deliveryamt,pickupcustomer:e.pickupcustomer,pickupcontactno:e.pickupcontactno,pickupaddress:e.pickupaddress,pickupsuburb:e.pickupsuburb,pickupcity:e.pickupcity,pickuplat:e.pickuplat,pickuplong:e.pickuplong,deliverycustomer:e.deliverycustomer,deliverycontactno:e.deliverycontactno,deliveryaddress:e.deliveryaddress,deliverysuburb:e.deliverysuburb,deliverylat:e.deliverylat,deliverylong:e.deliverylong,locationname:e.locationname,locationsuburb:e.locationsuburb,locationcity:e.locationcity,locationcontactno:e.locationcontactno}})),jo=[{key:"total",label:"".concat("All"===Yt?"Total":Yt," Orders"),color:Ce,icon:H.YgO,value:Ot,hint:"Orders matching the current filters."},{key:"pending",label:"Pending",color:"#f59e0b",icon:H.Ley,value:null!==(e=null===vo||void 0===vo?void 0:vo.pending)&&void 0!==e?e:0,hint:"Orders awaiting rider assignment or pickup."},{key:"delivered",label:"Delivered",color:"#10b981",icon:H.ZSR,value:null!==(t=null===vo||void 0===vo?void 0:vo.delivered)&&void 0!==t?t:0,hint:"Successfully delivered orders."}];return(0,se.jsxs)(se.Fragment,{children:[fo&&(0,se.jsx)($.Z,{}),(0,se.jsx)(x.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:je,background:"linear-gradient(135deg, ".concat(Se(Ce)," 0%, ").concat(Se(Me)," 100%)"),boxShadow:ge},children:(0,se.jsxs)(m.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:Ce,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(ze(Ce))},children:(0,se.jsx)(H.VHP,{size:19})}),(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Orders Details"}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,se.jsx)(f.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,se.jsxs)(g.Z,{sx:{fontSize:11.5,color:ve,fontWeight:600},children:["Live \xb7 ",to," \xb7 ",ke]})]})]})]}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:[(0,se.jsx)(b.Z,{title:et?"Switch to comfortable density":"Switch to compact density",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(){return Qe((function(e){return"compact"===e?"comfortable":"compact"}))},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(H.VK0,{size:15,style:{transform:et?"none":"scaleY(1.4)"}}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,bgcolor:"#fff",borderColor:je,color:be,"&:hover":{bgcolor:"#fff",borderColor:Ce,color:Ce,boxShadow:"0 0 0 3px ".concat(ze(Ce))}},children:et?"Compact":"Comfortable"})}),(0,se.jsx)(b.Z,{title:"Show or hide columns",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(e){return pt(e.currentTarget)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(H.Dx,{size:15}),endIcon:dt>0?(0,se.jsxs)(f.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:18,px:.5,borderRadius:999,bgcolor:We(Ce),color:Ce,fontSize:10.5,fontWeight:800,lineHeight:1},children:[at,"/",ot.length]}):null,sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,bgcolor:dt>0?Se(Ce):"#fff",borderColor:dt>0?De(Ce):je,color:dt>0?Ce:be,"&:hover":{bgcolor:dt>0?Se(Ce):"#fff",borderColor:Ce,color:Ce,boxShadow:"0 0 0 3px ".concat(ze(Ce))}},children:"Columns"})}),(0,se.jsx)(b.Z,{title:"Filter by date range",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(){return ue(!0)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(H.sHf,{size:15}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,bgcolor:"#fff",borderColor:je,color:be,"&:hover":{bgcolor:"#fff",borderColor:Ce,color:Ce,boxShadow:"0 0 0 3px ".concat(ze(Ce))},"&:focus-visible":{boxShadow:"0 0 0 3px ".concat(ze(Ce))}},children:te&&ie?"".concat(O()(te).format("DD MMM")," \u2013 ").concat(O()(ie).format("DD MMM")):"All time"})}),(0,se.jsx)(f.Z,{sx:{display:"inline-flex","& a":{textDecoration:"none",lineHeight:0}},children:(0,se.jsx)(J.ZZ,{data:Zo,filename:"Orders_Detail_".concat(O()().format("YYYY-MM-DD_HHmmss"),".csv"),label:"Download",style:{height:32,minHeight:32,px:1.5,borderRadius:1.5,bgcolor:Ce,color:"#fff",textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,boxShadow:"0 2px 6px ".concat(ze(Ce)),"&:hover":{bgcolor:Me,boxShadow:"0 4px 12px ".concat(ze(Ce))},"&:focus-visible":{boxShadow:"0 0 0 3px ".concat(ze(Ce))},"& .MuiButton-startIcon":{mr:.75,"& svg":{fontSize:16}}}})})]})]})}),(0,se.jsx)(Z.ZP,{container:!0,spacing:{xs:1,sm:1.25,md:1.5},children:jo.map((function(e){var t,o=e.icon;return(0,se.jsx)(Z.ZP,{item:!0,xs:6,sm:4,md:4,children:(0,se.jsx)(b.Z,{title:e.hint||"",placement:"top",arrow:!0,children:(0,se.jsxs)(x.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:je,background:"#fff",transition:"transform 0.15s, box-shadow 0.15s, border-color 0.15s","&:hover":{transform:"translateY(-1px)",boxShadow:ge,borderColor:De(e.color)}},children:[(0,se.jsx)(f.Z,{sx:{position:"absolute",top:0,left:0,bottom:0,width:3,background:e.color}}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{pl:.5},children:[(0,se.jsxs)(m.Z,{spacing:.125,sx:{minWidth:0,flex:1},children:[(0,se.jsx)(g.Z,{sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:10.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.2},children:e.label}),(0,se.jsx)(g.Z,{sx:{fontWeight:800,color:be,lineHeight:1.15,fontSize:{xs:"0.95rem",sm:"1.1rem",md:"1.2rem"}},noWrap:!0,children:fo&&!e.value?(0,se.jsx)(j.Z,{sx:{width:40},animation:"wave"}):e.isMoney?Oe(e.value):null!==(t=e.value)&&void 0!==t?t:0})]}),(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:30,height:30,bgcolor:We(e.color),color:e.color,borderRadius:1.25,flexShrink:0},children:(0,se.jsx)(o,{size:15})})]})]})})},e.key)}))}),(0,se.jsx)(x.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:1,md:1.125},borderRadius:2,border:"1px solid",borderColor:je,background:"#fff",boxShadow:fe},children:(0,se.jsxs)(Z.ZP,{container:!0,spacing:1,alignItems:"center",children:[(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:6,md:4,children:1===Ut.length?(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.875,borderRadius:999,bgcolor:Se(Ce),border:"1.5px solid ".concat(De(Ce)),color:Ce,fontWeight:800,fontSize:13,width:"100%"},children:[(0,se.jsx)(H.x$F,{size:14})," ",Ut[0].locationname]}):(0,se.jsx)(y.Z,{fullWidth:!0,options:Ut||[],value:io,getOptionLabel:function(e){return e?"".concat(e.locationname," (").concat(e.suburb||"",")"):""},PaperComponent:Re,onChange:function(e,t,o){t&&(lo(t),Xt(t.locationid),oo(t.locationname)),"clear"===o&&(lo(null),Xt(0),oo("All Locations"))},renderInput:function(e){return(0,se.jsx)(w.Z,(0,c.Z)((0,c.Z)({},e),{},{placeholder:"All Locations",size:"small",sx:Ye("#10b981"),InputProps:(0,c.Z)((0,c.Z)({},e.InputProps),{},{startAdornment:(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,se.jsx)(Pe,{color:"#10b981",size:22,selected:!0,children:(0,se.jsx)(H.c7Z,{size:13})})})})}))}})}),(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,se.jsx)(y.Z,{fullWidth:!0,options:Ae,value:Kt,getOptionLabel:function(e){return(null===e||void 0===e?void 0:e.status)||""},PaperComponent:Re,onChange:function(e,t,o){"clear"===o?(Lt("All"),Nt(Ae[0])):(Lt(t.statusLow),Nt(t))},renderInput:function(e){return(0,se.jsx)(w.Z,(0,c.Z)((0,c.Z)({},e),{},{placeholder:"Status",size:"small",sx:Ye((null===Kt||void 0===Kt?void 0:Kt.color)||Ce),InputProps:(0,c.Z)((0,c.Z)({},e.InputProps),{},{startAdornment:(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,se.jsx)(Pe,{color:(null===Kt||void 0===Kt?void 0:Kt.color)||Ce,size:22,selected:!0,children:null!==Kt&&void 0!==Kt&&Kt.icon?s.createElement(Kt.icon,{size:13}):(0,se.jsx)(H.VK0,{size:13})})})})}))}})}),(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:12,md:4,children:(0,se.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,bgcolor:Se(Ce),border:"1.5px solid ".concat(De(Ce)),transition:"all 0.18s","&:focus-within":{borderColor:Ce,boxShadow:"0 0 0 3px ".concat(ze(Ce))}},children:[(0,se.jsx)(H.vU7,{size:16,style:{color:Ce,flexShrink:0}}),(0,se.jsx)(k.ZP,{inputRef:E,placeholder:"Search (ctrl+k)",value:_e,onChange:function(e){return Je(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:be,"& input::placeholder":{color:Ze,opacity:1}}}),_e&&(0,se.jsx)(S.Z,{size:"small",onClick:function(){return Je("")},sx:{p:.25,color:Ce},children:(0,se.jsx)(H.lUB,{size:14})})]})})]})}),(0,se.jsx)(x.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},borderRadius:2,border:"1px solid",borderColor:je,overflow:"hidden",background:"#fff"},children:(0,se.jsx)(W.Z,{ref:X,onScroll:function(e){var t=e.currentTarget,o=t.scrollTop,r=t.scrollHeight;o+t.clientHeight>=r-50&&go&&!mo&&po()},sx:{overflowX:"auto",overflowY:"visible","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:De(Ce),borderRadius:8,"&:hover":{backgroundColor:Ce}},"&::-webkit-scrollbar-track":{backgroundColor:we}},children:(0,se.jsxs)(z.Z,{stickyHeader:!0,size:"small",sx:{minWidth:ot.filter((function(e){return st(e.key)})).reduce((function(e,t){return e+(t.width||t.minWidth||100)}),0),tableLayout:"auto"},children:[(0,se.jsx)(D.Z,{children:(0,se.jsxs)(C.Z,{sx:{"& th":{backgroundColor:we,color:ve,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(je),py:.75,px:1}},children:[st("index")&&(0,se.jsx)(M.Z,{sx:{width:36},children:"#"}),st("location")&&(0,se.jsx)(M.Z,{sx:{minWidth:150},children:"Location / Order"}),st("pickup")&&(0,se.jsx)(M.Z,{sx:{minWidth:140},children:"Pickup"}),st("drop")&&(0,se.jsx)(M.Z,{sx:{minWidth:140},children:"Drop"}),st("status")&&(0,se.jsx)(M.Z,{sx:{width:110},children:"Status"}),st("assigned")&&(0,se.jsx)(M.Z,{sx:{minWidth:110},children:"Assigned"}),st("accepted")&&(0,se.jsx)(M.Z,{sx:{minWidth:90},children:"Accepted"}),st("arrived")&&(0,se.jsx)(M.Z,{sx:{minWidth:90},children:"Arrived"}),st("picked")&&(0,se.jsx)(M.Z,{sx:{minWidth:90},children:"Picked"}),st("delivered")&&(0,se.jsx)(M.Z,{sx:{minWidth:90},children:"Delivered"}),st("cancelled")&&(0,se.jsx)(M.Z,{sx:{minWidth:90},children:"Cancelled"}),st("kms")&&(0,se.jsx)(M.Z,{align:"center",sx:{width:70},children:"Kms"})]})}),(0,se.jsxs)(I.Z,{children:[0===(null===bo||void 0===bo?void 0:bo.length)&&!fo&&(0,se.jsx)(C.Z,{children:(0,se.jsx)(M.Z,{colSpan:at,sx:{py:7,borderBottom:"none"},children:(0,se.jsxs)(m.Z,{alignItems:"center",spacing:1.25,children:[(0,se.jsx)(p.Z,{sx:{width:56,height:56,bgcolor:We("#94a3b8"),color:Ze,borderRadius:2},variant:"rounded",children:(0,se.jsx)(H.VHP,{size:26})}),(0,se.jsx)(g.Z,{sx:{fontWeight:700,color:be,fontSize:14},children:"No orders match these filters"}),(0,se.jsx)(g.Z,{sx:{color:ve,fontSize:12},children:_e?"Try a different keyword or clear the search.":"Adjust the location, status, or date range above."}),_e&&(0,se.jsx)(v.Z,{size:"small",onClick:function(){return Je("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:Ce,borderRadius:1.25,"&:hover":{bgcolor:Se(Ce)}},startIcon:(0,se.jsx)(H.lUB,{size:14}),children:"Clear search"})]})})}),fo&&0===bo.length&&Array.from({length:10}).map((function(e,t){return(0,se.jsx)(C.Z,{children:Array.from({length:at}).map((function(e,t){return(0,se.jsx)(M.Z,{sx:{borderBottom:"1px solid ".concat(ye),py:.625,px:1},children:(0,se.jsx)(j.Z,{animation:"wave",height:20})},t)}))},"sk-".concat(t))})),bo.map((function(e,t){return(0,se.jsxs)(C.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s","& td":{borderBottom:"1px solid ".concat(ye),py:tt,px:1,verticalAlign:"top"},"&:hover":{backgroundColor:Se(Ce),boxShadow:"inset 3px 0 0 ".concat(Ce)}},children:[st("index")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(g.Z,{sx:{fontWeight:700,fontSize:12,color:Ze},children:t+1})}),st("location")&&(0,se.jsxs)(M.Z,{children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.locationname}),(0,se.jsx)(b.Z,{title:"Order Id",children:(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.orderid})}),(0,se.jsx)(b.Z,{title:"Delivery Date",children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.125},children:[(0,se.jsx)(H.dKE,{size:10,style:{color:Ze,flexShrink:0}}),(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:ve,fontWeight:700},noWrap:!0,children:O()(e.deliverydate).utc().format("hh:mm A")}),(0,se.jsxs)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600},noWrap:!0,children:["\xb7 ",O()(e.deliverydate).utc().format("DD MMM YY")]})]})})]}),st("pickup")&&(0,se.jsx)(M.Z,{children:(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.pickupcustomer}),(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.pickupcontactno}),(0,se.jsx)(b.Z,{title:e.Pickupaddress||e.pickupaddress,children:(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.pickupsuburb||e.pickuplocation||(e.Pickupaddress?"".concat(e.Pickupaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),st("drop")&&(0,se.jsx)(M.Z,{children:(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.deliverycustomer}),(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.deliverycontactno}),(0,se.jsx)(b.Z,{title:e.deliveryaddress,children:(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.deliverysuburb||e.deliverylocation||(e.deliveryaddress?"".concat(e.deliveryaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),st("status")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Le,{status:e.orderstatus})}),st("assigned")&&(0,se.jsx)(M.Z,{children:(0,se.jsxs)(m.Z,{spacing:.25,children:[e.ridername&&(0,se.jsx)(g.Z,{sx:{fontSize:11,fontWeight:800,color:Ce},noWrap:!0,children:e.ridername}),(0,se.jsx)(Ee,{value:e.assigntime})]})}),st("accepted")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Ee,{value:e.starttime})}),st("arrived")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Ee,{value:e.arrivaltime})}),st("picked")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Ee,{value:e.pickuptime})}),st("delivered")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Ee,{value:e.deliverytime})}),st("cancelled")&&(0,se.jsx)(M.Z,{children:(0,se.jsx)(Ee,{value:e.canceltime})}),st("kms")&&(0,se.jsx)(M.Z,{align:"center",children:(0,se.jsx)(He,{value:"cancelled"===e.orderstatus||""===e.kms?0:Number(parseFloat(e.kms||0).toFixed(1)),color:"#f59e0b",icon:(0,se.jsx)(H.v93,{size:11})})})]},"".concat(e.orderid,"-").concat(t))})),0!==bo.length&&(0,se.jsx)(C.Z,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:(0,se.jsx)(M.Z,{colSpan:at,sx:{borderBottom:"none",py:1,bgcolor:we},children:(0,se.jsx)(m.Z,{ref:G,direction:"row",alignItems:"center",justifyContent:"center",spacing:1,sx:{minHeight:32},children:mo||go?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(A.Z,{size:14,sx:{color:Ce}}),(0,se.jsx)(g.Z,{sx:{fontSize:11.5,color:ve,fontWeight:700},children:"Loading more orders\u2026"})]}):(0,se.jsxs)(g.Z,{sx:{fontSize:11.5,color:Ze,fontWeight:700,letterSpacing:.3},children:[bo.length," order",1===bo.length?"":"s"," \xb7 End of list"]})})})})]})]})})}),(0,se.jsxs)(R.Z,{anchorEl:xt,open:Boolean(xt),onClose:function(){return pt(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{mt:.75,width:300,borderRadius:2.5,border:"1px solid ".concat(je),boxShadow:me,overflow:"hidden"}}},MenuListProps:{sx:{py:0}},children:[(0,se.jsxs)(f.Z,{sx:{px:1.5,pt:1.25,pb:1.125,background:"linear-gradient(135deg, ".concat(Se(Ce)," 0%, ").concat(Se(Me)," 100%)"),borderBottom:"1px solid ".concat(je)},children:[(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:28,height:28,bgcolor:Ce,color:"#fff",borderRadius:1.25},children:(0,se.jsx)(H.Dx,{size:15})}),(0,se.jsxs)(m.Z,{spacing:0,children:[(0,se.jsx)(g.Z,{sx:{fontSize:13,fontWeight:800,color:be,lineHeight:1.15},children:"Columns"}),(0,se.jsxs)(g.Z,{sx:{fontSize:10.5,fontWeight:700,color:ve,lineHeight:1.2},children:[at," of ",ot.length," shown"]})]})]})}),(0,se.jsxs)(m.Z,{direction:"row",spacing:.75,sx:{mt:1.125},children:[(0,se.jsx)(v.Z,{size:"small",onClick:function(){return ct(ot.reduce((function(e,t){return(0,c.Z)((0,c.Z)({},e),{},(0,i.Z)({},t.key,!0))}),{}))},disabled:0===dt,startIcon:(0,se.jsx)(H.smy,{size:13}),sx:{flex:1,height:28,px:1,fontSize:11.5,fontWeight:800,textTransform:"none",borderRadius:1.25,color:Ce,bgcolor:"#fff",border:"1px solid ".concat(De(Ce)),"&:hover":{bgcolor:Se(Ce),borderColor:Ce},"&.Mui-disabled":{color:Ze,bgcolor:"#fff",borderColor:je,opacity:.7}},children:"Show all"}),(0,se.jsx)(v.Z,{size:"small",onClick:function(){return ct(rt)},disabled:gt,startIcon:(0,se.jsx)(H.zq9,{size:14}),sx:{flex:1,height:28,px:1,fontSize:11.5,fontWeight:800,textTransform:"none",borderRadius:1.25,color:ve,bgcolor:"#fff",border:"1px solid ".concat(je),"&:hover":{bgcolor:we,borderColor:Ze,color:be},"&.Mui-disabled":{color:Ze,bgcolor:"#fff",borderColor:je,opacity:.7}},children:"Reset"})]})]}),(0,se.jsx)(f.Z,{sx:{maxHeight:340,overflowY:"auto",py:.5},children:["Core","Lifecycle","Metrics"].map((function(e){var t=ot.filter((function(t){return t.group===e})),o=t.filter((function(e){return st(e.key)})).length;return(0,se.jsxs)(f.Z,{sx:{px:.5,pb:.25},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:1,pt:.875,pb:.375},children:[(0,se.jsx)(g.Z,{sx:{fontSize:10,fontWeight:800,color:Ze,letterSpacing:.7,textTransform:"uppercase"},children:e}),(0,se.jsxs)(g.Z,{sx:{fontSize:10,fontWeight:700,color:Ze},children:[o,"/",t.length]})]}),t.map((function(e){var t=st(e.key),o=!!e.required;return(0,se.jsxs)(f.Z,{onClick:function(){return!o&&ft(e.key)},sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,mx:.5,px:1,py:.375,borderRadius:1.5,cursor:o?"default":"pointer",bgcolor:t?Se(Ce):"transparent",border:"1px solid ".concat(t?De(Ce):"transparent"),transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:o?t?Se(Ce):"transparent":We(Ce)}},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.625,sx:{minWidth:0},children:[(0,se.jsx)(g.Z,{noWrap:!0,sx:{fontSize:13,fontWeight:700,color:t?be:ve},children:e.label}),o&&(0,se.jsx)(b.Z,{title:"Always visible",arrow:!0,children:(0,se.jsx)(f.Z,{sx:{display:"inline-flex",color:Ze},children:(0,se.jsx)(H.Tmq,{size:11})})})]}),(0,se.jsx)(P.Z,{size:"small",checked:t,disabled:o,onClick:function(e){return e.stopPropagation()},onChange:function(){return!o&&ft(e.key)},sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:Ce},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:Ce,opacity:1},"& .MuiSwitch-switchBase.Mui-disabled.Mui-checked":{color:Me},"& .MuiSwitch-switchBase.Mui-disabled.Mui-checked + .MuiSwitch-track":{backgroundColor:Me,opacity:.6}}})]},e.key)}))]},e)}))})]}),(0,se.jsxs)(Y.Z,{open:de,onClose:function(){return ue(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,se.jsx)(f.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(Se(Ce)," 0%, ").concat(Se(Me)," 100%)"),borderBottom:"1px solid ".concat(je)},children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,se.jsx)(p.Z,{sx:{bgcolor:Ce,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ze(Ce))},children:(0,se.jsx)(H.sHf,{size:20})}),(0,se.jsxs)(m.Z,{children:[(0,se.jsx)(g.Z,{variant:"h5",sx:{fontWeight:800,color:be},children:"Select Date Range"}),(0,se.jsx)(g.Z,{variant:"caption",sx:{color:ve,fontWeight:600},children:"Filter the order details by a date range or preset"})]})]})}),(0,se.jsx)(L.Z,{sx:{width:"100%"},className:"datedialog",children:(0,se.jsx)(T.D,{open:de,toggle:function(){return ue(!de)},id:"daterange1",onChange:function(e){"All"===e.label?(oe(""),le(""),Ie("All"),ue(!1)):(oe(O()(e.startDate).format("YYYY-MM-DD")),le(O()(e.endDate).format("YYYY-MM-DD")),Ie(e.label||""))},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,B.Z)(new Date,-1),endDate:(0,B.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,B.Z)(new Date,1),endDate:(0,B.Z)(new Date,1)},{label:"This Week",startDate:(0,V.Z)(new Date),endDate:(0,K.Z)(new Date)},{label:"Last Week",startDate:(0,V.Z)((0,N.Z)(new Date,-1)),endDate:(0,K.Z)((0,N.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,N.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,F.Z)(new Date),endDate:(0,q.Z)(new Date)},{label:"Last Month",startDate:(0,F.Z)((0,U.Z)(new Date,-1)),endDate:(0,q.Z)((0,U.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,B.Z)(new Date,-1)}]})}),(0,se.jsxs)(m.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat(ye)},children:[(0,se.jsx)(v.Z,{variant:"outlined",onClick:function(){return ue(!1)},sx:{borderRadius:999,px:2.5,borderColor:je,color:ve,fontWeight:700,"&:hover":{borderColor:ve,bgcolor:we}},children:"Cancel"}),(0,se.jsx)(v.Z,{variant:"contained",onClick:function(){return ue(!1)},sx:{borderRadius:999,px:3,bgcolor:Ce,fontWeight:700,boxShadow:"0 6px 18px ".concat(ze(Ce)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]}),(0,se.jsx)(Y.Z,{open:Dt,onClose:function(){return Ct(!1)},maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{borderRadius:3,overflow:"hidden"}},children:vt&&(0,se.jsx)(f.Z,{children:(0,se.jsx)(he,{coordinates:vt,additionalProps:{riderStart:yt,riderEnd:St},order:At,setMapOpen:Ct})})})]})}}}]);