\n
\n
').concat(c).concat(l?" #".concat(l,""):"","
\n
")})},un.current.set(e.id,u));var m=u.icon,h={click:function(n){var s=String(e.id);on.current.has(s)?(on.current.delete(s),n.target.closePopup()):(on.current.add(s),n.target.openPopup());var r=rt.find((function(e){return String(e.id)===s}));r&&pt(r)},popupclose:function(){on.current.delete(String(e.id))}},v=lt?ke:p.J,f=lt?{target:[e.lat,e.lon],duration:1200}:{position:[e.lat,e.lon]};return(0,P.jsx)(v,(0,o.Z)((0,o.Z)({},f),{},{icon:m,zIndexOffset:2500,eventHandlers:h,children:(0,P.jsxs)(j.G,{maxWidth:260,autoPan:!0,autoPanPadding:[20,20],className:"dispatch-popup live-rider-popup",children:[(0,P.jsx)("div",{className:"pu-hdr-live",children:(0,P.jsxs)("div",{className:"pu-hdr-left",children:[(0,P.jsx)("span",{className:"pu-live-indicator",style:{"--pulse-color":r},children:(0,P.jsx)("span",{className:"pu-live-dot"})}),(0,P.jsx)("span",{className:"pu-hdr-title",children:"LIVE GPS"})]})}),(0,P.jsxs)("div",{className:"pu-rider-profile",children:[(0,P.jsx)("div",{className:"pu-avatar",style:{backgroundColor:"".concat(r,"12"),color:r},children:(0,P.jsx)(E.MCF,{})}),(0,P.jsxs)("div",{className:"pu-rider-info-text",children:[(0,P.jsxs)("div",{className:"pu-rider-name-row",children:[(0,P.jsx)("span",{className:"pu-rider-name",children:e.username||"Rider #".concat(e.id)}),e.status&&(0,P.jsx)("span",{className:"pu-status-badge ".concat("active"===e.status.toLowerCase()?"active":"idle"),children:e.status})]}),(0,P.jsxs)("div",{className:"pu-rider-meta",children:["Rider ID: #",e.id]})]})]}),(0,P.jsxs)("div",{className:"pu-body-content",children:[e.orderid&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Active Order"}),(0,P.jsxs)("span",{className:"pu-info-value pu-order-badge",children:["#",e.orderid]})]}),a&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Next Stop"}),(0,P.jsxs)("span",{className:"pu-info-value",style:{color:"#4f46e5"},children:["#",a.step||"?"," \xb7 ",a.deliverycustomer||"\u2014"]})]}),i&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Next Location"}),(0,P.jsx)("span",{className:"pu-info-value",title:a.deliveryaddress||i,children:i})]}),(null===a||void 0===a?void 0:a.pickupcustomer)&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Pickup"}),(0,P.jsx)("span",{className:"pu-info-value",title:a.pickupcustomer,children:a.pickupcustomer})]}),e.contactno&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Phone"}),(0,P.jsx)("a",{href:"tel:".concat(e.contactno),className:"pu-info-value pu-phone-link",children:e.contactno})]}),e.logdate&&(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Last Seen"}),(0,P.jsxs)("span",{className:"pu-info-value pu-time-stamp",children:[(0,P.jsx)(E.dKE,{className:"inline-icon"})," ",S()(e.logdate).isValid()?S()(e.logdate).format("hh:mm:ss A"):e.logdate]})]}),(0,P.jsxs)("div",{className:"pu-info-row",children:[(0,P.jsx)("span",{className:"pu-info-label",children:"Position"}),(0,P.jsxs)("span",{className:"pu-info-value pu-coordinates",children:[e.lat.toFixed(5),", ",e.lon.toFixed(5)]})]})]})]})}),"live-".concat(e.id))})),Qs&&ct&&"planned"!==nr&&yt.map((function(e,n){var s,r;if(0===e.coords.length)return null;var t=(0,z.di)(n),a="combined"===nr?V:t,i=[e.coords[0].lat,e.coords[0].lng],c=[e.coords[e.coords.length-1].lat,e.coords[e.coords.length-1].lng],l=Ns[e.deliveryid],d=Array.isArray(l)&&l.length>=2?l:e.coords.map((function(e){return[e.lat,e.lng]})),o=d,m=!0;if(_s){var v=Ps[e.sequenceStep]||0;v<2?m=!1:o=d.slice(0,Math.min(v,d.length))}var f=Ar===e.sequenceStep,j=String(e.orderstatus||"").toLowerCase(),g=z.Q6.has(j),N=z.us.has(j),y=kt.find((function(n){return n.sequenceStep===e.sequenceStep})),k=!(null===y||void 0===y||!y.anomaly),_=null===ct||void 0===ct||null===(s=ct.orders)||void 0===s?void 0:s.find((function(n){return null!=n.deliveryid&&String(n.deliveryid)===String(e.deliveryid)})),w=(0,z.Cl)(e.orderstatus),F=(e.orderstatus&&'