Files
Express_console_build/build/static/js/2851.85e6c6a9.chunk.js

1 line
44 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2851],{1367:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(89379),i=(n(9950),n(16491)),o=n(93230),l=n(82053),a=n(44414);const s=e=>{let{sx:t,title:n,children:s,starticon:d}=e;return(0,a.jsx)(i.A,{sx:(0,r.A)({},t),children:(0,a.jsxs)(o.A,{direction:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:1,children:[(0,a.jsxs)(o.A,{children:[d&&d,(0,a.jsx)(l.A,{variant:"h3",children:n})]}),s]})})}},22851:(e,t,n)=>{n.r(t),n.d(t,{default:()=>je});var r=n(89379),i=n(85571),o=n(8881),l=n(24513),a=n(36256),s=n(9950),d=n(13838),c=n(4159),h=n.n(c),u=n(26910),x=n(47659),p=n(14857),A=n(69476),v=n(31222),g=n(51778),m=n(36150),j=n(60010),f=n(55158),y=n(60899),b=n(82917),S=n(93230),w=n(25277),k=n(41413),C=n(82053),D=n(77922),W=n(29925),Y=n(48159),R=n(47223),L=n(84142),P=n(1320),z=n(15769),T=n(69780),F=n(9213),M=n(21671),I=n(93038),E=n(34075),N=n(83274),J=n(25333),K=n(17239),O=n(23266),q=n(33738),B=n(16491),H=n(96583),Z=n(28170),G=n(82223),U=n(40033),V=n(79739),Q=n(29277),X=n(50027),_=n(37476),$=n(56712),ee=n(81417),te=n(96600),ne=n(53132),re=n(94289),ie=n(57326),oe=n(50624),le=n(55916),ae=n(52351),se=n(67562),de=n(49883),ce=(n(94826),n(81425)),he=n(56311),ue=n(1367),xe=n(20466),pe=n(96646),Ae=n(59212),ve=n(58691),ge=n(44414),me=n(36220);h().extend(me);const je=()=>{const e=localStorage.getItem("userid"),t=(0,p.A)(),n=(0,s.useRef)(),c=(0,s.useRef)(),[me,je]=(0,s.useState)([]),[fe,ye]=(0,s.useState)(!1),[be,Se]=(0,s.useState)("All"),[we,ke]=(0,s.useState)(0),[Ce,De]=(0,s.useState)(h()().format("YYYY-MM-DD")),[We,Ye]=(0,s.useState)(h()().format("YYYY-MM-DD")),[Re,Le]=(0,s.useState)("Pending"),[Pe,ze]=(0,s.useState)(0),[Te,Fe]=(0,s.useState)(!1),[Me,Ie]=(0,s.useState)("Today"),[Ee,Ne]=(0,s.useState)(""),[Je,Ke]=(0,s.useState)(),[Oe,qe]=(0,s.useState)(),[Be,He]=(0,s.useState)(""),[Ze,Ge]=(0,s.useState)({}),[Ue,Ve]=(0,s.useState)(""),[Qe,Xe]=(0,s.useState)(""),[_e,$e]=(0,s.useState)("pending"),[et,tt]=(0,s.useState)("delivered"),nt=(0,s.useRef)(null),rt=(0,s.useRef)(null),[it,ot]=s.useState(0),[lt,at]=s.useState(50),[st,dt]=s.useState(),[ct,ht]=(0,s.useState)(null),[ut,xt]=(0,s.useState)(null),[pt,At]=(0,s.useState)(""),[vt,gt]=(0,s.useState)(""),[mt,jt]=s.useState(null),[ft,yt]=(0,s.useState)(null),[bt,St]=(0,s.useState)(!1),[wt,kt]=s.useState(null),[Ct,Dt]=(0,s.useState)(""),[Wt,Yt]=(0,s.useState)(!1),[Rt,Lt]=(0,s.useState)(!1),[Pt,zt]=(0,s.useState)(""),[Tt,Ft]=(0,s.useState)(null),[Mt,It]=(0,s.useState)(0),[Et,Nt]=(0,s.useState)(0),[Jt,Kt]=(0,s.useState)(null),[Ot,qt]=(0,s.useState)(null),[Bt,Ht]=(0,s.useState)(0),Zt=localStorage.getItem("roleid");(0,s.useEffect)((()=>{It(0),Kt(null),Nt(0),qt(null)}),[we]),(0,s.useEffect)((()=>{Nt(0),qt(null)}),[Mt]);const Gt=Boolean(mt),Ut=()=>{jt(null)},{mutate:Vt}=(0,g.n)({mutationFn:e=>{let{selectedRow:t,cancelFeed:n}=e;return(0,ce.zF)(t,n)},onSuccess:()=>{an("Delivery Cancelled Successfully","success"),Yt(!1),Dn(),gn()},onError:e=>{an(e.message,"error")}}),{data:Qt,isLoading:Xt,isError:_t,error:$t}=(0,m.I)({queryKey:["tenantlist",we],queryFn:()=>(0,ce.Mn)(we),enabled:0!==we}),{data:en,isLoading:tn,isError:nn,error:rn}=(0,m.I)({queryKey:["gettenantlocations",Mt],queryFn:()=>(0,ce.DL)(Mt),enabled:0!==Mt}),on=(0,g.n)({mutationFn:ce.k3,onSuccess:()=>{(0,o.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},onError:e=>{(0,o.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}}),ln=(0,g.n)({mutationFn:e=>{let{selectedRider:t,selectedRow:n}=e;return(0,ce.R_)(t,n)},onSuccess:(e,t)=>{let{selectedRider:n,selectedRow:r}=t;St(!1),Lt(!1),"Success"===e.data.message&&(i.A.info("Rider changed successfully for order ID ".concat(null===r||void 0===r?void 0:r.orderid,". New Rider: ").concat(null===n||void 0===n?void 0:n.firstname," ").concat(null===n||void 0===n?void 0:n.lastname)),an("Rider Changed Successfully","success")),Dn(),gn(),on.mutate(n.userfcmtoken)},onError:(e,t)=>{let{selectedRider:n,selectedRow:r}=t;i.A.error("Failed to change rider for order ID ".concat(null===r||void 0===r?void 0:r.orderid,":"),e),an(e.message,"error"),St(!1)}}),an=(e,t)=>{(0,o.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},{data:sn}=(0,m.I)({queryKey:["orderdetails",ut],queryFn:()=>(0,ce.z3)(ut),enabled:!!ut}),dn=()=>{ye(!1)},{data:cn,isLoading:hn,isError:un,error:xn,fetchNextPage:pn,hasNextPage:An,isFetchingNextPage:vn,refetch:gn}=(0,j.q)({queryKey:["fetchdeliveries",we,e,_e,Ce,We,lt,vt,Mt,Et,Bt],queryFn:ce.tL,getNextPageParam:e=>{var t;return null!==(t=e.nextPage)&&void 0!==t?t:void 0}}),mn=(null===cn||void 0===cn?void 0:cn.pages.flatMap((e=>e.rows)))||[];(0,s.useEffect)((()=>{if(!An)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&pn()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return n.current&&e.observe(n.current),()=>{n.current&&e.unobserve(n.current)}}),[An,pn]);const{data:jn,isLoading:fn,isError:yn,error:bn}=(0,m.I)({queryKey:["fetchpercentageaPI",we],queryFn:()=>(0,ce.RG)(we)});(0,s.useEffect)((()=>{jn&&console.log("percentageData",jn)}),[jn]);const{data:Sn={},isLoading:wn,isError:kn,error:Cn,refetch:Dn}=(0,m.I)({queryKey:["fetchCountData",we,e,Ce,We,lt,vt,Mt,Et,Bt,Re],queryFn:()=>(0,ce.qB)(we,e,Ce,We,lt,vt,Mt,Et,Bt)});(0,s.useEffect)((()=>{console.log("countData",Sn),0===Pe&&Sn&&dt(Sn.uncoveredLength)}),[Sn]);const{data:Wn=[],isLoading:Yn,isError:Rn,error:Ln}=(0,m.I)({queryKey:["ridersList",we],queryFn:ce.Sd,enabled:Boolean(we),onError:e=>{(0,xe.k)(e.message,"error",2e3)}}),Pn=(0,g.n)({mutationFn:e=>(0,ce.wT)(e),onSuccess:e=>{console.log(e),e.data.status&&(an("Updated Successfully","success"),qe(""),He(""),ye(!1),gn(),Dn())},onError:e=>{console.log(e),an(e.message,"success")}}),zn=un?"Error fetching percentages: ".concat(null===xn||void 0===xn?void 0:xn.message):yn?"Error fetching percentages: ".concat(null===bn||void 0===bn?void 0:bn.message):kn?"Error fetching percentages: ".concat(null===Cn||void 0===Cn?void 0:Cn.message):Rn?"Error fetching percentages: ".concat(null===Ln||void 0===Ln?void 0:Ln.message):_t?"Error tenant list: ".concat(null===$t||void 0===$t?void 0:$t.message):nn?"Error location list: ".concat(null===rn||void 0===rn?void 0:rn.message):null;return zn?(console.log("errorMessage",zn),(0,xe.k)(zn,"error",2e3),null):(0,ge.jsxs)(ge.Fragment,{children:[(wn||fn||hn||Xt||tn||Yn)&&(0,ge.jsx)(ge.Fragment,{children:(0,ge.jsx)(ae.A,{})}),(0,ge.jsx)(f.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:wn||fn||hn||Xt||tn||Yn}),(0,ge.jsx)(ue.A,{title:"Deliveries",children:(0,ge.jsx)(Ae.A,{ref:nt,locaName:be,setAppId:ke,setLocoName:Se,setPage:ot,sx:{width:{xs:"100%",custom450:300},zIndex:"100"}})}),(0,ge.jsx)(y.Ay,{container:!0,spacing:2,sx:{mt:"1px"},children:[{label:"Created orders",value:null===jn||void 0===jn?void 0:jn.uncoveredOrders,percentage:null===jn||void 0===jn?void 0:jn.percentage1,color:t.palette.info.main},{label:"Pending orders",value:null===jn||void 0===jn?void 0:jn.assignedOrders,percentage:null===jn||void 0===jn?void 0:jn.percentage2,color:t.palette.warning.main},{label:"Delivered orders",value:null===jn||void 0===jn?void 0:jn.pickedOrders,percentage:null===jn||void 0===jn?void 0:jn.percentage3,color:t.palette.success.main},{label:"Cancelled Orders",value:null===jn||void 0===jn?void 0:jn.coveredOrders,percentage:null===jn||void 0===jn?void 0:jn.percentage4,color:t.palette.error.main}].map(((e,t)=>{var n;return(0,ge.jsx)(y.Ay,{item:!0,xs:12,custom400:6,sm:3,sx:{cursor:"pointer"},children:(0,ge.jsx)(x.A,{primary:e.label,secondary:fn?(0,ge.jsx)(b.A,{sx:{width:"30px"},animation:"wave"}):e.value,percentage:null===(n=e.percentage)||void 0===n?void 0:n.toString(),color:e.color})},t)}))}),(0,ge.jsxs)(S.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:3,sx:{flexWrap:"wrap",my:2},children:[Ce&&We?(0,ge.jsxs)(S.A,{direction:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",children:[(0,ge.jsx)(w.A,{avatar:(0,ge.jsx)(k.A,{sx:{backgroundColor:"transparent"},children:(0,ge.jsx)(v.dTz,{fontSize:"30px",style:{color:"red"}})}),label:"Deliveries-".concat(Me),color:"error",variant:"combined"}),(0,ge.jsx)(w.A,{avatar:(0,ge.jsx)(k.A,{sx:{backgroundColor:"transparent"},children:(0,ge.jsx)(v.tjE,{fontSize:"30px",style:{color:"#fbc02d"}})}),label:(0,ge.jsxs)(C.A,{noWrap:!0,color:"secondary",children:[h()(Ce).format("DD/MM/YYYY")," - ",h()(We).format("DD/MM/YYYY")]}),onClick:()=>Fe(!0),variant:"combined",color:"warning",sx:{maxWidth:"100%",cursor:"pointer"}}),(0,ge.jsx)(w.A,{avatar:(0,ge.jsx)(k.A,{sx:{backgroundColor:"transparent"},children:(0,ge.jsx)(A.LSI,{fontSize:"30px",style:{color:"#00bcd4"}})}),label:be,color:"info",variant:"combined",sx:{maxWidth:"100%"}})]}):(0,ge.jsx)(w.A,{label:"Orders-All",color:"primary",variant:"light",size:"small"}),(0,ge.jsx)(D.A,{disablePortal:!0,options:Qt||[],value:Jt,sx:{minWidth:200,flex:1},onOpen:e=>{we||(e.preventDefault(),(0,xe.k)("Please select a your location first!","warning",3e3),setTimeout((()=>{var e;null===(e=nt.current)||void 0===e||e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(It(0),Kt(null),Nt(0),qt(null)):(It((null===t||void 0===t?void 0:t.tenantid)||0),Kt(t),Nt(0),qt(null))},renderInput:e=>(0,ge.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{inputRef:rt,label:"Select Tenant"}))}),(0,ge.jsx)(D.A,{disablePortal:!0,options:en||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:Ot,sx:{minWidth:200,flex:1},onOpen:e=>{we||Mt?Mt||(e.preventDefault(),(0,xe.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=rt.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,xe.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=nt.current)||void 0===e||e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(Nt(0),qt(null)):(Nt(t.locationid||0),qt(t))},renderInput:e=>(0,ge.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{label:"Select Location"}))}),(0,ge.jsx)(D.A,{sx:{minWidth:200,flex:1},fullWidth:!0,disabled:Yn,options:Wn,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),renderInput:e=>(0,ge.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{label:"Choose Rider"})),onChange:(e,t,n)=>{"clear"===n?Ht(0):(Ht(t.userid),console.log("selected rider",t))},onOpen:e=>{we||(e.preventDefault(),(0,xe.k)("Please select a your location first!","warning",3e3),setTimeout((()=>{var e;null===(e=nt.current)||void 0===e||e.focus()}),0))}})]}),(0,ge.jsxs)(S.A,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap-reverse",gap:2,sx:{border:"1px solid ",borderBottom:0,borderColor:"bg.main",p:1.5},children:[(0,ge.jsxs)(Y.A,{value:Pe,onChange:(e,t)=>{ot(0),ze(t),at(50),0===t&&(Le("Pending"),$e("pending"),dt(null===Sn||void 0===Sn?void 0:Sn.uncoveredLength)),1===t&&(Le("Assigned"),$e("accepted"),dt(null===Sn||void 0===Sn?void 0:Sn.assignedLength)),2===t&&(Le("Arrived"),$e("arrived"),dt(null===Sn||void 0===Sn?void 0:Sn.arrivedLength)),3===t&&(Le("Picked"),$e("picked"),dt(null===Sn||void 0===Sn?void 0:Sn.pickedLength)),4===t&&(Le("Active"),$e("active"),dt(null===Sn||void 0===Sn?void 0:Sn.activeLength)),5===t&&(Le("Skipped"),$e("skipped"),dt(null===Sn||void 0===Sn?void 0:Sn.skippedLength)),6===t&&(Le("Delivered"),$e("delivered"),dt(null===Sn||void 0===Sn?void 0:Sn.coveredLength)),7===t&&(Le("Cancelled"),$e("cancelled"),dt(null===Sn||void 0===Sn?void 0:Sn.cancelLength)),console.log(t),At("")},variant:"scrollable",scrollButtons:!!(0,R.A)(t.breakpoints.down("custom1000")),allowScrollButtonsMobile:!0,children:[(0,ge.jsx)(L.A,{label:"Assigned",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.uncoveredLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Accepted",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.assignedLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Arrived",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.arrivedLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Picked",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.pickedLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Active",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.activeLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Skipped",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.skippedLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Delivered",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.coveredLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"}),(0,ge.jsx)(L.A,{label:"Cancelled",icon:(0,ge.jsx)(w.A,{label:(null===Sn||void 0===Sn?void 0:Sn.cancelLength)||0,color:"primary",variant:"light",size:"small",sx:{minWidth:40,justifyContent:"center"}}),iconPosition:"end"})]}),(0,ge.jsx)(he.A,{value:pt,onChange:At,onDebouncedChange:gt,sx:{m:0,width:280,flex:1}})]}),(0,ge.jsx)(X.A,{content:!1,children:(0,ge.jsx)(P.A,{ref:c,onScroll:e=>{const{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t+r>=n-50&&An&&!vn&&pn()},sx:{maxHeight:"calc(100vh - 190px)",overflow:"auto",overflowX:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:t.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:t.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:t.palette.primary.lighter,cursor:"pointer"}},children:(0,ge.jsxs)(z.A,{stickyHeader:!0,sx:{minWidth:1400},children:[(0,ge.jsx)(T.A,{children:(0,ge.jsxs)(F.A,{children:["Created"==Re&&(0,ge.jsx)(M.A,{sx:{whiteSpace:"nowrap"},children:(0,ge.jsx)(I.A,{indeterminate:me.length>0&&me.length!=mn.length,onChange:e=>{e.target.checked?je([...mn]):je([])},checked:me.length==mn.length})}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"S.No "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Tenant "}),(0,ge.jsxs)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:["Order Location"," "]}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Pickup "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Drop "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Rider "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Est. Delivery Time"}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Transit"}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:" Kms"}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Amount "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Notes "}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Steps"}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Qty"}),(0,ge.jsx)(M.A,{sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"COD "}),"Cancelled"!==Re&&"Delivered"!==Re&&(0,ge.jsx)(M.A,{align:"right",sx:{position:"sticky !important",backgroundColor:t.palette.secondary.light,whiteSpace:"nowrap",border:"none"},children:"Action"})]})}),(bt||hn)&&(0,ge.jsx)(pe.r,{col:8}),(0,ge.jsxs)(E.A,{children:[0==mn.length&&!bt&&(0,ge.jsx)(ge.Fragment,{children:(0,ge.jsx)(M.A,{colSpan:14,children:(0,ge.jsx)(d.A,{description:"No ".concat(Re," Orders"),styles:{description:{color:t.palette.error.main}}})})}),mn.map(((e,t)=>{var n,i,o,a;return(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsxs)(F.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",backgroundColor:me.find((t=>t.orderheaderid==e.orderheaderid))?"#e1bee7":"","&:hover":{backgroundColor:me.find((t=>t.orderheaderid==e.orderheaderid))?"#e1bee7 !important":""}},children:["Created"==Re&&(0,ge.jsx)(M.A,{children:(0,ge.jsx)(I.A,{onChange:t=>{if(t.target.checked){let t=me;t.push((0,r.A)((0,r.A)({},e),{},{sno:me.length+1})),je([...t])}else{if(me.find((t=>t.orderheaderid==e.orderheaderid))){let t=me,n=me.find((t=>t.orderheaderid==e.orderheaderid));t.splice(n.sno-1,1),t.map(((e,t)=>{e.sno=t+1})),je([...t])}}console.log("list",me)},checked:me.find((t=>t.orderheaderid==e.orderheaderid))})}),(0,ge.jsx)(M.A,{children:(0,ge.jsxs)(C.A,{children:[" ",it*lt+t+1]})}),(0,ge.jsx)(M.A,{children:(0,ge.jsxs)(N.A,{title:e.tenantadress,children:[(0,ge.jsx)(C.A,{noWrap:!0,variant:"subtitle1",children:e.tenantname}),(0,ge.jsx)(C.A,{noWrap:!0,variant:"body2",children:e.tenantsuburb}),(0,ge.jsx)(C.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,ge.jsxs)(M.A,{align:"left",children:[(0,ge.jsx)(N.A,{title:"Location Name-Suburb",placement:"top",children:(0,ge.jsx)(C.A,{variant:"subtitle1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,ge.jsxs)(S.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,ge.jsxs)(S.A,{children:[(0,ge.jsx)(N.A,{title:"Order Id",placement:"top",children:(0,ge.jsx)(C.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,ge.jsxs)(N.A,{title:"Ordered date",placement:"top",children:[(0,ge.jsx)(C.A,{noWrap:!0,sx:{fontSize:"12px"},children:h()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,ge.jsx)(C.A,{noWrap:!0,sx:{fontSize:"11px"},children:h()(e.orderdate).utc().format("hh:mm A")})]})]}),"-",(0,ge.jsxs)(S.A,{children:[(0,ge.jsx)(N.A,{title:"Delivery Id",placement:"top",children:(0,ge.jsx)(C.A,{variant:"body2",noWrap:!0,children:e.deliveryid})}),(0,ge.jsxs)(N.A,{title:"Delivery date",placement:"top",children:[(0,ge.jsx)(C.A,{noWrap:!0,sx:{fontSize:"12px"},children:h()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,ge.jsx)(C.A,{noWrap:!0,sx:{fontSize:"11px"},children:h()(e.deliverydate).utc().format("hh:mm A")})]})]})]})]}),(0,ge.jsx)(M.A,{align:"left",children:(0,ge.jsx)(S.A,{direction:"row",spacing:1,children:(0,ge.jsxs)(S.A,{direction:"column",children:[(0,ge.jsx)(C.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:e.pickupcustomer}),(0,ge.jsx)(C.A,{variant:"body2",children:e.pickupcontactno}),(0,ge.jsx)(N.A,{title:e.Pickupaddress,sx:{whiteSpace:"nowrap"},children:(0,ge.jsx)(C.A,{variant:"body2",children:e.pickuplocation||e.Pickupaddress.slice(0,12)+"..."})})]})})}),(0,ge.jsx)(M.A,{align:"left",children:(0,ge.jsx)(S.A,{direction:"row",spacing:1,children:(0,ge.jsxs)(S.A,{direction:"column",children:[(0,ge.jsx)(C.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:e.deliverycustomer}),(0,ge.jsx)(C.A,{variant:"body2",children:e.deliverycontactno}),(0,ge.jsx)(N.A,{title:e.deliveryaddress,children:(0,ge.jsx)(C.A,{variant:"body2",sx:{whiteSpace:"nowrap"},children:"".concat(e.deliverylocation||e.deliveryaddress.slice(0,12)+"...")})})]})})}),(0,ge.jsxs)(M.A,{children:[(0,ge.jsx)(C.A,{variant:"subtitle1",noWrap:!0,children:e.ridername}),(0,ge.jsxs)(C.A,{variant:"subtitle2",children:[" ","ID: ".concat(e.userid)]}),(0,ge.jsxs)(C.A,{variant:"subtitle2",children:[" ",e.ridercontact]})]}),(0,ge.jsx)(M.A,{align:"left",children:(0,ge.jsx)(C.A,{variant:"subtitle1",noWrap:!0,children:e.expecteddeliverytime?h()(e.expecteddeliverytime).format("hh:mm A"):"N/A"})}),(0,ge.jsx)(M.A,{align:"left",children:(0,ge.jsxs)(C.A,{variant:"subtitle1",noWrap:!0,children:[e.transitminutes||0," min"]})}),(0,ge.jsx)(M.A,{children:(0,ge.jsxs)(S.A,{direction:"column",spacing:1,children:[(0,ge.jsx)(N.A,{title:" KMS",placement:"top",children:(0,ge.jsx)(w.A,{label:e.kms||0,size:"small",variant:"light",color:"error"})}),(0,ge.jsx)(N.A,{title:"Actual KMS",children:(0,ge.jsx)(w.A,{label:e.cumulativekms||0,size:"small",color:"success",variant:"light"})})]})}),(0,ge.jsx)(M.A,{align:"left",children:(0,ge.jsxs)(S.A,{direction:"column",spacing:1,children:[(0,ge.jsx)(N.A,{title:" Delivery Charge",placement:"top",children:(0,ge.jsx)(w.A,{label:"\u20b9 ".concat(null===(n=e.deliverycharges)||void 0===n?void 0:n.toFixed(2))||0,size:"small",variant:"light",color:"error"})}),(0,ge.jsx)(N.A,{title:"Delivery Amount",children:(0,ge.jsx)(w.A,{label:"\u20b9 ".concat(null===(i=e.deliveryamt)||void 0===i?void 0:i.toFixed(2))||0,size:"small",color:"success",variant:"light"})})]})}),(0,ge.jsx)(M.A,{children:(0,ge.jsx)(C.A,{children:e.notes})}),(0,ge.jsx)(M.A,{align:"center",children:e.step?(0,ge.jsx)(w.A,{label:e.step,size:"small",color:"primary",variant:"light",sx:{fontWeight:700,minWidth:28}}):(0,ge.jsx)(C.A,{variant:"subtitle2",color:"text.disabled",children:"\u2014"})}),(0,ge.jsx)(M.A,{children:e.Quantity?(0,ge.jsx)(C.A,{variant:"subtitle1",color:"error",sx:{whiteSpace:"nowrap"},children:e.Quantity}):(0,ge.jsxs)(C.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:[" ",e.Quantity]})}),(0,ge.jsx)(M.A,{children:e.collectionamt?(0,ge.jsxs)(C.A,{variant:"subtitle1",color:"error",sx:{whiteSpace:"nowrap"},children:[" ","\u20b9 ".concat(e.collectionamt.toFixed(2))," "]}):(0,ge.jsxs)(C.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:[" ","\u20b9 ".concat(e.collectionamt.toFixed(2))," "]})}),"Cancelled"!==Re&&"Delivered"!==Re&&(0,ge.jsx)(M.A,{children:(0,ge.jsxs)(S.A,{display:"flex",flexDirection:"row",justifyContent:"end",children:["C"==e.deliverytype&&(0,ge.jsx)(N.A,{title:"Product details",placement:"top",children:(0,ge.jsx)(J.A,{color:"primary",onClick:()=>{(null===ct||void 0===ct?void 0:ct.orderid)===e.orderid?(ht(null),xt(null)):(ht(e),xt(e.orderheaderid))},children:(null===ct||void 0===ct?void 0:ct.orderid)===e.orderid?(0,ge.jsx)(se.A,{}):(0,ge.jsx)(de.A,{})})}),(0,ge.jsx)(J.A,{color:"primary",size:"small",sx:{bgcolor:"primary.100"},onClick:t=>((e,t)=>{yt(t),console.log("selectedRow",t),jt(e.currentTarget)})(t,e),children:(0,ge.jsx)(l.A,{})}),(0,ge.jsxs)(K.A,{anchorEl:mt,open:Gt,onClose:Ut,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{elevation:4,sx:{minWidth:200,borderRadius:1}},children:["delivered"!==(null===ft||void 0===ft?void 0:ft.orderstatus)&&(0,ge.jsx)(O.A,{onClick:()=>{on.mutate(ft.userfcmtoken),Ut()},children:"Notify Rider"}),["pending","accepted","arrived"].includes(null===ft||void 0===ft?void 0:ft.orderstatus)&&(0,ge.jsx)(O.A,{onClick:()=>{var e;if(!we)return an("Please select a location first!","warning"),void(null===(e=nt.current)||void 0===e||e.focus());Lt(!0),Ut()},children:"Change Rider"}),(1==Zt||2==Zt)&&(0,ge.jsx)(O.A,{onClick:()=>{Ne(ft.kms),Ke(ft.cumulativekms),Ve(ft.droplat),Xe(ft.droplon),He(ft.notes),qe(ft.deliveryamount),tt(ft.orderstatus||"delivered"),Ge(ft),ye(!0),Ut()},children:"Update Delivery Status"}),"cancelled"!==(null===ft||void 0===ft?void 0:ft.orderstatus)&&"delivered"!==(null===ft||void 0===ft?void 0:ft.orderstatus)&&(0,ge.jsx)(O.A,{sx:{color:"error.main"},onClick:()=>{Yt(!0),Ut()},children:"Cancel Delivery"})]})]})})]},e.tenantname),(null===ct||void 0===ct?void 0:ct.orderid)===(null===e||void 0===e?void 0:e.orderid)&&(0,ge.jsx)(F.A,{children:(0,ge.jsx)(M.A,{colSpan:11,sx:{p:0,border:0,"&:hover":{backgroundColor:"white"}},children:(0,ge.jsx)(q.A,{in:!0,timeout:"auto",unmountOnExit:!0,children:(0,ge.jsx)(B.A,{sx:{width:"100%",px:2,py:2},children:(0,ge.jsxs)(z.A,{size:"small",sx:{minWidth:800},children:[(0,ge.jsx)(T.A,{children:(0,ge.jsxs)(F.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,ge.jsx)(M.A,{sx:{fontWeight:600},children:"S.No"}),(0,ge.jsx)(M.A,{sx:{fontWeight:600},children:"Product Name"}),(0,ge.jsx)(M.A,{sx:{fontWeight:600},children:"Description"}),(0,ge.jsx)(M.A,{align:"right",sx:{fontWeight:600},children:"Quantity"}),(0,ge.jsx)(M.A,{align:"right",sx:{fontWeight:600},children:"Cost"}),(0,ge.jsx)(M.A,{align:"right",sx:{fontWeight:600},children:"Price"}),(0,ge.jsx)(M.A,{align:"right",sx:{fontWeight:600},children:"Tax"}),(0,ge.jsx)(M.A,{align:"right",sx:{fontWeight:600},children:"Amount"})]})}),(0,ge.jsxs)(E.A,{children:[null===sn||void 0===sn||null===(o=sn.details)||void 0===o?void 0:o.map(((e,t)=>{var n,r;return(0,ge.jsxs)(F.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,ge.jsx)(M.A,{children:t+1}),(0,ge.jsx)(M.A,{children:(0,ge.jsxs)(S.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,ge.jsx)("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,style:{width:40,height:40,objectFit:"cover",borderRadius:4}}),(0,ge.jsx)(C.A,{variant:"body2",noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"})]})}),(0,ge.jsx)(M.A,{children:(null===e||void 0===e?void 0:e.productdescription)||"-"}),(0,ge.jsx)(M.A,{align:"right",children:(null===e||void 0===e?void 0:e.orderqty)||0}),(0,ge.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null===e||void 0===e?void 0:e.price)||0]}),(0,ge.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null!==(n=null===e||void 0===e?void 0:e.productsumprice)&&void 0!==n?n:0).toFixed(2)]}),(0,ge.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null!==(r=null===e||void 0===e?void 0:e.taxamount)&&void 0!==r?r:0).toFixed(2)]}),(0,ge.jsxs)(M.A,{align:"right",children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},t)})),(0,ge.jsxs)(F.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,ge.jsx)(M.A,{align:"right",colSpan:7,sx:{},children:"Total Amount :"}),(0,ge.jsxs)(M.A,{align:"right",sx:{},children:["\u20b9 ",null===sn||void 0===sn||null===(a=sn.pricedetails)||void 0===a?void 0:a.orderamount.toFixed(2)]})]})]})]})})})})})]})})),0!=(null===mn||void 0===mn?void 0:mn.length)&&(0,ge.jsx)(F.A,{children:(0,ge.jsx)(M.A,{colSpan:15,rowSpan:3,children:(0,ge.jsx)("div",{ref:n,style:{height:40,textAlign:"center"},children:vn||An?(0,ge.jsx)(ve.A,{}):"No More Deliveries"})})})]})]})})}),(0,ge.jsx)(H.A,{open:Wt,onClose:()=>Yt(!1),maxWidth:"xs",children:(0,ge.jsx)(Z.A,{sx:{mt:2,my:1},children:(0,ge.jsxs)(S.A,{alignItems:"center",spacing:3.5,children:[(0,ge.jsx)(k.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,ge.jsx)(a.A,{})}),(0,ge.jsx)(S.A,{spacing:2,children:(0,ge.jsx)(C.A,{variant:"h5",align:"center",children:"Are you sure you want to cancel this delivery?"})}),(0,ge.jsx)(W.A,{fullWidth:!0,label:"Enter Feedback",multiline:!0,maxRows:4,onChange:e=>{zt(e.target.value)}}),(0,ge.jsxs)(S.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,ge.jsx)(G.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{""==Pt?an("Enter FeedBack","error"):Vt({selectedRow:ft,cancelFeed:Pt}),(async()=>{console.log("cancelridernotification",ft);try{return(await u.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:ft.userfcmtoken,notification:{title:"NearleXpress",body:"".concat(ft.orderid," have been Cancelled"),sound:"ring",image:""},data:{type:"cancel"}})).data}catch(e){an(e.message,"error",2e3),console.log(e)}})()},autoFocus:!0,sx:{border:"1px solid red"},children:"Yes, Cancel"}),(0,ge.jsx)(G.A,{fullWidth:!0,onClick:()=>{Yt(!1)},color:"secondary",variant:"outlined",children:"No"})]})]})})}),(0,ge.jsxs)(H.A,{open:Rt,onClose:()=>Lt(!1),maxWidth:"sm",fullWidth:!0,TransitionComponent:_.s,children:[(0,ge.jsx)(U.A,{sx:{bgcolor:t.palette.primary.main},children:(0,ge.jsx)(C.A,{variant:"h3",sx:{color:"white"},children:"Change Rider"})}),(0,ge.jsx)(Z.A,{dividers:!0,children:(0,ge.jsx)(y.Ay,{container:!0,spacing:2,children:(0,ge.jsx)(y.Ay,{item:!0,xs:12,sx:{m:2},children:(0,ge.jsx)(D.A,{fullWidth:!0,options:Wn,renderInput:e=>(0,ge.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{label:"Choose Rider"})),onChange:(e,t)=>{Ft(t),i.A.debug("Rider selected in dropdown:",t?"".concat(t.firstname," ").concat(t.lastname):"None")}})})})}),(0,ge.jsx)(V.A,{children:(0,ge.jsxs)(S.A,{direction:"row",spacing:3,children:[(0,ge.jsx)(G.A,{variant:"outlined",color:"secondary",onClick:()=>{Lt(!1)},children:"Cancel"}),(0,ge.jsx)(G.A,{variant:"contained",color:"primary",onClick:()=>{St(!0),i.A.info("Initiating rider assignment change for order ID ".concat(null===ft||void 0===ft?void 0:ft.orderid," to rider: ").concat(null===Tt||void 0===Tt?void 0:Tt.firstname," ").concat(null===Tt||void 0===Tt?void 0:Tt.lastname)),ln.mutate({selectedRider:Tt,selectedRow:ft})},children:"Change Rider"})]})})]}),(0,ge.jsxs)(H.A,{open:Te,children:[(0,ge.jsx)(U.A,{align:"left",children:(0,ge.jsx)(C.A,{variant:"h4",children:"Select Filter Options"})}),(0,ge.jsx)(Z.A,{sx:{width:"100%"},className:"datedialog",children:(0,ge.jsx)(le.U,{open:Te,toggle:()=>Fe(!Te),id:"daterange1",onChange:e=>{"All"===e.label?(De(""),Ye(""),Fe(!1)):(De(h()(e.startDate).format("YYYY-MM-DD")),Ye(h()(e.endDate).format("YYYY-MM-DD")),e.label?Ie(e.label):Ie("")),console.log(e)},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,$.A)(new Date,-1),endDate:(0,$.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,$.A)(new Date,1),endDate:(0,$.A)(new Date,1)},{label:"This Week",startDate:(0,ee.A)(new Date),endDate:(0,te.A)(new Date)},{label:"Last Week",startDate:(0,ee.A)((0,ne.A)(new Date,-1)),endDate:(0,te.A)((0,ne.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,ne.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,re.A)(new Date),endDate:(0,ie.A)(new Date)},{label:"Last Month",startDate:(0,re.A)((0,oe.A)(new Date,-1)),endDate:(0,ie.A)((0,oe.A)(new Date,-1))}]})}),(0,ge.jsx)(S.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,ge.jsx)(G.A,{variant:"contained",size:"small",onClick:()=>{Fe(!1)},children:"ok"})})]}),(0,ge.jsxs)(H.A,{fullWidth:!0,open:fe,onClose:dn,scroll:"paper",maxWidth:"sm",TransitionComponent:_.s,children:[(0,ge.jsx)(U.A,{sx:{bgcolor:"#662582",color:"#fff"},children:"Update Delivery Status"}),(0,ge.jsx)(Z.A,{dividers:!0,children:(0,ge.jsx)(X.A,{sx:{height:"100%"},children:(0,ge.jsxs)(y.Ay,{container:!0,spacing:2.5,children:[(0,ge.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(Q.A,{children:"Kms"}),(0,ge.jsx)(W.A,{fullWidth:!0,value:Ee,type:"number",onChange:e=>{Ne(e.target.value),console.log(e)}})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(Q.A,{children:"Actual Kms"}),(0,ge.jsx)(W.A,{value:Je,type:"number",onChange:e=>Ke(+e.target.value),fullWidth:!0})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(Q.A,{children:"Delivery lat"}),(0,ge.jsx)(W.A,{fullWidth:!0,type:"number",value:Ue,onChange:e=>{Ve(e.target.value)}})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(Q.A,{children:"Delivery Long"}),(0,ge.jsx)(W.A,{value:Qe,type:"number",onChange:e=>{Xe(e.target.value)},fullWidth:!0})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,ge.jsx)(Q.A,{children:"Amount"}),(0,ge.jsx)(W.A,{fullWidth:!0,type:"number",value:Oe,onChange:e=>qe(+e.target.value)})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,ge.jsx)(Q.A,{children:"Status"}),(0,ge.jsxs)(W.A,{select:!0,fullWidth:!0,value:et,onChange:e=>{tt(e.target.value)},children:[(0,ge.jsx)(O.A,{value:"pending",children:"Pending"}),(0,ge.jsx)(O.A,{value:"accepted",children:"Accepted"}),(0,ge.jsx)(O.A,{value:"started",children:"Started"}),(0,ge.jsx)(O.A,{value:"arrived",children:"Arrived"}),(0,ge.jsx)(O.A,{value:"delivered",children:"Delivered"}),(0,ge.jsx)(O.A,{value:"cancelled",children:"Cancelled"})]})]}),(0,ge.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,ge.jsx)(Q.A,{children:"Notes"}),(0,ge.jsx)(W.A,{value:Be,fullWidth:!0,onChange:e=>He(e.target.value)})]})]})})}),(0,ge.jsx)(V.A,{children:(0,ge.jsx)(y.Ay,{container:!0,children:(0,ge.jsx)(y.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[(0,ge.jsx)(G.A,{variant:"contained",onClick:()=>{dn()},color:"error",children:"Close"})," ",(0,ge.jsx)(G.A,{variant:"contained",onClick:()=>{Ee?Je?Ue?Qe?Oe?Pn.mutate({deliveryid:Ze.deliveryid,orderheaderid:Ze.orderheaderid,orderstatus:et,deliverytime:h()().format("YYYY-MM-DD HH:mm:ss"),deliverylat:Ue,deliverylong:Qe,kms:Ee,cumulativekms:Je,deliveryamt:parseFloat(Oe),notes:Be,userid:+ft.userid}):an("Fill Delivery Amount","warning"):an("Fill Delivery Longitude","warning"):an("Fill Delivery Latitude","warning"):an("Fill Actual Kms","warning"):an("Fill Kms","warning")},children:"Update"})]})})})})]})]})}},47659:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(89379),i=n(48089),o=n(50704),l=n(16491),a=n(82053),s=n(60899),d=n(44414);const c=e=>{let{primary:t,secondary:n,percentage:c,color:h,sx:u}=e;return(0,d.jsx)(i.A,{elevation:0,sx:(0,r.A)({background:h,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},u),children:(0,d.jsxs)(o.A,{children:[(0,d.jsx)(l.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,d.jsx)(a.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:c&&"number"===typeof c?"".concat(c.toString()," %"):c})}),(0,d.jsxs)(s.Ay,{container:!0,spacing:0,children:[(0,d.jsx)(s.Ay,{item:!0,xs:12,children:(0,d.jsx)(a.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:n})}),(0,d.jsx)(s.Ay,{item:!0,xs:12,children:(0,d.jsx)(a.A,{variant:"subtitle2",color:"inherit",children:t})})]})]})})}},56311:(e,t,n)=>{n.d(t,{A:()=>x});var r=n(89379),i=n(9950),o=n(2660),l=n(2046),a=n(83274),s=n(25333),d=n(97125),c=n(7762),h=n(52097),u=n(44414);const x=e=>{let{value:t,onChange:n,onDebouncedChange:x,debounceTime:p=500,placeholder:A="Search (ctrl+k)",sx:v}=e;const g=(0,i.useRef)(null),[m]=(0,h.d7)(t,p);return(0,i.useEffect)((()=>{x&&x(m)}),[m,x]),(0,i.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=g.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,u.jsx)(o.A,{sx:(0,r.A)({},v),inputRef:g,placeholder:A,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>n(e.target.value),startAdornment:(0,u.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,u.jsx)(d.A,{})}),endAdornment:(0,u.jsx)(a.A,{title:"Clear",children:(0,u.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>n(""),children:(0,u.jsx)(c.A,{})})})})}},58691:(e,t,n)=>{n.d(t,{A:()=>a});n(9950);var r=n(16491),i=n(46639),o=n(62217),l=n(44414);function a(e){let{size:t=70,imgSize:n=40,alt:a="loader"}=e;return(0,l.jsxs)(r.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(i.A,{size:t}),(0,l.jsx)(r.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:n,height:n},children:(0,l.jsx)("img",{src:o,alt:a,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(89379),i=n(9950),o=n(77922),l=n(29925),a=n(26910),s=n(44414);const d=(0,i.forwardRef)(((e,t)=>{let{setAppId:n,setLocoName:d,setPage:c,sx:h,textfeildSx:u}=e;const[x,p]=(0,i.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));return(0,i.useEffect)((()=>{0===x.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),p(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[x.length]),(0,s.jsx)(o.A,{id:"location-autocomplete",options:x||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},sx:(0,r.A)({},h),onChange:(e,t,r)=>{"clear"===r?(null===n||void 0===n||n(0),null===d||void 0===d||d(""),null===c||void 0===c||c(0)):t&&(null===n||void 0===n||n(t.applocationid),null===d||void 0===d||d(t.locationname),null===c||void 0===c||c(0))},renderInput:e=>(0,s.jsx)(l.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,r.A)({},u)}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpD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Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},79739:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(98587),i=n(58168),o=n(9950),l=n(72004),a=n(3484),s=n(59254),d=n(18463),c=n(45558),h=n(1614);function u(e){return(0,h.Ay)("MuiDialogActions",e)}(0,c.A)("MuiDialogActions",["root","spacing"]);var x=n(44414);const p=["className","disableSpacing"],A=(0,s.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,i.A)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),v=o.forwardRef((function(e,t){const n=(0,d.b)({props:e,name:"MuiDialogActions"}),{className:o,disableSpacing:s=!1}=n,c=(0,r.A)(n,p),h=(0,i.A)({},n,{disableSpacing:s}),v=(e=>{const{classes:t,disableSpacing:n}=e,r={root:["root",!n&&"spacing"]};return(0,a.A)(r,u,t)})(h);return(0,x.jsx)(A,(0,i.A)({className:(0,l.A)(v.root,o),ownerState:h,ref:t},c))}))},94826:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(59254),i=n(46639),o=n(62217),l=n(44414);const a=(0,r.Ay)("div")((()=>({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,r.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),d=()=>(0,l.jsxs)(a,{children:[(0,l.jsx)(i.A,{color:"primary",size:80,thickness:6}),(0,l.jsx)(s,{children:(0,l.jsx)("img",{src:o,alt:"Logo",style:{width:"100%",height:"100%"}})})]})},96646:(e,t,n)=>{n.d(t,{r:()=>s});var r=n(9213),i=n(21671),o=n(82917),l=n(93230),a=n(44414);const s=e=>{let{rowsPerPage:t=5,col:n=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(r.A,{children:[(0,a.jsx)(i.A,{children:(0,a.jsx)(o.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(i.A,{children:(0,a.jsx)(o.A,{variant:"text",width:30})}),Array.from({length:n}).map(((e,t)=>(0,a.jsx)(i.A,{children:(0,a.jsxs)(l.A,{spacing:.5,children:[(0,a.jsx)(o.A,{variant:"text",width:100}),(0,a.jsx)(o.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(i.A,{children:(0,a.jsx)(o.A,{variant:"text",width:150})}),(0,a.jsx)(i.A,{children:(0,a.jsx)(o.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(i.A,{align:"center",children:(0,a.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(o.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(o.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]);