1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1049],{62180:function(t,e,r){r.d(e,{y:function(){return a}});var n=r(90842),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3;(0,n.yv)(t,{variant:e,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:r})}},71049:function(t,e,r){r.d(e,{$w:function(){return g},N4:function(){return y},RQ:function(){return m},TG:function(){return v},UV:function(){return j},Vf:function(){return Z},Ye:function(){return k},bI:function(){return d},bc:function(){return x},f2:function(){return K},gO:function(){return h},hG:function(){return w},iI:function(){return f},kc:function(){return l},p7:function(){return z},vE:function(){return q},wf:function(){return b},wj:function(){return _}});var n=r(1413),a=r(93433),c=r(74165),o=r(29439),i=r(15861),u=r(56573),s=r(62180),p=localStorage.getItem("tenantid"),d=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f,v,Z,h;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,8),i[0],s=i[1],p=i[2],d=i[3],l=i[4],f=i[5],v=i[6],Z=i[7],t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/tenant/getorders/?tenantid=").concat(s,"&locationid=").concat(p,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(Z,"&keyword=").concat(v));case 4:return h=t.sent,t.abrupt("return",{details:h.data.details,nextPage:h.data.details.length===Z?n+1:void 0});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),l=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,d,l,f,v,Z;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,3),d=i[1],l=i[2],t.prev=2,t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(p,"&pageno=").concat(n,"&pagesize=").concat(d,"&keyword=").concat(l));case 5:return v=t.sent,Z=null!==(f=v.data.details)&&void 0!==f?f:[],t.abrupt("return",{details:Z,nextPage:Z.length===d?n+1:void 0});case 10:return t.prev=10,t.t0=t.catch(2),(0,s.y)(t.t0.message,"error",1e3),t.abrupt("return",{details:[],nextPage:void 0});case 14:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,console.log("queryKey for getreportlocationsummary",r),n=(0,o.Z)(r,4),a=n[0],i=n[1],s=n[2],d=n[3],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportlocationsummary/?tenantid=").concat(p,"&locationid=").concat(s,"&fromdate=").concat(a,"&todate=").concat(i,"&keyword=").concat(d));case 5:return l=t.sent,console.log("getreportlocationsummary",l.data.details),t.abrupt("return",l.data.details);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),v=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,2),a=n[1],t.prev=2,t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations?tenantid=").concat(p,"&keyword=").concat(a));case 5:return s=t.sent,t.abrupt("return",(null===(i=s.data)||void 0===i?void 0:i.details)||[]);case 9:return t.prev=9,t.t0=t.catch(2),console.error("Error fetching tenant locations:",t.t0),t.abrupt("return",[]);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}(),Z=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,5),a=n[1],i=n[2],n[3],s=n[4],t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary?tenantid=").concat(p,"&locationid=").concat(s,"&fromdate=").concat(a,"&todate=").concat(i));case 4:return d=t.sent,console.log("fetchDeliverySummary",d.data.details),t.abrupt("return",d.data.details);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(){var e,r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getpartners"));case 2:return e=t.sent,r=[].concat((0,a.Z)(e.data.details),[{partnername:"All",applocationid:-1}]),console.log("fetchAppLocations",r),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),m=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,console.log("queryKey for fetchRidersSummary",r),n=(0,o.Z)(r,3),a=n[0],i=n[1],s=n[2],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getridersummary/?tenantid=").concat(a,"&fromdate=").concat(i,"&todate=").concat(s));case 5:return p=t.sent,console.log("fetchRidersSummary",p.data.details),t.abrupt("return",p.data.details);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d,l,f,v,Z,h,m,g,y;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?0:r,a=e.queryKey,i=(0,o.Z)(a,5),s=i[0],d=i[1],l=i[2],f=i[3],v=i[4],Z=10,h=n+1,t.next=6,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?tenantid=").concat(p,"&locationid=").concat(f,"&fromdate=").concat(s,"&todate=").concat(d,"&status=").concat("All"===l?"":l,"&pageno=").concat(h,"&pagesize=").concat(Z,"&keyword=").concat(v));case 6:return m=t.sent,g=m.data.details||[],y=g.length===Z,t.abrupt("return",{details:g,nextPage:y?n+1:void 0});case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),y=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,3),a=n[0],i=n[1],s=n[2],p=void 0===s?"":s,t.next=4,u.Z.get("https://jupiter.nearle.app/live/api/v2/partners/getriderlogs/?applocationid=".concat(a,"&fromdate=").concat(i||"","&todate=").concat(i||"","&keyword=").concat(p||""));case 4:return d=t.sent,console.log("fetchRidersLogs",d.data.details),t.abrupt("return",d.data.details);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="".concat("https://jupiter.nearle.app/live/api/v1","/utils/getriderperiodiclogs").concat(e?"?userid=".concat(e):""),t.next=3,u.Z.get(r);case 3:if(!(n=t.sent).data||!n.data.status){t.next=6;break}return t.abrupt("return",n.data.data);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,i,p,d,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,t.prev=1,a=(0,o.Z)(r,2),i=a[1],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getriders/?applocationid=").concat(i));case 5:return p=t.sent,d=p.data,l=null!==d&&void 0!==d&&d.details?d.details.map((function(t){return(0,n.Z)((0,n.Z)({},t),{},{label:"".concat(t.firstname," ").concat(t.lastname," | ").concat(t.contactno)})})):[],t.abrupt("return",l);case 11:throw t.prev=11,t.t0=t.catch(1),(0,s.y)(t.t0.message,"error",2e3),t.t0;case 15:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.post("https://routes.workolik.com/api/v1/optimization/createdeliveries",e.deliveries);case 2:return r=t.sent,t.abrupt("return",r.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.riders,t.next=3,u.Z.post("https://routes.workolik.com/api/v1/optimization/reconcile-steps",{riders:r});case 3:return n=t.sent,t.abrupt("return",n.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.batch,n=e.tenantId,t.next=3,u.Z.post("https://routes.workolik.com/api/v1/batch/efficiency",{batch:r,tenant_id:n},{headers:{"Content-Type":"application/json"},validateStatus:function(){return!0}});case 3:return a=t.sent,t.abrupt("return",a.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(t){var e=Number(t);return Number.isFinite(e)?e:t},a=(e.deliveries||[]).map((function(t){return(0,n.Z)((0,n.Z)({},t),{},{userid:r(t.userid),rider_id:r(t.rider_id)})})),t.next=4,u.Z.post("https://jupiter.nearle.app/live/api/v1/deliveries/createdeliveries",a);case 4:return o=t.sent,t.abrupt("return",o.data);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),K=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,o,i;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Array.isArray(e.absent_riders)?e.absent_riders:[],a=1==e.selectedMode.value?"https://routes.workolik.com/api/v1/optimization/riderassign?hypertuning_params=".concat(e.hypertuning_params):"https://routemate.workolik.com/api/v1/optimization/riderassign?strategy=multi_trip",o=1==e.selectedMode.value?{deliveries:e.deliveries,absent_riders:r}:(0,n.Z)((0,n.Z)({},e.data||{}),{},{absent_riders:r}),t.next=5,u.Z.post(a,o);case 5:return i=t.sent,t.abrupt("return",i.data);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Invalid rider token");case 2:return t.next=4,u.Z.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:e,notification:{title:"NearleXpress",body:"Orders have been placed for delivery. Kindly accept and process deliveries",sound:"ring",image:""}});case 4:return r=t.sent,t.abrupt("return",r.data);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),z=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f,v,Z,h,m,g,y,w;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,11),s=i[1],p=i[2],d=i[3],l=i[4],f=i[5],v=i[6],Z=i[7],h=i[8],m=i[9],g=i[10],d="All"==d?"all":d,y=0===s?"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?appuserid=").concat(p,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(v,"&keyword=").concat(Z,"&tenantid=").concat(h,"&locationid=").concat(m,"&userid=").concat(g):"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?applocationid=").concat(s,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(v,"&keyword=").concat(Z,"&tenantid=").concat(h,"&locationid=").concat(m,"&userid=").concat(g),t.next=6,u.Z.get(y);case 6:return w=t.sent,t.abrupt("return",{rows:w.data.details,nextPage:w.data.details.length===Number(v)?n+1:void 0});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}]); |