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