"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7138],{38215:function(e,t,r){r.d(t,{Z:function(){return c}});var n=r(17592),o=r(85281),i=r(46417),a=(0,n.ZP)("div")((function(){return{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}})),s=(0,n.ZP)("div")((function(){return{position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}})),c=function(){return(0,i.jsxs)(a,{children:[(0,i.jsx)(o.Z,{color:"primary",size:80,thickness:6}),(0,i.jsx)(s,{children:(0,i.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/J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u6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg==",alt:"Logo",style:{width:"100%",height:"100%"}})})]})}},78710:function(e,t,r){r.d(t,{Z:function(){return A}});var n=r(94469),o=r(33604),i=r(42832),a=r(61113),s=r(96467),c=r(4117),l=r(69099),d=r(25223),u=r(10658),h=r.n(u),x=r(99004),f=r(59376),p=r(34605),v=r(78392),g=r(41156),Z=r(98589),b=r(79254),m=r(46417);function A(e){var t=e.open,r=e.onClose,u=e.onApply,A=[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,x.Z)(new Date,-1),endDate:(0,x.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,x.Z)(new Date,1),endDate:(0,x.Z)(new Date,1)},{label:"This Week",startDate:(0,f.Z)(new Date),endDate:(0,p.Z)(new Date)},{label:"Last Week",startDate:(0,f.Z)((0,v.Z)(new Date,-1)),endDate:(0,p.Z)((0,v.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,x.Z)(new Date,-7),endDate:new Date},{label:"This Month",startDate:(0,g.Z)(new Date),endDate:(0,Z.Z)(new Date)},{label:"Last Month",startDate:(0,g.Z)((0,b.Z)(new Date,-1)),endDate:(0,Z.Z)((0,b.Z)(new Date,-1))}];return(0,m.jsxs)(n.Z,{open:t,onClose:function(){return onclose()},fullWidth:!0,maxWidth:"sm",children:[(0,m.jsx)(o.Z,{disableTypography:!0,children:(0,m.jsx)(i.Z,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",sx:{width:"100%"},children:(0,m.jsx)(a.Z,{variant:"h4",children:"Select Date Range"})})}),(0,m.jsx)(s.Z,{sx:{"& .MuiPaper-root":{boxShadow:"none !important"}},children:(0,m.jsx)(d.D,{open:t,toggle:r,definedRanges:A,onChange:function(e){null!==e&&void 0!==e&&e.startDate&&null!==e&&void 0!==e&&e.endDate&&(u({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||""}),r())},closeOnClickOutside:!1})}),(0,m.jsx)(c.Z,{children:(0,m.jsx)(l.Z,{variant:"contained",onClick:r,sx:{cursor:"pointer"},children:"Close"})})]})}},95872:function(e,t,r){r.d(t,{f:function(){return o}});var n=r(47313),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"k";(0,n.useEffect)((function(){if(null!==e&&void 0!==e&&e.current){var r=function(r){var n;r.key.toLowerCase()===t.toLowerCase()&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),null===(n=e.current)||void 0===n||n.focus());"Escape"===r.key&&document.activeElement===e.current&&e.current.blur()};return document.addEventListener("keydown",r),function(){return document.removeEventListener("keydown",r)}}}),[e,t])}},36186:function(e,t,r){r.r(t),r.d(t,{default:function(){return ae}});r(93433);var n=r(1413),o=r(74165),i=r(15861),a=r(29439),s=r(47313),c=r(90842),l=r(10658),d=r.n(l),u=r(56573),h=r(57829),x=r(61113),f=r(69099),p=r(70501),v=r(42832),g=r(48119),Z=r(51629),b=r(66835),m=r(23477),A=r(24076),j=r(67478),S=r(57861),C=r(84488),R=r(61689),y=r(47131),E=r(85281),P=r(94469),k=r(96467),w=r(22539),T=r(11577),D=r(95872),W=r(78710),I=r(38215),Y=(r.p,r(41962)),_=r(25963),M=r(50581),O=r(58467),L=r(71049),z=r(46417),H=r(91635);d().extend(H);var F="0 8px 24px rgba(15, 23, 42, 0.08)",B="#0f172a",K="#64748b",N="#94a3b8",U="#e2e8f0",J="#f1f5f9",q="#f8fafc",G=function(e,t){return"".concat(e).concat(t)},V=function(e){return G(e,"08")},Q=function(e){return G(e,"18")},X=function(e){return G(e,"26")},$=function(e){return G(e,"55")},ee="#662582",te="#9255AB",re={created:{label:"Created",color:"#3b82f6",icon:w.ili},pending:{label:"Pending",color:"#f59e0b",icon:w.Ley},processing:{label:"Processing",color:"#3b82f6",icon:w.dKE},modified:{label:"Confirmed",color:"#10b981",icon:w.ZSR},confirmed:{label:"Confirmed",color:"#10b981",icon:w.ZSR},ready:{label:"Accepted",color:"#6366f1",icon:w.ZSR},active:{label:"Picked",color:"#8b5cf6",icon:w.ili},onhold:{label:"On Hold",color:"#8b5cf6",icon:w.Y8K},closed:{label:"Closed",color:"#06b6d4",icon:w.ZSR},delivered:{label:"Delivered",color:"#10b981",icon:w.ZSR},failed:{label:"Failed",color:"#991b1b",icon:w.B4e},cancelled:{label:"Cancelled",color:"#ef4444",icon:w.B4e}},ne=[{idx:0,status:"created",label:"Created",color:ee,icon:w.ili,countKey:"created"}],oe=function(e){var t=e.status,r=re[String(t||"").toLowerCase()]||{label:t||"\u2014",color:N,icon:w.Y8K},n=r.icon;return(0,z.jsxs)(h.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.125,py:.375,borderRadius:999,bgcolor:r.color,color:"#fff",fontSize:11,fontWeight:700,letterSpacing:.2,whiteSpace:"nowrap",minWidth:86,justifyContent:"center",boxShadow:"0 1px 2px ".concat(X(r.color))},children:[(0,z.jsx)(n,{size:12})," ",r.label]})},ie=function(e){var t=e.value,r=e.color,n=e.icon,o=e.isMoney,i=void 0!==o&&o,a=Number(t),s=i?"\u20b9".concat(Number.isFinite(a)?a.toFixed(2):"0.00"):Number.isFinite(a)?a:t||0;return!Number.isFinite(a)||0===a?(0,z.jsx)(x.Z,{variant:"caption",sx:{color:N,fontWeight:700},children:s}):(0,z.jsxs)(h.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:V(r),border:"1px solid ".concat($(r)),color:r,fontSize:12,fontWeight:800,whiteSpace:"nowrap"},children:[n,s]})},ae=function(){var e=(0,O.s0)(),t=((0,O.TH)(),localStorage.getItem("tenantid")),r=(0,s.useRef)(),l=(0,s.useRef)(),H=(0,s.useState)(0),G=(0,a.Z)(H,2),re=G[0],ae=G[1],se=(0,s.useState)(10),ce=(0,a.Z)(se,2),le=ce[0],de=ce[1],ue=(0,s.useState)(0),he=(0,a.Z)(ue,2),xe=he[0],fe=he[1],pe=(0,s.useState)("Created"),ve=(0,a.Z)(pe,2),ge=ve[0],Ze=ve[1],be=(0,s.useState)("created"),me=(0,a.Z)(be,2),Ae=me[0],je=me[1],Se=(0,s.useState)(!1),Ce=(0,a.Z)(Se,2),Re=Ce[0],ye=Ce[1],Ee=(0,s.useState)(""),Pe=(0,a.Z)(Ee,2),ke=Pe[0],we=Pe[1],Te=(0,s.useState)(!1),De=(0,a.Z)(Te,2),We=De[0],Ie=De[1],Ye=(0,s.useState)("Today"),_e=(0,a.Z)(Ye,2),Me=_e[0],Oe=_e[1],Le=(0,s.useState)(d()().format("YYYY-MM-DD")),ze=(0,a.Z)(Le,2),He=ze[0],Fe=ze[1],Be=(0,s.useState)(d()().format("YYYY-MM-DD")),Ke=(0,a.Z)(Be,2),Ne=Ke[0],Ue=Ke[1],Je=(0,s.useState)(""),qe=(0,a.Z)(Je,2),Ge=qe[0],Ve=qe[1],Qe=(0,s.useState)(""),Xe=(0,a.Z)(Qe,2),$e=Xe[0],et=Xe[1],tt=(0,s.useState)(!1),rt=(0,a.Z)(tt,2),nt=(rt[0],rt[1],(0,s.useState)(!1)),ot=(0,a.Z)(nt,2),it=ot[0],at=ot[1],st=(0,s.useState)(!1),ct=(0,a.Z)(st,2),lt=ct[0],dt=ct[1],ut=(0,s.useState)(!1),ht=(0,a.Z)(ut,2),xt=ht[0],ft=ht[1],pt=(0,s.useState)([]),vt=(0,a.Z)(pt,2),gt=vt[0],Zt=vt[1];(0,s.useEffect)((function(){var e=setTimeout((function(){et(Ge)}),400);return function(){return clearTimeout(e)}}),[Ge]);var bt=(0,s.useRef)(null);(0,D.f)(bt,"k");var mt=(0,Y.a)({queryKey:["percentageData",0,He,Ne,t,0],queryFn:L.Wo,enabled:!0,refetchInterval:15e3}),At=mt.data,jt=mt.isLoading,St=mt.refetch,Ct=(0,Y.a)({queryKey:["ordersCount",0,He,Ne,Ae,t,0],queryFn:L.RO,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchInterval:15e3}),Rt=Ct.data,yt=Ct.refetch,Et=(0,Y.a)({queryKey:["getallriders"],queryFn:L.n7,refetchOnMount:!0,refetchOnWindowFocus:!0}).data,Pt=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.Z.put("".concat({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_VERSION:"v2.1.0"}.REACT_APP_URL,"/orders/updateorder"),{orderheaderid:ke,orderstatus:"cancelled",cancelled:d()().format("YYYY-MM-DD HH:mm:ss")}).then((function(e){e.data.status&&((0,c.yv)("Order Cancelled Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),_t(),yt(),St(),ye(!1))})).catch((function(e){console.log(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kt=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(r){var n,i,a;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.pageParam,i=void 0===n?1:n,e.next=3,u.Z.get("".concat({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_VERSION:"v2.1.0"}.REACT_APP_URL,"/orders/tenant/getorders/?tenantid=").concat(t,"&locationid=").concat(0,"&status=").concat(Ae,"&fromdate=").concat(He,"&todate=").concat(Ne,"&pageno=").concat(i,"&pagesize=").concat(le,"&keyword=").concat($e));case 3:return a=e.sent,e.abrupt("return",{data:a.data.details,nextPage:a.data.details.length===le?i+1:void 0});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),wt=(0,_.N)({queryKey:[ge,He,Ne,re,le,$e,0],queryFn:kt,getNextPageParam:function(e){return e.nextPage},refetchInterval:15e3}),Tt=wt.data,Dt=wt.fetchNextPage,Wt=wt.isLoading,It=wt.hasNextPage,Yt=wt.isFetchingNextPage,_t=wt.refetch,Mt=Tt?Tt.pages.flatMap((function(e){return e.data})):[];(0,s.useEffect)((function(){if(It){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&Dt()}),{root:null,rootMargin:"0px 0px 400px 0px",threshold:0});return r.current&&e.observe(r.current),function(){r.current&&e.unobserve(r.current)}}}),[It,Dt]);var Ot=(0,M.D)({mutationFn:L.f2,onSuccess:function(r,n){(0,c.yv)("Orders Optimised Successfully",{variant:"success",autoHideDuration:2e3,anchorOrigin:{vertical:"top",horizontal:"right"}}),yt(),_t(),dt(!1),e("/nearle/dispatch/preview",{state:{dispatchPreviewData:r,aiMode:1,selectedMode:{value:1},deliveryData:(null===n||void 0===n?void 0:n.deliveries)||[],appId:0,startdate:He,tenantId:t,autoRiders:Et||[]}})},onError:function(e){(0,c.yv)(e.message,{variant:"error",autoHideDuration:4e3}),dt(!1)},onSettled:function(){dt(!1),ft(!1)}}),Lt=(0,M.D)({mutationFn:L.Sr,onSuccess:function(e){e.status&&(at(!1),(0,c.yv)("Orders Cancelled Successfully",{variant:"success",autoHideDuration:2e3}),_t(),yt(),St(),Zt([]))},onError:function(e){(0,c.yv)(e.message,{variant:"error",autoHideDuration:4e3})}}),zt=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Mt.length){e.next=2;break}return e.abrupt("return");case 2:ft(!0),dt(!0),t=Mt.map((function(e){return(0,n.Z)((0,n.Z)({},e),{},{deliveryid:0,deliverydate:d()(e.deliverydate).utc().format("YYYY-MM-DD HH:mm:ss"),assigntime:d()().format("YYYY-MM-DD HH:mm:ss"),orderstatus:"pending",orderamount:e.deliverycharge,droplat:e.deliverylat,droplon:e.deliverylong,pickuplat:e.pickuplat,pickuplon:e.pickuplong,ordernotes:e.ordernotes,deliverycharges:e.deliverycharge,pickuplocation:e.pickupsuburb,deliverylocation:e.deliverysuburb})})),Ot.mutate({deliveries:t,selectedMode:{value:1},hypertuning_params:"balanced",absent_riders:[]});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();w.ili,null===At||void 0===At||At.created,null===At||void 0===At||At.percentage1,w.Ley,null===At||void 0===At||At.uncoveredOrders,null===At||void 0===At||At.percentage2;return(0,z.jsxs)(s.Fragment,{children:[(jt||Wt||xt||lt)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T.Z,{}),(0,z.jsx)(I.Z,{})]}),Mt.length>0&&"created"===Ae&&(0,z.jsxs)(f.Z,{variant:"contained",onClick:zt,sx:{position:"fixed",bottom:32,right:24,bgcolor:ee,color:"#fff",px:3,py:1.5,borderRadius:999,fontWeight:850,boxShadow:"0 10px 30px ".concat(X(ee)),zIndex:1e3,textTransform:"none",fontSize:"14px",gap:1,"&:hover":{bgcolor:te,transform:"translateY(-2px)"}},startIcon:(0,z.jsx)(w.ili,{size:18}),children:["Assign Orders (",Mt.length,")"]}),(0,z.jsx)(p.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:U,background:"linear-gradient(135deg, ".concat(V(ee)," 0%, ").concat(V(te)," 100%)"),boxShadow:F},children:(0,z.jsx)(v.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:(0,z.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,z.jsx)(g.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:ee,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(X(ee))},children:(0,z.jsx)(w.ili,{size:19})}),(0,z.jsxs)(v.Z,{spacing:.125,children:[(0,z.jsx)(x.Z,{variant:"h3",sx:{fontWeight:800,color:B,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Orders"}),(0,z.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,z.jsx)(h.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,z.jsxs)(x.Z,{sx:{fontSize:11.5,color:K,fontWeight:600},children:["Live \xb7 ","All Locations"," \xb7 ",Me]})]})]})]})})}),(0,z.jsx)(p.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:.875,md:1.125},borderTopLeftRadius:2,borderTopRightRadius:2,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:U,borderBottom:0,background:"#fff"},children:(0,z.jsx)(v.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:(0,z.jsx)(v.Z,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:U,borderRadius:4}},children:ne.map((function(e){var t,r=e.icon,n=xe===e.idx,o=null!==(t=null===Rt||void 0===Rt?void 0:Rt[e.countKey])&&void 0!==t?t:0;return(0,z.jsxs)(h.Z,{onClick:function(t){return function(e,t){Ve(""),de(10),fe(t);var r=ne[t];Ze(r.label),je(r.status),ae(0)}(0,e.idx)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?e.color:$(e.color)),bgcolor:n?e.color:V(e.color),color:n?"#fff":e.color,fontWeight:700,boxShadow:n?"0 6px 18px ".concat(X(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:n?"0 6px 18px ".concat(X(e.color)):"0 0 0 3px ".concat(X(e.color))}},children:[(0,z.jsx)(g.Z,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:n?"rgba(255,255,255,0.22)":Q(e.color),color:n?"#fff":e.color},children:(0,z.jsx)(r,{size:13})}),(0,z.jsx)(x.Z,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,z.jsx)(h.Z,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:n?"rgba(255,255,255,0.22)":"#fff",color:n?"#fff":e.color,border:n?"none":"1px solid ".concat($(e.color))},children:null!==o&&void 0!==o?o:0})]},e.status)}))})})}),(0,z.jsx)(p.Z,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:2,borderBottomRightRadius:2,border:"1px solid",borderColor:U,overflow:"hidden",background:"#fff"},children:(0,z.jsx)(Z.Z,{onScroll:function(e){var t=e.currentTarget,r=t.scrollTop,n=t.scrollHeight;r+t.clientHeight>=n-50&&It&&!Yt&&Dt()},ref:l,sx:{overflowX:"auto",overflowY:"visible","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:$(ee),borderRadius:8,"&:hover":{backgroundColor:ee}},"&::-webkit-scrollbar-track":{backgroundColor:q}},children:(0,z.jsxs)(b.Z,{stickyHeader:!0,size:"small",sx:{minWidth:{xs:960,md:1100}},children:[(0,z.jsx)(m.Z,{children:(0,z.jsxs)(A.Z,{sx:{"& th":{backgroundColor:q,color:K,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(U),py:.75,px:1}},children:[(0,z.jsx)(j.Z,{children:"#"}),(0,z.jsx)(j.Z,{children:"Order Location"}),(0,z.jsx)(j.Z,{children:"Pickup"}),(0,z.jsx)(j.Z,{children:"Drop"}),(0,z.jsx)(j.Z,{align:"center",children:"Qty"}),(0,z.jsx)(j.Z,{align:"right",children:"COD"}),(0,z.jsx)(j.Z,{align:"center",children:"Kms"}),(0,z.jsx)(j.Z,{align:"right",children:"Charges"}),(0,z.jsx)(j.Z,{children:"Notes"}),(0,z.jsx)(j.Z,{children:"Status"}),"created"===Ae&&(0,z.jsx)(j.Z,{align:"right",children:"Actions"})]})}),(0,z.jsxs)(S.Z,{children:[(Wt||lt)&&0===Mt.length&&Array.from({length:10}).map((function(e,t){return(0,z.jsx)(A.Z,{children:Array.from({length:"created"===Ae?12:11}).map((function(e,t){return(0,z.jsx)(j.Z,{sx:{borderBottom:"1px solid ".concat(J),py:.625,px:1},children:(0,z.jsx)(C.Z,{animation:"wave",height:20})},t)}))},"sk-".concat(t))})),!Wt&&0===Mt.length&&(0,z.jsx)(A.Z,{children:(0,z.jsx)(j.Z,{colSpan:"created"===Ae?12:11,sx:{py:7,borderBottom:"none"},children:(0,z.jsxs)(v.Z,{alignItems:"center",spacing:1.25,children:[(0,z.jsx)(g.Z,{variant:"rounded",sx:{width:56,height:56,bgcolor:Q("#94a3b8"),color:N,borderRadius:2},children:(0,z.jsx)(w.ili,{size:26})}),(0,z.jsxs)(x.Z,{sx:{fontWeight:700,color:B,fontSize:14},children:["No ",Ae," orders"]}),(0,z.jsx)(x.Z,{sx:{color:K,fontSize:12},children:Ge?"Try a different keyword or clear the search.":"Adjust the location, status, or date range above."}),Ge&&(0,z.jsx)(f.Z,{size:"small",onClick:function(){return Ve("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:ee,borderRadius:1.25,"&:hover":{bgcolor:V(ee)}},startIcon:(0,z.jsx)(w.lUB,{size:14}),children:"Clear search"})]})})}),Mt.map((function(e,t){var r;gt.find((function(t){return t.orderheaderid===e.orderheaderid}));return(0,z.jsxs)(A.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s",backgroundColor:"transparent","& td":{borderBottom:"1px solid ".concat(J),py:.5,px:1,verticalAlign:"top"},"&:hover":{backgroundColor:q,boxShadow:"inset 3px 0 0 ".concat(ee)}},children:[(0,z.jsx)(j.Z,{children:(0,z.jsx)(x.Z,{sx:{fontWeight:700,color:K},children:re*le+t+1})}),(0,z.jsxs)(j.Z,{children:[(0,z.jsxs)(x.Z,{variant:"subtitle2",sx:{fontWeight:700,color:B},noWrap:!0,children:[e.locationname,e.locationsuburb&&" - ".concat(e.locationsuburb)]}),(0,z.jsx)(R.Z,{title:"Order Id",children:(0,z.jsx)(x.Z,{variant:"caption",sx:{color:K},noWrap:!0,children:e.orderid})}),(0,z.jsxs)(v.Z,{direction:"row",spacing:.5,alignItems:"center",sx:{mt:.125},children:[(0,z.jsx)(w.dKE,{size:10,style:{color:N,flexShrink:0}}),function(){var t=e.pickupslot&&d()(e.pickupslot).isValid()?d()(e.pickupslot):d()(e.deliverydate||e.orderdate);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x.Z,{sx:{fontSize:10.5,color:K,fontWeight:700},noWrap:!0,children:t.format("hh:mm A")}),(0,z.jsxs)(x.Z,{sx:{fontSize:10.5,color:N,fontWeight:600},noWrap:!0,children:["\xb7 ",t.format("DD MMM YY")]})]})}()]})]}),(0,z.jsx)(j.Z,{children:(0,z.jsxs)(v.Z,{direction:"column",children:[(0,z.jsx)(x.Z,{variant:"subtitle2",sx:{fontWeight:700,color:B},noWrap:!0,children:e.pickupcustomer}),(0,z.jsx)(x.Z,{variant:"caption",sx:{color:K},children:e.pickupcontactno}),(0,z.jsx)(R.Z,{title:e.pickupaddress,children:(0,z.jsx)(x.Z,{variant:"caption",sx:{color:N},noWrap:!0,children:e.pickupsuburb||(e.pickupaddress?"".concat(e.pickupaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),(0,z.jsx)(j.Z,{children:(0,z.jsxs)(v.Z,{direction:"column",children:[(0,z.jsx)(x.Z,{variant:"subtitle2",sx:{fontWeight:700,color:B},noWrap:!0,children:e.deliverycustomer}),(0,z.jsx)(x.Z,{variant:"caption",sx:{color:K},children:e.deliverycontactno}),(0,z.jsx)(R.Z,{title:e.deliveryaddress,children:(0,z.jsx)(x.Z,{variant:"caption",sx:{color:N},noWrap:!0,children:e.deliverysuburb||((null===(r=e.deliveryaddress)||void 0===r?void 0:r.length)>20?"".concat(e.deliveryaddress.slice(0,20),"\u2026"):e.deliveryaddress||"\u2014")})})]})}),(0,z.jsx)(j.Z,{align:"center",children:(0,z.jsx)(ie,{value:e.quantity,color:"#0ea5e9",icon:(0,z.jsx)(w.ByW,{size:11})})}),(0,z.jsx)(j.Z,{align:"right",children:(0,z.jsx)(ie,{value:e.collectionamt,color:"#10b981",icon:(0,z.jsx)(w.vCl,{size:11}),isMoney:!0})}),(0,z.jsx)(j.Z,{align:"center",children:(0,z.jsx)(ie,{value:e.kms,color:"#f59e0b",icon:(0,z.jsx)(w.v93,{size:11})})}),(0,z.jsx)(j.Z,{align:"right",children:(0,z.jsx)(ie,{value:e.deliverycharge,color:ee,icon:(0,z.jsx)(w.vCl,{size:11}),isMoney:!0})}),(0,z.jsx)(j.Z,{children:e.ordernotes?(0,z.jsxs)(v.Z,{direction:"row",spacing:.5,alignItems:"center",sx:{color:K},children:[(0,z.jsx)(w.hKf,{size:12,style:{color:N,flexShrink:0}}),(0,z.jsx)(x.Z,{variant:"caption",sx:{maxWidth:140,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:600},children:e.ordernotes})]}):(0,z.jsx)(x.Z,{variant:"caption",sx:{color:N},children:"\u2014"})}),(0,z.jsx)(j.Z,{children:(0,z.jsx)(oe,{status:e.orderstatus})}),"created"===Ae&&(0,z.jsx)(j.Z,{align:"right",children:"created"===e.orderstatus&&(0,z.jsx)(R.Z,{title:"Cancel Order",children:(0,z.jsx)(y.Z,{size:"small",onClick:function(t){t.stopPropagation(),we(e.orderheaderid),ye(!0)},sx:{bgcolor:V("#ef4444"),border:"1px solid ".concat($("#ef4444")),color:"#ef4444",borderRadius:999,p:.75,"&:hover":{bgcolor:Q("#ef4444"),borderColor:"#ef4444"}},children:(0,z.jsx)(w.FU5,{size:14})})})})]},"".concat(e.orderheaderid,"-").concat(t))})),0!==Mt.length&&(0,z.jsx)(A.Z,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:(0,z.jsx)(j.Z,{colSpan:"created"===Ae?12:11,sx:{borderBottom:"none",py:1,bgcolor:q},children:(0,z.jsx)(v.Z,{ref:r,direction:"row",alignItems:"center",justifyContent:"center",spacing:1,sx:{minHeight:32},children:Yt||It?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E.Z,{size:14,sx:{color:ee}}),(0,z.jsx)(x.Z,{sx:{fontSize:11.5,color:K,fontWeight:700},children:"Loading more orders\u2026"})]}):(0,z.jsxs)(x.Z,{sx:{fontSize:11.5,color:N,fontWeight:700,letterSpacing:.3},children:[Mt.length," order",1===Mt.length?"":"s"," \xb7 End of list"]})})})})]})]})})}),(0,z.jsxs)(P.Z,{open:Re,onClose:function(){return ye(!1)},maxWidth:"xs",PaperProps:{sx:{borderRadius:3}},children:[(0,z.jsx)(h.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(V("#ef4444")," 0%, ").concat(V("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(U)},children:(0,z.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,z.jsx)(g.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40},children:(0,z.jsx)(w.F1H,{size:20})}),(0,z.jsx)(x.Z,{variant:"h5",sx:{fontWeight:800,color:B},children:"Cancel Order"})]})}),(0,z.jsx)(k.Z,{sx:{pt:3},children:(0,z.jsxs)(v.Z,{alignItems:"center",spacing:3,children:[(0,z.jsx)(x.Z,{variant:"body1",align:"center",sx:{color:K,fontWeight:600},children:"Are you sure you want to cancel this order? This action cannot be undone."}),(0,z.jsxs)(v.Z,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,z.jsx)(f.Z,{fullWidth:!0,onClick:function(){return ye(!1)},variant:"outlined",sx:{borderRadius:999,py:1,borderColor:U,color:K,fontWeight:700,"&:hover":{borderColor:K,bgcolor:q}},children:"No"}),(0,z.jsx)(f.Z,{fullWidth:!0,variant:"contained",onClick:Pt,autoFocus:!0,sx:{borderRadius:999,py:1,bgcolor:"#ef4444",fontWeight:700,boxShadow:"0 6px 18px ".concat(X("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,z.jsx)(W.Z,{open:We,onClose:function(){return Ie(!1)},onApply:function(e){var t=e.startDate,r=e.endDate,n=e.label;Fe(t),Ue(r),Oe(n)}}),(0,z.jsxs)(P.Z,{open:it,onClose:function(){return at(!1)},maxWidth:"xs",PaperProps:{sx:{borderRadius:3}},children:[(0,z.jsx)(h.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(V("#ef4444")," 0%, ").concat(V("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(U)},children:(0,z.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,z.jsx)(g.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40},children:(0,z.jsx)(w.F1H,{size:20})}),(0,z.jsx)(x.Z,{variant:"h5",sx:{fontWeight:800,color:B},children:"Cancel Selected Orders"})]})}),(0,z.jsx)(k.Z,{sx:{pt:3},children:(0,z.jsxs)(v.Z,{alignItems:"center",spacing:3,children:[(0,z.jsxs)(x.Z,{variant:"body1",align:"center",sx:{color:K,fontWeight:600},children:["Are you sure you want to cancel the ",gt.length," selected orders? This action cannot be undone."]}),(0,z.jsxs)(v.Z,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,z.jsx)(f.Z,{fullWidth:!0,onClick:function(){return at(!1)},variant:"outlined",sx:{borderRadius:999,py:1,borderColor:U,color:K,fontWeight:700,"&:hover":{borderColor:K,bgcolor:q}},children:"No"}),(0,z.jsx)(f.Z,{fullWidth:!0,variant:"contained",onClick:function(){return Lt.mutate(gt)},autoFocus:!0,sx:{borderRadius:999,py:1,bgcolor:"#ef4444",fontWeight:700,boxShadow:"0 6px 18px ".concat(X("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]})]})}},50581:function(e,t,r){r.d(t,{D:function(){return T}});var n,o,i,a,s,c,l=r(1413),d=r(29439),u=r(47313),h=r(15671),x=r(43144),f=r(97326),p=r(60136),v=r(27277),g=r(40101),Z=r(72346),b=r(86033),m=r(43889),A=r(13092),j=r(73547),S=r(28127),C=r(27542),R=r(66587),y=(n=new WeakMap,o=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakSet,c=new WeakSet,function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,l){var d;return(0,h.Z)(this,r),d=t.call(this),(0,g.Z)((0,f.Z)(d),c),(0,g.Z)((0,f.Z)(d),s),(0,Z.Z)((0,f.Z)(d),n,{writable:!0,value:void 0}),(0,Z.Z)((0,f.Z)(d),o,{writable:!0,value:void 0}),(0,Z.Z)((0,f.Z)(d),i,{writable:!0,value:void 0}),(0,Z.Z)((0,f.Z)(d),a,{writable:!0,value:void 0}),(0,A.Z)((0,f.Z)(d),n,e),d.setOptions(l),d.bindMethods(),(0,m.Z)((0,f.Z)(d),s,E).call((0,f.Z)(d)),d}return(0,x.Z)(r,[{key:"bindMethods",value:function(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}},{key:"setOptions",value:function(e){var t,r=this.options;(this.options=(0,b.Z)(this,n).defaultMutationOptions(e),(0,R.VS)(this.options,r)||(0,b.Z)(this,n).getMutationCache().notify({type:"observerOptionsUpdated",mutation:(0,b.Z)(this,i),observer:this}),null!==r&&void 0!==r&&r.mutationKey&&this.options.mutationKey&&(0,R.Ym)(r.mutationKey)!==(0,R.Ym)(this.options.mutationKey))?this.reset():null===(t=(0,b.Z)(this,i))||void 0===t||t.setOptions(this.options)}},{key:"onUnsubscribe",value:function(){var e;this.hasListeners()||(null===(e=(0,b.Z)(this,i))||void 0===e||e.removeObserver(this))}},{key:"onMutationUpdate",value:function(e){(0,m.Z)(this,s,E).call(this),(0,m.Z)(this,c,P).call(this,e)}},{key:"getCurrentResult",value:function(){return(0,b.Z)(this,o)}},{key:"reset",value:function(){var e;null===(e=(0,b.Z)(this,i))||void 0===e||e.removeObserver(this),(0,A.Z)(this,i,void 0),(0,m.Z)(this,s,E).call(this),(0,m.Z)(this,c,P).call(this)}},{key:"mutate",value:function(e,t){var r;return(0,A.Z)(this,a,t),null===(r=(0,b.Z)(this,i))||void 0===r||r.removeObserver(this),(0,A.Z)(this,i,(0,b.Z)(this,n).getMutationCache().build((0,b.Z)(this,n),this.options)),(0,b.Z)(this,i).addObserver(this),(0,b.Z)(this,i).execute(e)}}]),r}(C.l));function E(){var e,t,r=null!==(e=null===(t=(0,b.Z)(this,i))||void 0===t?void 0:t.state)&&void 0!==e?e:(0,j.R)();(0,A.Z)(this,o,(0,l.Z)((0,l.Z)({},r),{},{isPending:"pending"===r.status,isSuccess:"success"===r.status,isError:"error"===r.status,isIdle:"idle"===r.status,mutate:this.mutate,reset:this.reset}))}function P(e){var t=this;S.V.batch((function(){if((0,b.Z)(t,a)&&t.hasListeners()){var r,n,i,s,c=(0,b.Z)(t,o).variables,l=(0,b.Z)(t,o).context;if("success"===(null===e||void 0===e?void 0:e.type))null===(r=(n=(0,b.Z)(t,a)).onSuccess)||void 0===r||r.call(n,e.data,c,l),null===(i=(s=(0,b.Z)(t,a)).onSettled)||void 0===i||i.call(s,e.data,null,c,l);else if("error"===(null===e||void 0===e?void 0:e.type)){var d,u,h,x;null===(d=(u=(0,b.Z)(t,a)).onError)||void 0===d||d.call(u,e.error,c,l),null===(h=(x=(0,b.Z)(t,a)).onSettled)||void 0===h||h.call(x,void 0,e.error,c,l)}}t.listeners.forEach((function(e){e((0,b.Z)(t,o))}))}))}var k=r(67109),w=r(24772);function T(e,t){var r=(0,k.NL)(t),n=u.useState((function(){return new y(r,e)})),o=(0,d.Z)(n,1)[0];u.useEffect((function(){o.setOptions(e)}),[o,e]);var i=u.useSyncExternalStore(u.useCallback((function(e){return o.subscribe(S.V.batchCalls(e))}),[o]),(function(){return o.getCurrentResult()}),(function(){return o.getCurrentResult()})),a=u.useCallback((function(e,t){o.mutate(e,t).catch(D)}),[o]);if(i.error&&(0,w.L)(o.options.throwOnError,[i.error]))throw i.error;return(0,l.Z)((0,l.Z)({},i),{},{mutate:a,mutateAsync:i.mutate})}function D(){}}}]);