Files
Express_console_build/build/static/js/2851.b582cabe.chunk.js

1 line
72 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2851],{22851:(e,o,r)=>{r.r(o),r.d(o,{default:()=>Ke});var t=r(89379),n=r(85571),i=r(8881),l=r(24513),s=r(36256),d=r(9950),c=r(4159),a=r.n(c),x=r(26910),h=r(14857),u=r(31222),p=r(51778),g=r(36150),f=r(60010),b=r(2235),v=r(41413),A=r(47223),m=r(55158),j=r(93230),w=r(82053),S=r(16491),y=r(60899),C=r(82917),W=r(77922),k=r(25277),R=r(29925),z=r(1320),D=r(93038),I=r(25333),P=r(15769),L=r(69780),M=r(9213),Y=r(21671),T=r(34075),F=r(83274),E=r(33738),K=r(17239),O=r(23266),N=r(96583),H=r(28170),B=r(82223),J=r(40033),q=r(79739),Z=r(37476),U=r(56712),G=r(81417),V=r(96600),Q=r(53132),X=r(94289),_=r(57326),$=r(50624),ee=r(55916),oe=r(52351),re=r(67562),te=r(49883),ne=r(81425),ie=r(56311),le=r(20466),se=r(96646),de=r(59212),ce=r(58691),ae=r(23787),xe=r(44414),he=r(36220);a().extend(he);const ue=999,pe=16,ge="0 8px 24px rgba(15, 23, 42, 0.08)",fe="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",Ae="#94a3b8",me="#e2e8f0",je="#f1f5f9",we="#f8fafc",Se=(e,o)=>"".concat(e).concat(o),ye=e=>Se(e,"08"),Ce=e=>Se(e,"18"),We=e=>Se(e,"26"),ke=e=>Se(e,"55"),Re=e=>({cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:ue+"px",bgcolor:ye(e),fontWeight:600,color:be,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:ke(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e}}),ze={pending:{label:"Pending",color:"#f59e0b",icon:u.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:u.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:u.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:u.gsJ},active:{label:"Active",color:"#14b8a6",icon:u.pk7},skipped:{label:"Skipped",color:"#f97316",icon:u.ivF},delivered:{label:"Delivered",color:"#10b981",icon:u.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:u.uDv}},De=[{status:"pending",countKey:"uncoveredLength"},{status:"accepted",countKey:"assignedLength"},{status:"arrived",countKey:"arrivedLength"},{status:"picked",countKey:"pickedLength"},{status:"active",countKey:"activeLength"},{status:"skipped",countKey:"skippedLength"},{status:"delivered",countKey:"coveredLength"},{status:"cancelled",countKey:"cancelLength"}],Ie=[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:u.F6S},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:u.tX0},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:u.mU9},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:u.uDv}],Pe=[{id:"all",label:"All Batches",range:"Across the day",color:"#7c3aed",iconKey:"all"},{id:"morning",label:"Morning Batch",range:"12 AM to 8 AM",color:"#0ea5e9",iconKey:"morning",startHour:0,endHour:8},{id:"afternoon",label:"Afternoon Batch",range:"9 AM to 12:30 PM",color:"#f59e0b",iconKey:"afternoon",startHour:9,endHour:12.5},{id:"evening",label:"Evening Batch",range:"4 PM to 7 PM",color:"#6366f1",iconKey:"evening",startHour:16,endHour:19}],Le={all:u.lB9,morning:u.N3N,afternoon:u.aSE,evening:u.giK},Me=()=>{const e=a()(),o=e.hour()+e.minute()/60;for(const r of Pe)if("all"!==r.id&&o>=r.startHour&&o<r.endHour)return r.id;return"all"},Ye=["assigntime"],Te=e=>{let o=null;for(const i of Ye)if(null!==e&&void 0!==e&&e[i]){o=e[i];break}if(!o)return null;const r=String(o).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(r))return null;const t=a()(o);if(!t.isValid())return null;const n=t.hour()+t.minute()/60;for(const i of Pe)if("all"!==i.id&&n>=i.startHour&&n<i.endHour)return i.id;return null},Fe=e=>(0,xe.jsx)(b.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:fe,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Ee=e=>{let{color:o,selected:r,size:t=24,children:n}=e;return(0,xe.jsx)(v.A,{sx:{width:t,height:t,bgcolor:r?o:Ce(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:n})},Ke=()=>{const e=localStorage.getItem("userid"),o=(0,h.A)(),r=(0,A.A)(o.breakpoints.down("md")),c=(0,d.useRef)(),he=(0,d.useRef)(),[ue,Se]=(0,d.useState)([]),[Ye,Ke]=(0,d.useState)(!1),[Oe,Ne]=(0,d.useState)("All"),[He,Be]=(0,d.useState)(0),[Je,qe]=(0,d.useState)(a()().format("YYYY-MM-DD")),[Ze,Ue]=(0,d.useState)(a()().format("YYYY-MM-DD")),[Ge,Ve]=(0,d.useState)("Pending"),[Qe,Xe]=(0,d.useState)(0),[_e,$e]=(0,d.useState)(!1),[eo,oo]=(0,d.useState)("Today"),[ro,to]=(0,d.useState)(""),[no,io]=(0,d.useState)(),[lo,so]=(0,d.useState)(),[co,ao]=(0,d.useState)(""),[xo,ho]=(0,d.useState)({}),[uo,po]=(0,d.useState)(""),[go,fo]=(0,d.useState)(""),[bo,vo]=(0,d.useState)("pending"),[Ao,mo]=(0,d.useState)("delivered"),jo=(0,d.useRef)(null),wo=(0,d.useRef)(null),[So,yo]=d.useState(0),[Co,Wo]=d.useState(50),[ko,Ro]=d.useState(),[zo,Do]=(0,d.useState)(null),[Io,Po]=(0,d.useState)(null),[Lo,Mo]=(0,d.useState)(""),[Yo,To]=(0,d.useState)(""),[Fo,Eo]=d.useState(null),[Ko,Oo]=(0,d.useState)(null),[No,Ho]=(0,d.useState)(!1),[Bo,Jo]=d.useState(null),[qo,Zo]=(0,d.useState)(""),[Uo,Go]=(0,d.useState)(!1),[Vo,Qo]=(0,d.useState)(!1),[Xo,_o]=(0,d.useState)(""),[$o,er]=(0,d.useState)(null),[or,rr]=(0,d.useState)(0),[tr,nr]=(0,d.useState)(0),[ir,lr]=(0,d.useState)(null),[sr,dr]=(0,d.useState)(null),[cr,ar]=(0,d.useState)(0),[xr,hr]=(0,d.useState)(Me),ur=localStorage.getItem("roleid");(0,d.useEffect)((()=>{rr(0),lr(null),nr(0),dr(null)}),[He]),(0,d.useEffect)((()=>{nr(0),dr(null)}),[or]);const pr=Boolean(Fo),gr=(e,o)=>{Oo(o),console.log("selectedRow",o),Eo(e.currentTarget)},fr=()=>{Eo(null)},{mutate:br}=(0,p.n)({mutationFn:e=>{let{selectedRow:o,cancelFeed:r}=e;return(0,ne.zF)(o,r)},onSuccess:()=>{Rr("Delivery Cancelled Successfully","success"),Go(!1),Qr(),Mr(),Or()},onError:e=>{Rr(e.message,"error")}}),{data:vr,isLoading:Ar,isError:mr,error:jr}=(0,g.I)({queryKey:["tenantlist",He],queryFn:()=>(0,ne.Mn)(He),enabled:0!==He}),{data:wr,isLoading:Sr,isError:yr,error:Cr}=(0,g.I)({queryKey:["gettenantlocations",or],queryFn:()=>(0,ne.DL)(or),enabled:0!==or}),Wr=(0,p.n)({mutationFn:ne.k3,onSuccess:()=>{(0,i.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},onError:e=>{(0,i.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}}),kr=(0,p.n)({mutationFn:e=>{let{selectedRider:o,selectedRow:r}=e;return(0,ne.R_)(o,r)},onSuccess:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;Ho(!1),Qo(!1),"Success"===e.data.message&&(n.A.info("Rider changed successfully for order ID ".concat(null===t||void 0===t?void 0:t.orderid,". New Rider: ").concat(null===r||void 0===r?void 0:r.firstname," ").concat(null===r||void 0===r?void 0:r.lastname)),Rr("Rider Changed Successfully","success")),Qr(),Mr(),Or(),Wr.mutate(r.userfcmtoken)},onError:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;n.A.error("Failed to change rider for order ID ".concat(null===t||void 0===t?void 0:t.orderid,":"),e),Rr(e.message,"error"),Ho(!1)}}),Rr=(e,o)=>{(0,i.M8)(e,{variant:o,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},{data:zr}=(0,g.I)({queryKey:["orderdetails",Io],queryFn:()=>(0,ne.z3)(Io),enabled:!!Io}),Dr=()=>{Ke(!1)},{isLoading:Ir,isError:Pr,error:Lr,refetch:Mr}=(0,f.q)({queryKey:["fetchdeliveries",He,e,bo,Je,Ze,Co,Yo,or,tr,cr],queryFn:ne.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),{data:Yr,fetchNextPage:Tr,hasNextPage:Fr,isFetchingNextPage:Er,isLoading:Kr,refetch:Or}=(0,f.q)({queryKey:["fetchdeliveries-batchcounts",He,e,"all",Je,Ze,200,"",or,tr,cr],queryFn:ne.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),Nr=(0,d.useMemo)((()=>((null===Yr||void 0===Yr?void 0:Yr.pages)||[]).flatMap((e=>e.rows||[]))),[Yr]);(0,d.useEffect)((()=>{Fr&&!Er&&Tr()}),[Fr,Er,Tr,Nr.length]);const Hr=Fr||Er,Br=(0,d.useMemo)((()=>{const e=String(bo||"").toLowerCase(),o=String(Yo||"").trim().toLowerCase();return Nr.filter((r=>{if("all"!==xr&&Te(r)!==xr)return!1;const t=String(r.orderstatus||"").toLowerCase();if(e&&t!==e)return!1;if(o){if(![r.deliverycustomer,r.deliveryaddress,r.deliverysuburb,r.pickupcustomer,r.pickupaddress,r.pickupsuburb,r.orderid,r.tenantname,r.ridername,r.username].map((e=>String(e||"").toLowerCase())).join(" ").includes(o))return!1}return!0}))}),[Nr,xr,bo,Yo]),Jr=(0,d.useMemo)((()=>{const e={uncoveredLength:0,assignedLength:0,arrivedLength:0,pickedLength:0,activeLength:0,skippedLength:0,coveredLength:0,cancelLength:0};return Nr.forEach((o=>{if("all"!==xr&&Te(o)!==xr)return;switch(String(o.orderstatus||"").toLowerCase()){case"pending":e.uncoveredLength+=1;break;case"accepted":case"assigned":e.assignedLength+=1;break;case"arrived":e.arrivedLength+=1;break;case"picked":e.pickedLength+=1;break;case"active":e.activeLength+=1;break;case"skipped":e.skippedLength+=1;break;case"delivered":e.coveredLength+=1;break;case"cancelled":case"canceled":e.cancelLength+=1}})),e}),[Nr,xr]),qr=(0,d.useMemo)((()=>{const e={all:0};return Pe.forEach((o=>{"all"!==o.id&&(e[o.id]=0)})),Nr.forEach((o=>{const r=Te(o);r&&(e[r]=(e[r]||0)+1,e.all+=1)})),e}),[Nr]);(0,d.useEffect)((()=>{if(!Fr)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Tr()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return c.current&&e.observe(c.current),()=>{c.current&&e.unobserve(c.current)}}),[Fr,Tr]);const{data:Zr={},isLoading:Ur,isError:Gr,error:Vr,refetch:Qr}=(0,g.I)({queryKey:["fetchCountData",He,e,Je,Ze,Co,Yo,or,tr,cr,Ge],queryFn:()=>(0,ne.qB)(He,e,Je,Ze,Co,Yo,or,tr,cr)});(0,d.useEffect)((()=>{console.log("countData",Zr),0===Qe&&Zr&&Ro(Zr.uncoveredLength)}),[Zr]);const{data:Xr=[],isLoading:_r,isError:$r,error:et}=(0,g.I)({queryKey:["ridersList",He],queryFn:ne.Sd,enabled:Boolean(He),onError:e=>{(0,le.k)(e.message,"error",2e3)}}),ot=(0,p.n)({mutationFn:e=>(0,ne.wT)(e),onSuccess:e=>{console.log(e),e.data.status&&(Rr("Updated Successfully","success"),so(""),ao(""),Ke(!1),Mr(),Qr(),Or())},onError:e=>{console.log(e),Rr(e.message,"success")}}),rt=Pr?"Error fetching deliveries: ".concat(null===Lr||void 0===Lr?void 0:Lr.message):Gr?"Error fetching count summary: ".concat(null===Vr||void 0===Vr?void 0:Vr.message):$r?"Error fetching riders: ".concat(null===et||void 0===et?void 0:et.message):mr?"Error tenant list: ".concat(null===jr||void 0===jr?void 0:jr.message):yr?"Error location list: ".concat(null===Cr||void 0===Cr?void 0:Cr.message):null;return rt?(console.log("errorMessage",rt),(0,le.k)(rt,"error",2e3),null):(0,xe.jsxs)(xe.Fragment,{children:[(Ur||Kr||Ar||Sr||_r)&&(0,xe.jsx)(xe.Fragment,{children:(0,xe.jsx)(oe.A,{})}),(0,xe.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Ur||Ir||Ar||Sr||_r}),(0,xe.jsx)(b.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"linear-gradient(135deg, ".concat(ye("#6366f1")," 0%, ").concat(ye("#0ea5e9")," 100%)"),boxShadow:ge},children:(0,xe.jsxs)(j.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,xe.jsx)(v.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,xe.jsx)(u.F6S,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Deliveries"}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,xe.jsx)(S.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve,fontWeight:600},children:["Live \xb7 ",Oe||"All Zones"]})]})]})]}),(0,xe.jsx)(de.A,{ref:jo,locaName:Oe,setAppId:Be,setLocoName:Ne,setPage:yo,pill:!0,accentColor:"#6366f1",icon:(0,xe.jsx)(u.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Fe,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,xe.jsx)(y.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:[(0,t.A)((0,t.A)({},Ie[0]),{},{value:qr.all,percentage:null}),(0,t.A)((0,t.A)({},Ie[1]),{},{value:null===Zr||void 0===Zr?void 0:Zr.uncoveredLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.uncoveredLength/Zr.total*100):0}),(0,t.A)((0,t.A)({},Ie[2]),{},{value:null===Zr||void 0===Zr?void 0:Zr.coveredLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.coveredLength/Zr.total*100):0}),(0,t.A)((0,t.A)({},Ie[3]),{},{value:null===Zr||void 0===Zr?void 0:Zr.cancelLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.cancelLength/Zr.total*100):0})].map((e=>{var o;const r=e.icon,t="number"===typeof e.percentage?e.percentage:Number(e.percentage),n=!Number.isNaN(t)&&void 0!==e.percentage&&null!==e.percentage;return(0,xe.jsx)(y.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,xe.jsxs)(b.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:ge,borderColor:ke(e.color)}},children:[(0,xe.jsx)(S.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Ce(e.color)," 100%)")}}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(j.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Ur?(0,xe.jsx)(C.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,xe.jsx)(w.A,{sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:null!==(o=e.value)&&void 0!==o?o:0}),n&&(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.5,flexWrap:"wrap"},children:[(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:999,bgcolor:Ce(e.color),color:e.color,fontSize:{xs:10,sm:11},fontWeight:800},children:[Math.abs(t),"%"]}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,display:{xs:"none",sm:"inline"}},children:"of total"})]})]}),(0,xe.jsx)(v.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Ce(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(ke(e.color)),flexShrink:0},children:(0,xe.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,xe.jsxs)(b.A,{elevation:0,sx:{mt:{xs:1.5,md:2},mb:{xs:1.5,md:2},p:{xs:1.5,md:2},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"#fff",boxShadow:ge},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:{xs:1,md:1.5},color:ve},children:[(0,xe.jsx)(v.A,{sx:{width:28,height:28,bgcolor:Ce("#6366f1"),color:"#6366f1"},children:(0,xe.jsx)(u.MiI,{size:16})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.6,textTransform:"uppercase",color:ve},children:"Filters"})]}),(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1.25,sx:{flexWrap:"wrap"},children:[(0,xe.jsxs)(j.A,{direction:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",children:[(()=>{const e=Pe.find((e=>e.id===xr))||Pe[0],o=Le[e.iconKey]||u.VP9;return(0,xe.jsx)(W.A,{disableClearable:!0,size:"small",openOnFocus:!0,selectOnFocus:!0,filterOptions:e=>e,options:Pe,value:e,onChange:(e,o)=>o&&hr(o.id),getOptionLabel:e=>e.label,isOptionEqualToValue:(e,o)=>e.id===o.id,PaperComponent:Fe,ListboxProps:{sx:{py:0,maxHeight:360}},renderOption:(e,o,r)=>{var n;let{selected:i}=r;const l=Le[o.iconKey]||u.VP9,s=null!==(n=qr[o.id])&&void 0!==n?n:0;return(0,d.createElement)("li",(0,t.A)((0,t.A)({},e),{},{key:o.id,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderBottom:"1px solid #f1f5f9",backgroundColor:i?"".concat(o.color,"10"):"transparent",transition:"background-color 0.15s"}}),(0,xe.jsx)(v.A,{sx:{width:36,height:36,bgcolor:i?o.color:"".concat(o.color,"18"),color:i?"#fff":o.color,transition:"background-color 0.15s, color 0.15s"},children:(0,xe.jsx)(l,{size:20})}),(0,xe.jsxs)(j.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,xe.jsx)(w.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:o.label}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:o.range})]}),(0,xe.jsx)(k.A,{size:"small",label:s,sx:{minWidth:36,height:22,fontWeight:800,fontSize:11,bgcolor:s>0?"".concat(o.color,"18"):"#f1f5f9",color:s>0?o.color:"#94a3b8",border:"1px solid ".concat(s>0?o.color+"55":"#e2e8f0"),"& .MuiChip-label":{px:.75}}}),i&&(0,xe.jsx)(v.A,{sx:{width:22,height:22,bgcolor:o.color,color:"#fff"},children:(0,xe.jsx)(u.g9_,{size:14})}))},renderInput:r=>{var n;return(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},r),{},{placeholder:"Batch",inputProps:(0,t.A)((0,t.A)({},r.inputProps),{},{readOnly:!0,style:(0,t.A)((0,t.A)({},(null===(n=r.inputProps)||void 0===n?void 0:n.style)||{}),{},{cursor:"pointer",caretColor:"transparent"})}),InputProps:(0,t.A)((0,t.A)({},r.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(v.A,{sx:{width:24,height:24,bgcolor:"".concat(e.color,"18"),color:e.color},children:(0,xe.jsx)(o,{size:14})})})}),sx:{minWidth:{xs:180,sm:220,md:240},cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:"".concat(e.color,"08"),fontWeight:700,color:e.color,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:"".concat(e.color,"55"),borderWidth:1.5},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(e.color,"26")},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e.color}}}))}})})(),Je&&Ze&&(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,onClick:()=>$e(!0),sx:{pl:.5,pr:1.25,py:.5,borderRadius:999,cursor:"pointer",bgcolor:ye("#f59e0b"),border:"1.5px solid ".concat(ke("#f59e0b")),transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(We("#f59e0b"))}},children:[(0,xe.jsx)(Ee,{color:"#f59e0b",children:(0,xe.jsx)(u.tjE,{size:14})}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{fontWeight:700,color:"#f59e0b",whiteSpace:"nowrap"},children:[a()(Je).format("DD MMM")," \u2013 ",a()(Ze).format("DD MMM")]})]})]}),(0,xe.jsx)(W.A,{disablePortal:!0,options:vr||[],value:ir,PaperComponent:Fe,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{He||(e.preventDefault(),(0,le.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(rr(0),lr(null),nr(0),dr(null)):(rr((null===o||void 0===o?void 0:o.tenantid)||0),lr(o),nr(0),dr(null))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{inputRef:wo,placeholder:"Select Tenant",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#0ea5e9",children:(0,xe.jsx)(u.gl1,{size:14})})})}),sx:Re("#0ea5e9")}))}),(0,xe.jsx)(W.A,{disablePortal:!0,options:wr||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:sr,PaperComponent:Fe,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{He||or?or||(e.preventDefault(),(0,le.k)("Please select your Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=wo.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,le.k)("Please select your Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(nr(0),dr(null)):(nr(o.locationid||0),dr(o))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Select Location",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#14b8a6",children:(0,xe.jsx)(u.gwi,{size:14})})})}),sx:Re("#14b8a6")}))}),(0,xe.jsx)(W.A,{disabled:_r,options:Xr,PaperComponent:Fe,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onChange:(e,o,r)=>{ar("clear"===r?0:o.userid)},onOpen:e=>{He||(e.preventDefault(),(0,le.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#8b5cf6",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Re("#8b5cf6")}))})]})]}),(0,xe.jsx)(b.A,{elevation:0,sx:{p:{xs:1,md:1.5},borderTopLeftRadius:pe/8,borderTopRightRadius:pe/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:me,borderBottom:0,background:"#fff"},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,xe.jsx)(j.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:me,borderRadius:4}},children:De.map(((e,o)=>{var r;const t=ze[e.status],n=t.icon,i=Qe===o,l=null!==(r=Jr[e.countKey])&&void 0!==r?r:0;return(0,xe.jsxs)(S.A,{onClick:e=>{return r=o,yo(0),Xe(r),Wo(50),0===r&&(Ve("Pending"),vo("pending"),Ro(null===Zr||void 0===Zr?void 0:Zr.uncoveredLength)),1===r&&(Ve("Assigned"),vo("accepted"),Ro(null===Zr||void 0===Zr?void 0:Zr.assignedLength)),2===r&&(Ve("Arrived"),vo("arrived"),Ro(null===Zr||void 0===Zr?void 0:Zr.arrivedLength)),3===r&&(Ve("Picked"),vo("picked"),Ro(null===Zr||void 0===Zr?void 0:Zr.pickedLength)),4===r&&(Ve("Active"),vo("active"),Ro(null===Zr||void 0===Zr?void 0:Zr.activeLength)),5===r&&(Ve("Skipped"),vo("skipped"),Ro(null===Zr||void 0===Zr?void 0:Zr.skippedLength)),6===r&&(Ve("Delivered"),vo("delivered"),Ro(null===Zr||void 0===Zr?void 0:Zr.coveredLength)),7===r&&(Ve("Cancelled"),vo("cancelled"),Ro(null===Zr||void 0===Zr?void 0:Zr.cancelLength)),console.log(r),void Mo("");var r},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(i?t.color:ke(t.color)),bgcolor:i?t.color:ye(t.color),color:i?"#fff":t.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(We(t.color)):"none",transition:"all 0.18s","&:hover":{borderColor:t.color,boxShadow:i?"0 6px 18px ".concat(We(t.color)):"0 0 0 3px ".concat(We(t.color))}},children:[(0,xe.jsx)(v.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":Ce(t.color),color:i?"#fff":t.color},children:(0,xe.jsx)(n,{size:13})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:t.label}),(0,xe.jsx)(S.A,{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:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":t.color,border:i?"none":"1px solid ".concat(ke(t.color))},children:l})]},e.status)}))}),(0,xe.jsx)(S.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,xe.jsx)(ie.A,{value:Lo,onChange:Mo,onDebouncedChange:To,sx:{m:0,width:"100%",borderRadius:999,bgcolor:ye("#6366f1"),"& fieldset":{borderColor:ke("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}})})]})}),(0,xe.jsx)(b.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:pe/8,borderBottomRightRadius:pe/8,border:"1px solid",borderColor:me,overflow:"hidden",background:"#fff"},children:(0,xe.jsx)(z.A,{ref:he,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:t}=e.currentTarget;o+t>=r-50&&Fr&&!Er&&Tr()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto",overflowX:"auto","&::-webkit-scrollbar":{width:"10px",height:"10px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:ke("#6366f1"),borderRadius:"8px",cursor:"pointer","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:we}},children:((e,o,n,i,s,x)=>{const h="Cancelled"!==Ge&&"Delivered"!==Ge,p="Created"==Ge,g=15+(h?1:0)+(p?1:0);return r?(0,xe.jsxs)(ae.nV,{sx:{p:1.25},children:[0===Br.length&&!No&&!Hr&&(0,xe.jsxs)(j.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#94a3b8"),color:Ae},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No deliveries to show"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,textAlign:"center",px:2},children:"all"===xr?"No ".concat(((null===(e=ze[bo])||void 0===e?void 0:e.label)||Ge).toLowerCase()," orders for this filter."):"No ".concat(((null===(o=ze[bo])||void 0===o?void 0:o.label)||Ge).toLowerCase()," orders in ").concat((null===(n=Pe.find((e=>e.id===xr)))||void 0===n?void 0:n.label)||"this batch",".")})]}),0===Br.length&&Hr&&(0,xe.jsxs)(j.A,{alignItems:"center",sx:{py:6},children:[(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading deliveries\u2026"})]}),Br.map(((e,o)=>{var r,n,i,s,d,c,x,g;const f=ze[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},b=f.icon,v=!!ue.find((o=>o.orderheaderid==e.orderheaderid)),A=(null===zo||void 0===zo?void 0:zo.orderid)===(null===e||void 0===e?void 0:e.orderid),m=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.25,borderRadius:999,bgcolor:ye(e),color:e,fontWeight:700,fontSize:11,border:"1px solid ".concat(ke(e)),whiteSpace:"nowrap"});return(0,xe.jsxs)(ae.pg,{accent:f.color,selected:v,header:(0,xe.jsxs)(j.A,{spacing:1.25,children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[p&&(0,xe.jsx)(D.A,{size:"small",sx:{p:.25},onChange:o=>{if(o.target.checked){let o=ue;o.push((0,t.A)((0,t.A)({},e),{},{sno:ue.length+1})),Se([...o])}else{let o=ue.find((o=>o.orderheaderid==e.orderheaderid));if(o){let e=ue;e.splice(o.sno-1,1),e.map(((e,o)=>{e.sno=o+1})),Se([...e])}}},checked:!!ue.find((o=>o.orderheaderid==e.orderheaderid))}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:Ae},children:String(So*Co+o+1).padStart(2,"0")}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ye(f.color),border:"1px solid ".concat(ke(f.color)),color:f.color},children:[(0,xe.jsx)(Ee,{color:f.color,size:18,children:(0,xe.jsx)(b,{size:11})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:10.5,lineHeight:1},children:f.label})]})]}),(0,xe.jsxs)(j.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:["C"==e.deliverytype&&(0,xe.jsx)(I.A,{size:"small",onClick:()=>{(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(Do(null),Po(null)):(Do(e),Po(e.orderheaderid))},sx:{borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(ke("#06b6d4")),"&:hover":{bgcolor:Ce("#06b6d4")}},children:A?(0,xe.jsx)(re.A,{fontSize:"small"}):(0,xe.jsx)(te.A,{fontSize:"small"})}),h&&(0,xe.jsx)(I.A,{size:"small",onClick:o=>gr(o,e),sx:{borderRadius:999,bgcolor:ye("#6366f1"),color:"#6366f1",border:"1px solid ".concat(ke("#6366f1")),"&:hover":{bgcolor:Ce("#6366f1")}},children:(0,xe.jsx)(l.A,{})})]})]}),(0,xe.jsxs)(S.A,{sx:{minWidth:0},children:[(0,xe.jsx)(w.A,{sx:{fontWeight:800,color:be,fontSize:15},noWrap:!0,children:e.tenantname}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:[e.tenantsuburb,e.applocation].filter(Boolean).join(" \xb7 ")||"\u2014"})]})]}),children:[(0,xe.jsxs)(ae.FG,{children:[(0,xe.jsxs)(ae.pY,{label:"Order / Location",full:!0,children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:[e.orderid," \xb7 ",e.deliveryid]})]}),(0,xe.jsxs)(ae.pY,{label:"Pickup",children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:e.pickupcustomer||"\u2014"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:e.pickupcontactno})]}),(0,xe.jsxs)(ae.pY,{label:"Drop",children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:e.deliverycustomer||"\u2014"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:e.deliverycontactno})]}),(0,xe.jsx)(ae.pY,{label:"Rider",full:!0,children:e.ridername?(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:24,children:(0,xe.jsx)(u.bsz,{size:13})}),(0,xe.jsxs)(j.A,{sx:{minWidth:0},children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:700,color:be},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(ae.pY,{label:"ETA",value:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"}),(0,xe.jsx)(ae.pY,{label:"Transit",children:(0,xe.jsxs)(S.A,{sx:m("#06b6d4"),children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(ae.pY,{label:"Kms \xb7 plan / act",children:(0,xe.jsxs)(j.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(S.A,{sx:m("#ef4444"),children:[e.kms||0," km"]}),(0,xe.jsxs)(S.A,{sx:m("#10b981"),children:[e.cumulativekms||0," km"]})]})}),(0,xe.jsx)(ae.pY,{label:"Amount \xb7 chg / amt",children:(0,xe.jsxs)(j.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(S.A,{sx:m("#ef4444"),children:["\u20b9 ",null!==(n=null===(i=e.deliverycharges)||void 0===i?void 0:i.toFixed(2))&&void 0!==n?n:"0.00"]}),(0,xe.jsxs)(S.A,{sx:m("#10b981"),children:["\u20b9 ",null!==(s=null===(d=e.deliveryamt)||void 0===d?void 0:d.toFixed(2))&&void 0!==s?s:"0.00"]})]})}),(0,xe.jsx)(ae.pY,{label:"Qty",value:e.Quantity||"\u2014"}),(0,xe.jsx)(ae.pY,{label:"COD",children:(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:800,color:e.collectionamt?"#ef4444":Ae},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),(0,xe.jsx)(ae.pY,{label:"Step",children:e.step?(0,xe.jsx)(S.A,{sx:(0,t.A)((0,t.A)({},m("#6366f1")),{},{minWidth:30,fontWeight:800}),children:e.step}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),e.notes&&(0,xe.jsx)(ae.pY,{label:"Notes",full:!0,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.notes})})]}),A&&(0,xe.jsxs)(S.A,{sx:{mt:1.5,p:1.25,borderRadius:2,bgcolor:we,border:"1px solid ".concat(je)},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[(0,xe.jsx)(Ee,{color:"#6366f1",size:22,children:(0,xe.jsx)(u.gsJ,{size:12})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#6366f1"},children:"Product Details"})]}),(0,xe.jsxs)(j.A,{spacing:1,children:[null===zr||void 0===zr||null===(c=zr.details)||void 0===c?void 0:c.map(((e,o)=>(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.25,sx:{p:1,borderRadius:1.5,bgcolor:"#fff",border:"1px solid ".concat(je)},children:[(0,xe.jsx)(S.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(je),flexShrink:0}}),(0,xe.jsxs)(j.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(w.A,{variant:"body2",sx:{fontWeight:600,color:be},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:["Qty ",(null===e||void 0===e?void 0:e.orderqty)||0," \xb7 \u20b9 ",(null===e||void 0===e?void 0:e.price)||0]})]}),(0,xe.jsxs)(w.A,{variant:"body2",sx:{fontWeight:800,color:be,flexShrink:0},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o))),(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"space-between",sx:{pt:.5},children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve},children:"Total Amount"}),(0,xe.jsxs)(w.A,{variant:"body2",sx:{fontWeight:800,color:"#10b981"},children:["\u20b9 ",null===zr||void 0===zr||null===(x=zr.pricedetails)||void 0===x||null===(g=x.orderamount)||void 0===g?void 0:g.toFixed(2)]})]})]})]})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Nr||void 0===Nr?void 0:Nr.length)&&(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Er||Fr?(0,xe.jsx)(ce.A,{}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"\xb7 End of list \xb7"})})]}):(0,xe.jsxs)(P.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,lg:1300,xl:1400}},children:[(0,xe.jsx)(L.A,{children:(0,xe.jsxs)(M.A,{sx:{"& th":{backgroundColor:we,color:ve,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(me),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[p&&(0,xe.jsx)(Y.A,{sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(D.A,{indeterminate:ue.length>0&&ue.length!=Br.length,onChange:e=>{e.target.checked?Se([...Br]):Se([])},checked:ue.length>0&&ue.length==Br.length})}),(0,xe.jsx)(Y.A,{children:"#"}),(0,xe.jsx)(Y.A,{children:"Status"}),(0,xe.jsx)(Y.A,{children:"Tenant"}),(0,xe.jsx)(Y.A,{children:"Order / Location"}),(0,xe.jsx)(Y.A,{children:"Pickup"}),(0,xe.jsx)(Y.A,{children:"Drop"}),(0,xe.jsx)(Y.A,{children:"Rider"}),(0,xe.jsx)(Y.A,{children:"ETA"}),(0,xe.jsx)(Y.A,{children:"Transit"}),(0,xe.jsx)(Y.A,{children:"Kms"}),(0,xe.jsx)(Y.A,{children:"Amount"}),(0,xe.jsx)(Y.A,{children:"Notes"}),(0,xe.jsx)(Y.A,{children:"Step"}),(0,xe.jsx)(Y.A,{children:"Qty"}),(0,xe.jsx)(Y.A,{children:"COD"}),h&&(0,xe.jsx)(Y.A,{align:"right",children:"Action"})]})}),(No||Kr)&&(0,xe.jsx)(se.r,{col:8}),(0,xe.jsxs)(T.A,{children:[0==Br.length&&!No&&!Hr&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,sx:{py:6},children:(0,xe.jsxs)(j.A,{alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#94a3b8"),color:Ae},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No deliveries to show"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"all"===xr?"No ".concat(((null===(i=ze[bo])||void 0===i?void 0:i.label)||Ge).toLowerCase()," orders for this filter."):"No ".concat(((null===(s=ze[bo])||void 0===s?void 0:s.label)||Ge).toLowerCase()," orders in ").concat((null===(x=Pe.find((e=>e.id===xr)))||void 0===x?void 0:x.label)||"this batch",".")})]})})}),0==Br.length&&Hr&&(0,xe.jsx)(M.A,{children:(0,xe.jsxs)(Y.A,{colSpan:g,sx:{textAlign:"center",py:6},children:[(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"Loading deliveries\u2026"})]})}),Br.map(((e,o)=>{var r,n,i,s,c,x,h,p;const f=ze[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},v=f.icon,A=!!ue.find((o=>o.orderheaderid==e.orderheaderid));return(0,xe.jsxs)(d.Fragment,{children:[(0,xe.jsxs)(M.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(je),py:{xs:1,md:1.5},px:{xs:1,md:2}},backgroundColor:A?Ce("#8b5cf6"):"transparent","&:hover":{backgroundColor:A?Ce("#8b5cf6"):we}},children:["Created"==Ge&&(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(D.A,{onChange:o=>{if(o.target.checked){let o=ue;o.push((0,t.A)((0,t.A)({},e),{},{sno:ue.length+1})),Se([...o])}else{if(ue.find((o=>o.orderheaderid==e.orderheaderid))){let o=ue,r=ue.find((o=>o.orderheaderid==e.orderheaderid));o.splice(r.sno-1,1),o.map(((e,o)=>{e.sno=o+1})),Se([...o])}}console.log("list",ue)},checked:ue.find((o=>o.orderheaderid==e.orderheaderid))})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:Ae},children:String(So*Co+o+1).padStart(2,"0")})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ye(f.color),border:"1px solid ".concat(ke(f.color)),color:f.color},children:[(0,xe.jsx)(Ee,{color:f.color,size:20,children:(0,xe.jsx)(v,{size:12})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:f.label})]})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(F.A,{title:e.tenantadress,children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{noWrap:!0,variant:"subtitle2",sx:{fontWeight:700,color:be},children:e.tenantname}),(0,xe.jsx)(w.A,{noWrap:!0,variant:"caption",sx:{color:ve},children:e.tenantsuburb}),(0,xe.jsx)(w.A,{noWrap:!0,variant:"caption",sx:{color:Ae},children:e.applocation})]})})}),(0,xe.jsxs)(Y.A,{align:"left",children:[(0,xe.jsx)(F.A,{title:"Location Name-Suburb",placement:"top",children:(0,xe.jsx)(w.A,{variant:"subtitle1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,xe.jsxs)(j.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(F.A,{title:"Order Id",placement:"top",children:(0,xe.jsx)(w.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,xe.jsxs)(F.A,{title:"Ordered date",placement:"top",children:[(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.orderdate).utc().format("hh:mm A")})]})]}),"-",(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(F.A,{title:"Delivery Id",placement:"top",children:(0,xe.jsx)(w.A,{variant:"body2",noWrap:!0,children:e.deliveryid})}),(0,xe.jsxs)(F.A,{title:"Delivery date",placement:"top",children:[(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.deliverydate).utc().format("hh:mm A")})]})]})]})]}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.pickupcustomer}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.pickupcontactno}),(0,xe.jsx)(F.A,{title:e.Pickupaddress,sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:e.pickuplocation||(e.Pickupaddress?e.Pickupaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.deliverycustomer}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.deliverycontactno}),(0,xe.jsx)(F.A,{title:e.deliveryaddress,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,whiteSpace:"nowrap"},children:e.deliverylocation||(e.deliveryaddress?e.deliveryaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(Y.A,{children:e.ridername?(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:28,children:(0,xe.jsx)(u.bsz,{size:14})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",fontWeight:700,fontSize:12,border:"1px solid ".concat(ke("#06b6d4"))},children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(F.A,{title:"Planned KMS",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#ef4444")),whiteSpace:"nowrap",minWidth:75},children:[e.kms||0," km"]})}),(0,xe.jsx)(F.A,{title:"Actual KMS",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#10b981")),whiteSpace:"nowrap",minWidth:75},children:[e.cumulativekms||0," km"]})})]})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(F.A,{title:"Delivery Charge",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#ef4444")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(n=null===(i=e.deliverycharges)||void 0===i?void 0:i.toFixed(2))&&void 0!==n?n:"0.00"]})}),(0,xe.jsx)(F.A,{title:"Delivery Amount",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#10b981")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(s=null===(c=e.deliveryamt)||void 0===c?void 0:c.toFixed(2))&&void 0!==s?s:"0.00"]})})]})}),(0,xe.jsx)(Y.A,{children:e.notes?(0,xe.jsx)(F.A,{title:e.notes,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,maxWidth:160,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.notes})}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),(0,xe.jsx)(Y.A,{align:"center",children:e.step?(0,xe.jsx)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:24,px:.875,borderRadius:999,bgcolor:ye("#6366f1"),border:"1px solid ".concat(ke("#6366f1")),color:"#6366f1",fontWeight:800,fontSize:11},children:e.step}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:e.Quantity?be:Ae,whiteSpace:"nowrap"},children:e.Quantity||"\u2014"})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:800,color:e.collectionamt?"#ef4444":Ae,whiteSpace:"nowrap"},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),"Cancelled"!==Ge&&"Delivered"!==Ge&&(0,xe.jsx)(Y.A,{align:"right",children:(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"flex-end",spacing:.75,children:["C"==e.deliverytype&&(0,xe.jsx)(F.A,{title:"Product details",placement:"top",children:(0,xe.jsx)(I.A,{size:"small",onClick:()=>{(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(Do(null),Po(null)):(Do(e),Po(e.orderheaderid))},sx:{borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(ke("#06b6d4")),"&:hover":{bgcolor:Ce("#06b6d4")}},children:(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(0,xe.jsx)(re.A,{fontSize:"small"}):(0,xe.jsx)(te.A,{fontSize:"small"})})}),(0,xe.jsx)(F.A,{title:"Actions",placement:"top",children:(0,xe.jsx)(I.A,{size:"small",onClick:o=>gr(o,e),sx:{borderRadius:999,bgcolor:ye("#6366f1"),color:"#6366f1",border:"1px solid ".concat(ke("#6366f1")),"&:hover":{bgcolor:Ce("#6366f1")}},children:(0,xe.jsx)(l.A,{})})})]})})]}),(null===zo||void 0===zo?void 0:zo.orderid)===(null===e||void 0===e?void 0:e.orderid)&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,sx:{p:0,border:0,backgroundColor:we},children:(0,xe.jsx)(E.A,{in:!0,timeout:"auto",unmountOnExit:!0,children:(0,xe.jsx)(S.A,{sx:{width:"100%",p:2.5},children:(0,xe.jsxs)(b.A,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:me,overflow:"hidden",background:"#fff"},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,borderBottom:"1px solid ".concat(je),bgcolor:ye("#6366f1")},children:[(0,xe.jsx)(Ee,{color:"#6366f1",children:(0,xe.jsx)(u.gsJ,{size:14})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#6366f1"},children:"Product Details"})]}),(0,xe.jsxs)(P.A,{size:"small",sx:{minWidth:800},children:[(0,xe.jsx)(L.A,{children:(0,xe.jsxs)(M.A,{sx:{"& th":{fontSize:11,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:ve,borderBottom:"1px solid ".concat(je)},"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(Y.A,{children:"#"}),(0,xe.jsx)(Y.A,{children:"Product"}),(0,xe.jsx)(Y.A,{children:"Description"}),(0,xe.jsx)(Y.A,{align:"right",children:"Qty"}),(0,xe.jsx)(Y.A,{align:"right",children:"Cost"}),(0,xe.jsx)(Y.A,{align:"right",children:"Price"}),(0,xe.jsx)(Y.A,{align:"right",children:"Tax"}),(0,xe.jsx)(Y.A,{align:"right",children:"Amount"})]})}),(0,xe.jsxs)(T.A,{children:[null===zr||void 0===zr||null===(x=zr.details)||void 0===x?void 0:x.map(((e,o)=>{var r,t;return(0,xe.jsxs)(M.A,{sx:{"&:hover":{backgroundColor:we+" !important"}},children:[(0,xe.jsx)(Y.A,{sx:{color:Ae,fontWeight:700},children:String(o+1).padStart(2,"0")}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.25,alignItems:"center",children:[(0,xe.jsx)(S.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(je)}}),(0,xe.jsx)(w.A,{variant:"body2",sx:{fontWeight:600,color:be},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"})]})}),(0,xe.jsx)(Y.A,{sx:{color:ve},children:(null===e||void 0===e?void 0:e.productdescription)||"-"}),(0,xe.jsx)(Y.A,{align:"right",sx:{fontWeight:700},children:(null===e||void 0===e?void 0:e.orderqty)||0}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null===e||void 0===e?void 0:e.price)||0]}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null!==(r=null===e||void 0===e?void 0:e.productsumprice)&&void 0!==r?r:0).toFixed(2)]}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null!==(t=null===e||void 0===e?void 0:e.taxamount)&&void 0!==t?t:0).toFixed(2)]}),(0,xe.jsxs)(Y.A,{align:"right",sx:{fontWeight:800,color:be},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o)})),(0,xe.jsxs)(M.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(Y.A,{align:"right",colSpan:7,sx:{fontWeight:700,color:ve,borderTop:"1px solid ".concat(je)},children:"Total Amount"}),(0,xe.jsxs)(Y.A,{align:"right",sx:{fontWeight:800,color:"#10b981",borderTop:"1px solid ".concat(je)},children:["\u20b9 ",null===zr||void 0===zr||null===(h=zr.pricedetails)||void 0===h||null===(p=h.orderamount)||void 0===p?void 0:p.toFixed(2)]})]})]})]})]})})})})})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Nr||void 0===Nr?void 0:Nr.length)&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,rowSpan:3,children:(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Er||Fr?(0,xe.jsx)(ce.A,{}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"\xb7 End of list \xb7"})})})})]})]})})()})}),(0,xe.jsxs)(K.A,{anchorEl:Fo,open:pr,onClose:fr,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{elevation:0,sx:{minWidth:220,borderRadius:2,mt:.75,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden","& .MuiMenuItem-root":{fontSize:13,fontWeight:600,py:1.1,px:1.5,gap:1,transition:"background-color 0.15s","&:hover":{bgcolor:we}}}},children:["delivered"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{onClick:()=>{Wr.mutate(Ko.userfcmtoken),fr()},children:[(0,xe.jsx)(Ee,{color:"#0ea5e9",size:22,children:(0,xe.jsx)(u.q53,{size:13})}),"Notify Rider"]}),["pending","accepted","arrived"].includes(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{onClick:()=>{var e;if(!He)return Rr("Please select a location first!","warning"),void(null===(e=jo.current)||void 0===e||e.focus());Qo(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:22,children:(0,xe.jsx)(u.bsz,{size:13})}),"Change Rider"]}),(1==ur||2==ur)&&(0,xe.jsxs)(O.A,{onClick:()=>{to(Ko.kms),io(Ko.cumulativekms),po(Ko.droplat),fo(Ko.droplon),ao(Ko.notes),so(Ko.deliveryamount),mo(Ko.orderstatus||"delivered"),ho(Ko),Ke(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#10b981",size:22,children:(0,xe.jsx)(u.mU9,{size:13})}),"Update Status"]}),"cancelled"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&"delivered"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{sx:{color:"#ef4444 !important"},onClick:()=>{Go(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#ef4444",size:22,children:(0,xe.jsx)(u.uDv,{size:13})}),"Cancel Delivery"]})]}),(0,xe.jsxs)(N.A,{open:Uo,onClose:()=>Go(!1),maxWidth:"xs",fullWidth:!0,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #ef4444 0%, ".concat(Ce("#ef4444")," 100%)")}}),(0,xe.jsx)(H.A,{sx:{p:3.5},children:(0,xe.jsxs)(j.A,{alignItems:"center",spacing:2.5,children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#ef4444"),color:"#ef4444"},children:(0,xe.jsx)(s.A,{style:{fontSize:28}})}),(0,xe.jsxs)(j.A,{spacing:.5,alignItems:"center",children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Cancel Delivery?"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,textAlign:"center",px:1},children:"This action will cancel the delivery and notify the rider. Please share a brief reason."})]}),(0,xe.jsx)(R.A,{fullWidth:!0,placeholder:"Reason for cancellation",multiline:!0,minRows:2,maxRows:4,onChange:e=>_o(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:we,"& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#ef4444"},"&.Mui-focused fieldset":{borderColor:"#ef4444",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#ef4444"))}}}}),(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,onClick:()=>Go(!1),variant:"outlined",sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Keep Delivery"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{""==Xo?Rr("Enter FeedBack","error"):br({selectedRow:Ko,cancelFeed:Xo}),(async()=>{console.log("cancelridernotification",Ko);try{return(await x.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:Ko.userfcmtoken,notification:{title:"NearleXpress",body:"".concat(Ko.orderid," have been Cancelled"),sound:"ring",image:""},data:{type:"cancel"}})).data}catch(e){Rr(e.message,"error",2e3),console.log(e)}})()},autoFocus:!0,sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#ef4444",boxShadow:"0 6px 18px ".concat(We("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,xe.jsxs)(N.A,{open:Vo,onClose:()=>Qo(!1),maxWidth:"sm",fullWidth:!0,TransitionComponent:Z.s,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #8b5cf6 0%, ".concat(Ce("#8b5cf6")," 100%)")}}),(0,xe.jsx)(J.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#8b5cf6"),color:"#8b5cf6"},children:(0,xe.jsx)(u.bsz,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Change Rider"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"Assign this delivery to a different rider"})]})]})}),(0,xe.jsx)(H.A,{sx:{p:3,pt:2},children:(0,xe.jsx)(W.A,{fullWidth:!0,options:Xr,PaperComponent:Fe,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),onChange:(e,o)=>{er(o),n.A.debug("Rider selected in dropdown:",o?"".concat(o.firstname," ").concat(o.lastname):"None")},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#8b5cf6",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Re("#8b5cf6")}))})}),(0,xe.jsx)(q.A,{sx:{p:3,pt:1},children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,variant:"outlined",onClick:()=>Qo(!1),sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Cancel"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{Ho(!0),n.A.info("Initiating rider assignment change for order ID ".concat(null===Ko||void 0===Ko?void 0:Ko.orderid," to rider: ").concat(null===$o||void 0===$o?void 0:$o.firstname," ").concat(null===$o||void 0===$o?void 0:$o.lastname)),kr.mutate({selectedRider:$o,selectedRow:Ko})},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#8b5cf6",boxShadow:"0 6px 18px ".concat(We("#8b5cf6")),"&:hover":{bgcolor:"#7c3aed"}},children:"Change Rider"})]})})]}),(0,xe.jsxs)(N.A,{open:_e,onClose:()=>$e(!1),fullScreen:r,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #f59e0b 0%, ".concat(Ce("#f59e0b")," 100%)")}}),(0,xe.jsx)(J.A,{align:"left",sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#f59e0b"),color:"#f59e0b"},children:(0,xe.jsx)(u.tjE,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Date Range"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"Pick a window to filter the deliveries"})]})]})}),(0,xe.jsx)(H.A,{sx:{width:"100%"},className:"datedialog",children:(0,xe.jsx)(ee.U,{open:_e,toggle:()=>$e(!_e),id:"daterange1",onChange:e=>{"All"===e.label?(qe(""),Ue(""),$e(!1)):(qe(a()(e.startDate).format("YYYY-MM-DD")),Ue(a()(e.endDate).format("YYYY-MM-DD")),e.label?oo(e.label):oo("")),console.log(e)},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,G.A)(new Date),endDate:(0,V.A)(new Date)},{label:"Last Week",startDate:(0,G.A)((0,Q.A)(new Date,-1)),endDate:(0,V.A)((0,Q.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,Q.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,X.A)(new Date),endDate:(0,_.A)(new Date)},{label:"Last Month",startDate:(0,X.A)((0,$.A)(new Date,-1)),endDate:(0,_.A)((0,$.A)(new Date,-1))}]})}),(0,xe.jsx)(j.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2.5,pt:1},children:(0,xe.jsx)(B.A,{variant:"contained",onClick:()=>{$e(!1)},sx:{borderRadius:999,px:3,py:1,fontWeight:800,bgcolor:"#f59e0b",boxShadow:"0 6px 18px ".concat(We("#f59e0b")),"&:hover":{bgcolor:"#d97706"}},children:"Apply"})})]}),(0,xe.jsxs)(N.A,{fullWidth:!0,open:Ye,onClose:Dr,scroll:"paper",maxWidth:"sm",fullScreen:r,TransitionComponent:Z.s,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #10b981 0%, ".concat(Ce("#10b981")," 100%)")}}),(0,xe.jsx)(J.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#10b981"),color:"#10b981"},children:(0,xe.jsx)(u.mU9,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Update Delivery Status"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:null!==xo&&void 0!==xo&&xo.orderid?"Order #".concat(xo.orderid):"Modify delivery details"})]})]})}),(0,xe.jsx)(H.A,{dividers:!0,sx:{p:3,bgcolor:we},children:(0,xe.jsxs)(y.Ay,{container:!0,spacing:2,children:[[{label:"KMs",value:ro,set:e=>to(e),color:"#ef4444"},{label:"Actual KMs",value:no,set:e=>io(+e),color:"#10b981"},{label:"Delivery Latitude",value:uo,set:e=>po(e),color:"#06b6d4"},{label:"Delivery Longitude",value:go,set:e=>fo(e),color:"#06b6d4"}].map((e=>(0,xe.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:e.label}),(0,xe.jsx)(R.A,{fullWidth:!0,value:e.value,type:"number",onChange:o=>e.set(o.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(e.color))}}}})]},e.label))),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Amount"}),(0,xe.jsx)(R.A,{fullWidth:!0,type:"number",value:lo,onChange:e=>so(+e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#10b981"},"&.Mui-focused fieldset":{borderColor:"#10b981",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#10b981"))}}}})]}),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Status"}),(0,xe.jsx)(R.A,{select:!0,fullWidth:!0,value:Ao,onChange:e=>mo(e.target.value),SelectProps:{MenuProps:{PaperProps:{sx:{borderRadius:2,mt:.5,boxShadow:fe}}}},sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}},children:["pending","accepted","started","arrived","delivered","cancelled"].map((e=>{const o=ze[e]||{label:e,color:"#6366f1",icon:u.bfP},r=o.icon;return(0,xe.jsxs)(O.A,{value:e,sx:{gap:1},children:[(0,xe.jsx)(Ee,{color:o.color,size:22,children:(0,xe.jsx)(r,{size:13})}),o.label]},e)}))})]}),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Notes"}),(0,xe.jsx)(R.A,{value:co,fullWidth:!0,multiline:!0,minRows:2,onChange:e=>ao(e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}}})]})]})}),(0,xe.jsx)(q.A,{sx:{p:3},children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,variant:"outlined",onClick:Dr,sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Close"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{ro?no?uo?go?lo?ot.mutate({deliveryid:xo.deliveryid,orderheaderid:xo.orderheaderid,orderstatus:Ao,deliverytime:a()().format("YYYY-MM-DD HH:mm:ss"),deliverylat:uo,deliverylong:go,kms:ro,cumulativekms:no,deliveryamt:parseFloat(lo),notes:co,userid:+Ko.userid}):Rr("Fill Delivery Amount","warning"):Rr("Fill Delivery Longitude","warning"):Rr("Fill Delivery Latitude","warning"):Rr("Fill Actual Kms","warning"):Rr("Fill Kms","warning")},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#10b981",boxShadow:"0 6px 18px ".concat(We("#10b981")),"&:hover":{bgcolor:"#059669"}},children:"Update"})]})})]})]})}},23787:(e,o,r)=>{r.d(o,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var t=r(89379),n=r(80045),i=r(93230),l=r(2235),s=r(16491),d=r(82053),c=r(44414);const a=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:l,sx:s}=e,d=(0,n.A)(e,a);return(0,c.jsx)(i.A,(0,t.A)((0,t.A)({spacing:1.25,onScroll:l,sx:(0,t.A)((0,t.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),s)},d),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:n,selected:i=!1,onClick:d,children:a,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:d,sx:(0,t.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?o:"#e2e8f0",background:i?"".concat(o,"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:o}}),(0,c.jsxs)(s.A,{sx:{p:1.5,pl:2},children:[r,a,n]})]})},u=e=>{let{children:o,columns:r=2,sx:n}=e;return(0,c.jsx)(s.A,{sx:(0,t.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:o})},p=e=>{let{label:o,value:r,children:t,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)(d.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,c.jsx)(s.A,{sx:{mt:.25,minWidth:0},children:void 0!==t?t:(0,c.jsx)(d.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var t=r(89379),n=r(9950),i=r(2660),l=r(2046),s=r(83274),d=r(25333),c=r(97125),a=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const b=(0,n.useRef)(null),[v]=(0,x.d7)(o,p);return(0,n.useEffect)((()=>{u&&u(v)}),[v,u]),(0,n.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=b.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,t.A)({},f),inputRef:b,placeholder:g,autoComplete:"off",value:o,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)(d.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(a.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var t=r(16491),n=r(46639),i=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(t.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(n.A,{size:o}),(0,l.jsx)(t.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:i,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>h});var t=r(89379),n=r(9950),i=r(93230),l=r(41413),s=r(77922),d=r(29925),c=r(26910),a=r(31222),x=r(44414);const h=(0,n.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:b=!1,accentColor:v="#6366f1",icon:A,placeholder:m="Select Zone",paperComponent:j}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(v).concat(e),C=y("08"),W=y("26"),k=y("55"),R=y("18"),z=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:v},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(W)},"&.Mui-focused fieldset":{borderColor:v,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:v}}:{},D=b&&(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:R,color:v,transition:"background-color 0.15s, color 0.15s"},children:A||(0,x.jsx)(a.HPi,{size:14})})});return(0,x.jsx)(s.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:j,sx:(0,t.A)({},p),onChange:(e,o,t)=>{"clear"===t?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===h||void 0===h||h(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>b?(0,x.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,placeholder:m,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:D}),sx:(0,t.A)((0,t.A)({},z),f||g||{})})):(0,x.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,t.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0K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(9213),n=r(21671),i=r(82917),l=r(93230),s=r(44414);const d=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(t.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,o)=>(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})]})},o))),(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})]})})]},o)))})}}}]);