Files
Express_console_build/build/static/js/181.d5552073.chunk.js

1 line
42 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[181],{10181:(e,r,t)=>{t.r(r),t.d(r,{default:()=>ne});var o=t(89379),n=t(9950),i=t(26910),s=t(36150),l=t(2235),a=t(41413),c=t(83274),d=t(16491),x=t(82053),h=t(14857),u=t(47223),p=t(93230),m=t(60899),A=t(25333),g=t(33738),j=t(74745),f=t(1320),b=t(15769),v=t(69780),S=t(9213),w=t(21671),y=t(34075),k=t(25277),C=t(96583),z=t(28170),D=t(31222),P=t(4159),R=t.n(P),I=t(81425),_=t(52351),M=t(35678),T=t(59212),E=t(56311),W=t(96646),N=t(10523),L=t(46639),Y=t(44414);const F={width:"100%",height:"100%"};function O(e){let{details:r,loading:t,riderName:o,dateRange:i,onClose:s}=e;const l=(0,n.useRef)(null),[a,c]=(0,n.useState)(null),[h,u]=(0,n.useState)([]),[m,g]=(0,n.useState)(!1),{isLoaded:j}=(0,N.KD)({googleMapsApiKey:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_STAFF_TOKEN:"",REACT_APP_URL:"https://jupiter.nearle.app/live/api/v1",REACT_APP_URL2:"https://jupiter.nearle.app/live/api/v2",REACT_APP_URL3:"https://jupiter.nearle.app/live/api/v3",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_GOOGLE_MAPS_KEY}),f=(0,n.useMemo)((()=>(r||[]).map((e=>({lat:e.dropLat,lng:e.dropLng})))),[r]);(0,n.useEffect)((()=>{if(!j||!l.current||0===f.length)return;const e=new window.google.maps.LatLngBounds;f.forEach((r=>e.extend(r))),l.current.fitBounds(e,48)}),[j,f]),(0,n.useEffect)((()=>{if(!j||f.length<2)return void u([]);let e=!1;const r=new window.google.maps.DirectionsService,t=(e,t,o)=>new Promise(((n,i)=>{r.route({origin:e,destination:t,waypoints:o.map((e=>({location:e,stopover:!0}))),travelMode:window.google.maps.TravelMode.DRIVING},((e,r)=>{"OK"===r?n(e):i(new Error(r))}))}));return(async()=>{g(!0);try{const r=f,o=[];let n=0;for(;n<r.length-1;){const e=r.length-1-n,i=Math.min(e,24),s=r[n],l=r[n+i],a=r.slice(n+1,n+i),c=(await t(s,l,a)).routes[0].overview_path.map((e=>({lat:e.lat(),lng:e.lng()})));o.length>0&&c.length>0&&c.shift(),o.push(...c),n+=i}e||u(o)}catch(r){e||u([])}finally{e||g(!1)}})(),()=>{e=!0}}),[j,f]);const b=(e,r)=>{const t=r?38:32,o=r?"#4338ca":"#6366f1",n=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="'.concat(t,'" height="').concat(t,'">')+'<circle cx="16" cy="16" r="14" fill="'.concat(o,'" stroke="white" stroke-width="3"/>')+'<text x="16" y="21" text-anchor="middle" font-family="Arial,sans-serif" font-size="14" font-weight="700" fill="white">'.concat(e,"</text>")+"</svg>");return"data:image/svg+xml;charset=UTF-8,".concat(n)},v=(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1.5,sx:{px:2,py:1.25,borderBottom:"1px solid rgba(15, 23, 42, 0.08)",background:"linear-gradient(135deg, #6366f1 0%, #3b82f6 100%)",color:"#fff",flexShrink:0},children:[(0,Y.jsx)(D.pk7,{size:20}),(0,Y.jsxs)(p.A,{sx:{flex:1,minWidth:0},children:[(0,Y.jsxs)(x.A,{sx:{fontWeight:700,fontSize:15,lineHeight:1.2},children:["Planned route",o?" \u2014 ".concat(o):""]}),i&&(0,Y.jsx)(x.A,{sx:{fontSize:12,opacity:.85},children:i})]}),r&&r.length>0&&(0,Y.jsxs)(x.A,{sx:{fontSize:12,opacity:.9,fontWeight:600},children:[r.length," ",1===r.length?"stop":"stops",m?" \xb7 resolving route\u2026":""]}),s&&(0,Y.jsx)(A.A,{size:"small",onClick:s,sx:{color:"#fff"},"aria-label":"Close",children:(0,Y.jsx)(D.m6K,{})})]});return t||!j?(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsxs)(p.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1.5},children:[(0,Y.jsx)(L.A,{size:32}),(0,Y.jsx)(x.A,{sx:{color:"#64748b",fontSize:13},children:t?"Loading planned route\u2026":"Loading map\u2026"})]})]}):r&&0!==r.length?(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsx)(d.A,{sx:{flex:1,minHeight:0},children:(0,Y.jsxs)(N.u6,{mapContainerStyle:F,onLoad:e=>l.current=e,center:f[0],zoom:14,options:{streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1},children:[h.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N.Ro,{path:h,options:{strokeColor:"#6366f1",strokeOpacity:.25,strokeWeight:8}}),(0,Y.jsx)(N.Ro,{path:h,options:{strokeColor:"#6366f1",strokeOpacity:.95,strokeWeight:4}})]}):(0,Y.jsx)(N.Ro,{path:f,options:{strokeColor:"#6366f1",strokeOpacity:0,strokeWeight:0,icons:[{icon:{path:"M 0,-1 0,1",strokeOpacity:.6,strokeColor:"#6366f1",scale:3},offset:"0",repeat:"14px"}]}}),r.map(((e,r)=>{const t=e.step||r+1,o=a===e.deliveryid;return(0,Y.jsx)(N.pH,{position:{lat:e.dropLat,lng:e.dropLng},icon:{url:b(t,o)},onClick:()=>c(o?null:e.deliveryid),zIndex:o?1e3:t,children:o&&(0,Y.jsx)(N.Fu,{onCloseClick:()=>c(null),children:(0,Y.jsxs)(d.A,{sx:{minWidth:180,fontFamily:"inherit"},children:[(0,Y.jsxs)(x.A,{sx:{fontWeight:800,fontSize:13,color:"#0f172a"},children:["Step ",t," \xb7 ",e.customer]}),e.address&&(0,Y.jsx)(x.A,{sx:{fontSize:12,color:"#475569",mt:.5},children:e.address}),e.expectedTime&&(0,Y.jsxs)(x.A,{sx:{fontSize:12,color:"#64748b",mt:.5},children:["ETA ",String(e.expectedTime).slice(11,16)||e.expectedTime]}),e.orderid&&(0,Y.jsxs)(x.A,{sx:{fontSize:11,color:"#94a3b8",mt:.5},children:["Order #",e.orderid]})]})})},"step-".concat(e.deliveryid||e.orderid||r))}))]})})]}):(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsxs)(p.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1,p:3},children:[(0,Y.jsx)(x.A,{sx:{color:"#1e293b",fontWeight:700,fontSize:16},children:"No planned route for this rider"}),(0,Y.jsx)(x.A,{sx:{color:"#64748b",fontSize:13,textAlign:"center",maxWidth:360},children:"There are no deliveries with drop coordinates assigned to this rider for the selected date range."})]})]})}var K=t(20466),B=t(23787),H=t(36220);R().extend(H);const U={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},G=(e,r)=>"".concat(e).concat(r),V=e=>G(e,"08"),X=e=>G(e,"18"),$=e=>G(e,"26"),q=e=>G(e,"55"),Z="#662582",Q="#9255AB",J=e=>(0,Y.jsx)(l.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:U.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ee=e=>{let{color:r,selected:t,size:o=24,children:n}=e;return(0,Y.jsx)(a.A,{sx:{width:o,height:o,bgcolor:t?r:X(r),color:t?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},re=e=>{let{color:r,icon:t,label:o,tooltip:n,minWidth:i=80}=e;return(0,Y.jsx)(c.A,{title:n||"",placement:"top",children:(0,Y.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:V(r),border:"1px solid ".concat(q(r)),color:r,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[t,o]})})},te=e=>{let{value:r,color:t="#ef4444",icon:o}=e;const n=Number(r)||0;return 0===n?(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,fontWeight:700},children:"0"}):(0,Y.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:V(t),border:"1px solid ".concat(q(t)),color:t,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,n]})};function oe(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function ne(){const e=(0,h.A)(),r=(0,u.A)(e.breakpoints.down("md")),[t,o]=(0,n.useState)(R()().format("YYYY-MM-DD")),[P,N]=(0,n.useState)(R()().format("YYYY-MM-DD")),[L,F]=(0,n.useState)("All"),[H,G]=(0,n.useState)(!1),[ne,ie]=(0,n.useState)("Today"),[se,le]=(0,n.useState)([]),[ae,ce]=(0,n.useState)(null),[de,xe]=(0,n.useState)(0),[he,ue]=(0,n.useState)(!1),[pe,me]=(0,n.useState)(!1),[Ae,ge]=(0,n.useState)(null),[je,fe]=(0,n.useState)(null),[be,ve]=(0,n.useState)(!1),[Se,we]=(0,n.useState)(""),[ye,ke]=(0,n.useState)(""),{isLoading:Ce,data:ze}=(0,s.I)({queryKey:["ridersummary",de,t,P],queryFn:I.KN}),De=(0,n.useMemo)((()=>{if(!ze)return[];if(!ye)return ze;const e=ye.toLowerCase().trim();return ze.filter((r=>["".concat(r.firstname||""," ").concat(r.lastname||""),String(r.userid)].filter(Boolean).some((r=>String(r).toLowerCase().includes(e)))))}),[ze,ye]),Pe=(0,n.useMemo)((()=>ze&&0!==ze.length?ze.reduce(((e,r)=>(e.riders+=1,e.orders+=Number(r.totalorders)||0,e.delivered+=Number(r.delivered)||0,e.amount+=Math.max(Number(r.charges)||0,Number(r.deliveryamt)||0),e)),{riders:0,orders:0,delivered:0,amount:0}):{riders:0,orders:0,delivered:0,amount:0}),[ze]),Re=async e=>{ue(!0);try{const r=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportsummary/?&fromdate=").concat(t,"&todate=").concat(P,"&userid=").concat(e));le(r.data.details)}catch(r){console.log("tenantRes",r)}finally{ue(!1)}},Ie=async e=>{ve(!0);try{var r;const o="undefined"!==typeof window&&localStorage.getItem("userid")||0,n=0===de?"appuserid=".concat(o):"applocationid=".concat(de),s="".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/")+"?".concat(n)+"&status=all"+"&fromdate=".concat(t)+"&todate=".concat(P)+"&pageno=1&pagesize=200&keyword=&tenantid=&locationid="+"&userid=".concat(e),l=await i.A.get(s),a=(null===l||void 0===l||null===(r=l.data)||void 0===r?void 0:r.details)||[],c=e=>{const r=Number(e);return Number.isFinite(r)?r:null},d=a.map((e=>{var r,t,o,n,i;const s=c(null!==(r=e.droplat)&&void 0!==r?r:e.deliverylat),l=c(null!==(t=e.droplon)&&void 0!==t?t:e.deliverylong),a=c(null!==(o=e.pickuplat)&&void 0!==o?o:e.pickuplatitude),d=c(null!==(n=null!==(i=e.pickuplon)&&void 0!==i?i:e.pickuplong)&&void 0!==n?n:e.picklongitude);return null==s||null==l?null:{step:Number(e.step)||0,orderid:e.orderid,deliveryid:e.deliveryid,customer:e.deliverycustomer||e.customername||"Order ".concat(e.orderid),address:e.deliveryaddress||e.deliverysuburb||"",dropLat:s,dropLng:l,pickLat:null!==a&&void 0!==a?a:null,pickLng:null!==d&&void 0!==d?d:null,expectedTime:e.expecteddeliverytime||null}})).filter(Boolean).sort(((e,r)=>e.step-r.step));ge(d)}catch(o){(0,K.k)(null===o||void 0===o?void 0:o.message,"error",2e3),ge([])}finally{ve(!1)}},_e=(0,n.useMemo)((()=>ze?ze.reduce(((e,r)=>e+(Number(r.deliveryamt)||0)),0):0),[ze]),Me=[{key:"riders",label:"Active Riders",color:Z,icon:D.bsz,value:Pe.riders},{key:"orders",label:"Total Orders",color:"#0ea5e9",icon:D.F6S,value:Pe.orders},{key:"delivered",label:"Delivered",color:"#10b981",icon:D.mU9,value:Pe.delivered},{key:"amount",label:"Total Amount",color:"#f59e0b",icon:D.YHz,value:oe(_e)}];return(0,Y.jsxs)(Y.Fragment,{children:[(Ce||he)&&(0,Y.jsx)(_.A,{}),(0,Y.jsx)(l.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),boxShadow:U.shadowMd},children:(0,Y.jsxs)(p.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Y.jsx)(a.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Z,color:"#fff",boxShadow:"0 6px 18px ".concat($(Z))},children:(0,Y.jsx)(D.bsz,{size:22})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:U.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders Summary"}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Y.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary,fontWeight:600},children:["Live \xb7 ",L||"All Zones"," \xb7 ",ne]})]})]})]}),(0,Y.jsx)(T.A,{locaName:L,setAppId:xe,setLocoName:F,pill:!0,accentColor:Z,icon:(0,Y.jsx)(D.HPi,{size:14}),placeholder:"Select Zone",paperComponent:J,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,Y.jsx)(m.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Me.map((e=>{const r=e.icon;return(0,Y.jsx)(m.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,Y.jsxs)(l.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:U.shadowMd,borderColor:q(e.color)}},children:[(0,Y.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(X(e.color)," 100%)")}}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Y.jsxs)(p.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,Y.jsx)(x.A,{sx:{fontWeight:800,color:U.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,Y.jsx)(a.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:X(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(q(e.color)),flexShrink:0},children:(0,Y.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,Y.jsx)(l.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:U.radiusCard/8,borderTopRightRadius:U.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:U.borderSubtle,borderBottom:0,background:"#fff"},children:(0,Y.jsxs)(p.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,Y.jsx)(ee,{color:Z,size:32,children:(0,Y.jsx)(D.bsz,{size:18})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:["Orders \xb7 ",ne]}),(0,Y.jsxs)(x.A,{variant:"body2",sx:{color:U.textPrimary,fontWeight:700},children:[De.length," riders \xb7 ",Pe.orders," orders"]})]}),(0,Y.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,Y.jsxs)(d.A,{onClick:()=>G(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:V("#f59e0b"),border:"1.5px solid ".concat(q("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,ml:1,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat($("#f59e0b"))}},children:[(0,Y.jsx)(D.Ki0,{size:14}),R()(t).format("DD/MM/YY")," \u2013 ",R()(P).format("DD/MM/YY")]})})]}),(0,Y.jsx)(d.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,Y.jsx)(E.A,{value:Se,onChange:we,onDebouncedChange:ke,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:V(Z),"& fieldset":{borderColor:q(Z),borderWidth:1.5},"&:hover fieldset":{borderColor:Z},"&.Mui-focused fieldset":{borderColor:Z,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat($(Z))}}})})]})}),(0,Y.jsxs)(l.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:U.radiusCard/8,borderBottomRightRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",background:"#fff"},children:[r?(0,Y.jsxs)(B.nV,{scroll:!0,children:[Ce&&(0,Y.jsx)(p.A,{alignItems:"center",sx:{py:4},children:(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,fontWeight:700},children:"Loading riders\u2026"})}),De&&0!==De.length||Ce?De.map(((e,r)=>{const t=ae===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0),n="".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014";return(0,Y.jsxs)(B.pg,{accent:Z,selected:t,header:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,Y.jsx)(ee,{color:Z,size:36,children:(0,Y.jsx)(D.LTk,{size:18})}),(0,Y.jsxs)(p.A,{sx:{minWidth:0},children:[(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary},noWrap:!0,children:n}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:["#",String(r+1).padStart(2,"0")," \xb7 ID #",e.userid]})]})]}),(0,Y.jsxs)(p.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[(0,Y.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{fe({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),ge(null),me(!0),Ie(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:X("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(q("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,Y.jsx)(D.Cd7,{size:14})})}),(0,Y.jsx)(c.A,{title:t?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{const r=!t;ce(r?e.userid:null),r&&Re(e.userid)},sx:{bgcolor:t?Z:X(Z),color:t?"#fff":Z,border:"1px solid ".concat(q(Z)),"&:hover":{bgcolor:Z,color:"#fff"}},children:t?(0,Y.jsx)(D.Xbk,{size:16}):(0,Y.jsx)(D.j1Q,{size:16})})})]})]}),children:[(0,Y.jsxs)(B.FG,{columns:2,children:[(0,Y.jsx)(B.pY,{label:"Orders",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Delivered",children:(0,Y.jsx)(te,{value:e.delivered,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Pending",children:(0,Y.jsx)(te,{value:e.pending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Cancelled",children:(0,Y.jsx)(te,{value:e.cancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:11})})}),(0,Y.jsx)(B.pY,{label:"KMS",children:(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,Y.jsx)(B.pY,{label:"Actual KMS",children:(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,Y.jsx)(B.pY,{label:"Amount",full:!0,children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:11}),label:oe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]}),t&&(0,Y.jsx)(g.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,Y.jsxs)(l.A,{elevation:0,sx:{mt:1.25,borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",boxShadow:U.shadowSoft},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.5,py:1,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),borderBottom:"1px solid ".concat(U.borderSubtle)},children:[(0,Y.jsx)(ee,{color:Z,size:24,selected:!0,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:"Tenant Breakdown"})]}),(0,Y.jsxs)(p.A,{divider:(0,Y.jsx)(j.A,{}),children:[he&&(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",py:2},children:"Loading\u2026"}),he||se&&0!==se.length?null===se||void 0===se?void 0:se.map(((e,r)=>(0,Y.jsxs)(d.A,{sx:{p:1.5},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:1},children:[(0,Y.jsx)(ee,{color:"#0ea5e9",size:24,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary},noWrap:!0,children:e.tenantname||"\u2014"})]}),(0,Y.jsxs)(B.FG,{columns:2,children:[(0,Y.jsx)(B.pY,{label:"All",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Completed",children:(0,Y.jsx)(te,{value:e.deliveriescompleted,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Pending",children:(0,Y.jsx)(te,{value:e.deliveriespending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Cancelled",children:(0,Y.jsx)(te,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:10})})}),(0,Y.jsx)(B.pY,{label:"KMS",children:(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,Y.jsx)(B.pY,{label:"Actual KMS",children:(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,Y.jsx)(B.pY,{label:"Amount",full:!0,children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:10}),label:oe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]})]},"".concat(e.tenantname,"-").concat(r)))):(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",py:2},children:"No tenant breakdown available."})]})]})})]},e.userid||r)})):(0,Y.jsxs)(p.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,Y.jsx)(a.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:U.textMuted},children:(0,Y.jsx)(D.bsz,{size:28})}),(0,Y.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:U.textPrimary},children:"No riders to show"}),(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})]}):(0,Y.jsx)(f.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:q(Z),borderRadius:8,"&:hover":{backgroundColor:Z}},"&::-webkit-scrollbar-track":{backgroundColor:U.surfaceAlt}},children:(0,Y.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1080}},children:[(0,Y.jsx)(v.A,{children:(0,Y.jsxs)(S.A,{sx:{"& th":{backgroundColor:U.surfaceAlt,color:U.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(U.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,Y.jsx)(w.A,{children:"#"}),(0,Y.jsx)(w.A,{children:"Rider"}),(0,Y.jsx)(w.A,{align:"center",children:"Orders"}),(0,Y.jsx)(w.A,{align:"center",children:"Pending"}),(0,Y.jsx)(w.A,{align:"center",children:"Cancelled"}),(0,Y.jsx)(w.A,{align:"center",children:"Delivered"}),(0,Y.jsx)(w.A,{align:"center",children:"KMS"}),(0,Y.jsx)(w.A,{align:"center",children:"Amount"}),(0,Y.jsx)(w.A,{align:"right",children:"Action"})]})}),(0,Y.jsxs)(y.A,{children:[Ce&&(0,Y.jsx)(W.r,{col:5}),De&&0!==De.length||Ce?De.map(((e,r)=>{const t=ae===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,Y.jsxs)(n.Fragment,{children:[(0,Y.jsxs)(S.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:t?"none":"1px solid ".concat(U.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:t?"#fff":U.surfaceAlt},bgcolor:t?V(Z):"transparent"},children:[(0,Y.jsx)(w.A,{children:(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:U.textMuted},children:String(r+1).padStart(2,"0")})}),(0,Y.jsx)(w.A,{children:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,Y.jsx)(ee,{color:Z,size:36,children:(0,Y.jsx)(D.LTk,{size:18})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary,whiteSpace:"nowrap"},children:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014"}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:["ID #",e.userid]})]})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.pending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.cancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.delivered,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:11}),label:oe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,Y.jsx)(w.A,{align:"right",children:(0,Y.jsxs)(p.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,Y.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{fe({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),ge(null),me(!0),Ie(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:X("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(q("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,Y.jsx)(D.Cd7,{size:14})})}),(0,Y.jsx)(c.A,{title:t?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{const r=!t;ce(r?e.userid:null),r&&Re(e.userid)},sx:{bgcolor:t?Z:X(Z),color:t?"#fff":Z,border:"1px solid ".concat(q(Z)),"&:hover":{bgcolor:Z,color:"#fff"}},children:t?(0,Y.jsx)(D.Xbk,{size:16}):(0,Y.jsx)(D.j1Q,{size:16})})})]})})]}),t&&(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:9,sx:{p:0,borderBottom:"1px solid ".concat(U.divider),bgcolor:V(Z)},children:(0,Y.jsx)(g.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,Y.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,Y.jsxs)(l.A,{elevation:0,sx:{borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",boxShadow:U.shadowSoft},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),borderBottom:"1px solid ".concat(U.borderSubtle)},children:[(0,Y.jsx)(ee,{color:Z,size:28,selected:!0,children:(0,Y.jsx)(D.Itr,{size:14})}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Tenant Breakdown \xb7 ","".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()]})]}),(0,Y.jsxs)(b.A,{size:"small",children:[(0,Y.jsx)(v.A,{children:(0,Y.jsxs)(S.A,{sx:{"& th":{backgroundColor:U.surfaceAlt,color:U.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(U.borderSubtle),py:1,px:1.5}},children:[(0,Y.jsx)(w.A,{children:"#"}),(0,Y.jsx)(w.A,{children:"Client"}),(0,Y.jsx)(w.A,{align:"center",children:"All"}),(0,Y.jsx)(w.A,{align:"center",children:"Pending"}),(0,Y.jsx)(w.A,{align:"center",children:"Completed"}),(0,Y.jsx)(w.A,{align:"center",children:"Cancelled"}),(0,Y.jsx)(w.A,{align:"center",children:"KMS"}),(0,Y.jsx)(w.A,{align:"center",children:"Amount"})]})}),(0,Y.jsxs)(y.A,{children:[he&&(0,Y.jsx)(W.r,{col:4}),he||se&&0!==se.length?null===se||void 0===se?void 0:se.map(((e,r)=>(0,Y.jsxs)(S.A,{sx:{"& td":{borderBottom:"1px solid ".concat(U.divider),py:1,px:1.5},"&:hover":{backgroundColor:U.surfaceAlt}},children:[(0,Y.jsx)(w.A,{children:(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:U.textMuted},children:String(r+1).padStart(2,"0")})}),(0,Y.jsx)(w.A,{children:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,Y.jsx)(ee,{color:"#0ea5e9",size:24,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriespending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriescompleted,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:10}),label:oe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.tenantname,"-").concat(r)))):(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:8,sx:{py:3},children:(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",display:"block"},children:"No tenant breakdown available."})})})]})]})]})})})})})]},e.userid||r)})):(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:9,sx:{py:6},children:(0,Y.jsxs)(p.A,{alignItems:"center",spacing:1.5,children:[(0,Y.jsx)(a.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:U.textMuted},children:(0,Y.jsx)(D.bsz,{size:28})}),(0,Y.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:U.textPrimary},children:"No riders to show"}),(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})})})]})]})}),De.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j.A,{}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:1.5,sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)")},children:[(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,Y.jsx)(k.A,{label:oe(_e),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(Z," 0%, ").concat(Q," 100%)"),boxShadow:"0 6px 16px ".concat($(Z))}})]})]})]}),(0,Y.jsx)(C.A,{maxWidth:"xl",fullScreen:!0,open:pe,onClose:()=>{me(!1),ge(null),fe(null)},children:(0,Y.jsx)(z.A,{sx:{p:0,height:"100vh"},children:(0,Y.jsx)(O,{details:Ae,loading:be,riderName:null===je||void 0===je?void 0:je.name,dateRange:"".concat(R()(t).format("DD/MM/YY")," \u2013 ").concat(R()(P).format("DD/MM/YY")),onClose:()=>{me(!1),ge(null),fe(null)}})})}),(0,Y.jsx)(M.A,{open:H,onClose:()=>G(!1),onSelect:e=>{o(e.startDate),N(e.endDate),ie(e.label)}})]})}},23787:(e,r,t)=>{t.d(r,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var o=t(89379),n=t(80045),i=t(93230),s=t(2235),l=t(16491),a=t(82053),c=t(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:r,scroll:t=!1,onScroll:s,sx:l}=e,a=(0,n.A)(e,d);return(0,c.jsx)(i.A,(0,o.A)((0,o.A)({spacing:1.25,onScroll:s,sx:(0,o.A)((0,o.A)({p:1.5},t&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:r}))},h=e=>{let{accent:r="#662582",header:t,footer:n,selected:i=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(s.A,{elevation:0,onClick:a,sx:(0,o.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?r:"#e2e8f0",background:i?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[t,d,n]})]})},u=e=>{let{children:r,columns:t=2,sx:n}=e;return(0,c.jsx)(l.A,{sx:(0,o.A)({display:"grid",gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:r})},p=e=>{let{label:r,value:t,children:o,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==o?o:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==t&&void 0!==t?t:"\u2014"})})]})}},35678:(e,r,t)=>{t.d(r,{A:()=>v});var o=t(9950),n=t(96583),i=t(40033),s=t(82053),l=t(28170),a=t(93230),c=t(82223),d=t(55916),x=t(4159),h=t.n(x),u=t(56712),p=t(81417),m=t(96600),A=t(53132),g=t(94289),j=t(57326),f=t(50624),b=t(44414);const v=e=>{let{open:r,onClose:t,onSelect:x}=e;const[v,S]=(0,o.useState)(null);return(0,b.jsxs)(n.A,{open:r,onClose:t,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:r,toggle:t,id:"daterange1",onChange:e=>{S({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,A.A)(new Date,-1)),endDate:(0,m.A)((0,A.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,A.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,g.A)(new Date),endDate:(0,j.A)(new Date)},{label:"Last Month",startDate:(0,g.A)((0,f.A)(new Date,-1)),endDate:(0,j.A)((0,f.A)(new Date,-1))}]})}),(0,b.jsx)(a.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),t()):t()},children:"OK"})})]})}},46639:(e,r,t)=>{t.d(r,{A:()=>_});var o=t(57528),n=t(98587),i=t(58168),s=t(9950),l=t(72004),a=t(3484),c=t(88283),d=t(89548),x=t(18463),h=t(59254),u=t(45558),p=t(1614);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,u.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var A,g,j,f,b=t(44414);const v=["className","color","disableShrink","size","style","thickness","value","variant"];let S,w,y,k;const C=44,z=(0,c.i7)(S||(S=A||(A=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),D=(0,c.i7)(w||(w=g||(g=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),P=(0,h.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,r[t.variant],r["color".concat((0,d.A)(t.color))]]}})((e=>{let{ownerState:r,theme:t}=e;return(0,i.A)({display:"inline-block"},"determinate"===r.variant&&{transition:t.transitions.create("transform")},"inherit"!==r.color&&{color:(t.vars||t).palette[r.color].main})}),(e=>{let{ownerState:r}=e;return"indeterminate"===r.variant&&(0,c.AH)(y||(y=j||(j=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),z)})),R=(0,h.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,r)=>r.svg})({display:"block"}),I=(0,h.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.circle,r["circle".concat((0,d.A)(t.variant))],t.disableShrink&&r.circleDisableShrink]}})((e=>{let{ownerState:r,theme:t}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===r.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===r.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:r}=e;return"indeterminate"===r.variant&&!r.disableShrink&&(0,c.AH)(k||(k=f||(f=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),D)})),_=s.forwardRef((function(e,r){const t=(0,x.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:c=!1,size:h=40,style:u,thickness:p=3.6,value:A=0,variant:g="indeterminate"}=t,j=(0,n.A)(t,v),f=(0,i.A)({},t,{color:s,disableShrink:c,size:h,thickness:p,value:A,variant:g}),S=(e=>{const{classes:r,variant:t,color:o,disableShrink:n}=e,i={root:["root",t,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(t)),n&&"circleDisableShrink"]};return(0,a.A)(i,m,r)})(f),w={},y={},k={};if("determinate"===g){const e=2*Math.PI*((C-p)/2);w.strokeDasharray=e.toFixed(3),k["aria-valuenow"]=Math.round(A),w.strokeDashoffset="".concat(((100-A)/100*e).toFixed(3),"px"),y.transform="rotate(-90deg)"}return(0,b.jsx)(P,(0,i.A)({className:(0,l.A)(S.root,o),style:(0,i.A)({width:h,height:h},y,u),ownerState:f,ref:r,role:"progressbar"},k,j,{children:(0,b.jsx)(R,{className:S.svg,ownerState:f,viewBox:"".concat(22," ").concat(22," ").concat(C," ").concat(C),children:(0,b.jsx)(I,{className:S.circle,style:w,ownerState:f,cx:C,cy:C,r:(C-p)/2,fill:"none",strokeWidth:p})})}))}))},56311:(e,r,t)=>{t.d(r,{A:()=>u});var o=t(89379),n=t(9950),i=t(2660),s=t(2046),l=t(83274),a=t(25333),c=t(97125),d=t(7762),x=t(52097),h=t(44414);const u=e=>{let{value:r,onChange:t,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:A}=e;const g=(0,n.useRef)(null),[j]=(0,x.d7)(r,p);return(0,n.useEffect)((()=>{u&&u(j)}),[j,u]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=g.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},A),inputRef:g,placeholder:m,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>t(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>t(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,r,t)=>{t.d(r,{A:()=>h});var o=t(89379),n=t(9950),i=t(93230),s=t(41413),l=t(77922),a=t(29925),c=t(26910),d=t(31222),x=t(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:t,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:A,pill:g=!1,accentColor:j="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(j).concat(e),k=y("08"),C=y("26"),z=y("55"),D=y("18"),P=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:z,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},R=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:D,color:j,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,r,o)=>{"clear"===o?(null===t||void 0===t||t(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):r&&(null===t||void 0===t||t(r.applocationid),null===h||void 0===h||h(r.locationname),null===u||void 0===u||u(0))},renderInput:e=>g?(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:R}),sx:(0,o.A)((0,o.A)({},P),A||m||{})})):(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,o.A)({},A||m||{})}))})}))},96646:(e,r,t)=>{t.d(r,{r:()=>a});var o=t(9213),n=t(21671),i=t(82917),s=t(93230),l=t(44414);const a=e=>{let{rowsPerPage:r=5,col:t=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(o.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:t}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}}}]);