1!function(){try{("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).__faroGitHash_myeroad="5ce3e63ee526711d9fdee9e150f093852f3a7cc4"}catch(e){}}(),function(){try{("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).__faroBundleId_myeroad="10.1.5092-apac"}catch(e){}}();try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4b4ae2e9-56b4-4958-9598-8390a6188c50",e._sentryDebugIdIdentifier="sentry-dbid-4b4ae2e9-56b4-4958-9598-8390a6188c50")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"10.1.5092-apac"},(self.webpackChunk_eroad_myeroad=self.webpackChunk_eroad_myeroad||[]).push([[3908],{50427:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Be});var s=a(14041),l=a(70541),n=a(42453),o=a(16045),i=a(43420),r=a(57618),d=a(80601),c=a(62664),m=a(37506),g=a(99204),p=a(67595),u=a(82479),h=a(13778),f=a(11685),v=a(62397),E=a(31894),y=a(1454);const b=(0,y.wY)(e=>({root:{flexShrink:0,margin:e.spacing(4),marginTop:0}}),{name:"BroadcastButton"});var w=a(14041);const I=()=>{const e=b(),t=(0,l.wA)(),a=(0,c.Zp)();return w.createElement(v.$,{icon:w.createElement(f.A,null),className:e.root,type:"primary",onClick:x({dispatch:t,navigate:a}),"data-pendoid":E.RA.broadcastButton},w.createElement(i.s,{id:"messaging.broadcast.button.text"}))},x=({dispatch:e,navigate:t})=>()=>{e(h.o.setSelectedVehicleId({navigate:t,vehicleId:null})),e(h.o.setBroadcastModalVisible(!0))};var B=a(4078),S=a(65702),T=a(53611),M=a(62457),k=a(99728),C=a(76583),N=a(81115),A=a(51962),O=a(94752);const R=e=>(0,O.g)(e)?[]:Array.isArray(e)?e.filter(A.O):[e],G=(0,y.wY)(e=>({fleets:{marginBottom:e.spacing(6)},message:{marginBottom:e.spacing(6)},quickMessages:{marginLeft:-e.spacing(3),marginRight:-e.spacing(3)}}),{name:"BroadcastModalContent"});var _=a(14041);const F=({selectedGroupIds:e,setSelectedGroupIds:t})=>{const a=G(),n=(0,l.wA)(),{t:o}=(0,d.t)(),i=(0,l.d4)(T.T.getBroadcastMessageText),r=(0,l.d4)(T.T.getGroupsForTreeSelect),c=o("messaging.filters.groups.allFleets"),m=(0,s.useMemo)(()=>[{value:"all-groups",title:c,children:r}],[c,r]),g=e=>n(h.o.setBroadcastMessageText(e)),p=(0,s.useCallback)(e=>{t(R(e))},[t]);return _.createElement(_.Fragment,null,_.createElement("div",{className:a.fleets,"data-testid":"BroadcastModalContent-FleetsWrapper"},_.createElement(k.f,{"data-testid":"BroadcastModalContent-select-fleets",maxTagCount:"responsive",onChange:p,placeholder:o("messaging.filters.groups.placeholder"),treeCheckable:!0,treeData:m,treeDefaultExpandAll:!0,value:e})),_.createElement("div",{className:a.message,"data-testid":"BroadcastModalContent-MessageWrapper"},_.createElement(M.lI,{autoSize:{minRows:5,maxRows:5},maxLength:S.Gt,onChange:e=>g(e.target.value),placeholder:o("message.editor.input.placeholder"),showCount:!0,value:i})),_.createElement("div",{className:a.quickMessages,"data-testid":"BroadcastModalContent-QuickMessagesWrapper"},_.createElement(N.a,{onSelectQuickMessage:e=>g(e)}),_.createElement(C.P,null)))};var V=a(76866);const $=(0,y.wY)(e=>({root:{alignItems:"center",display:"flex",justifyContent:"flex-end",minHeight:44,padding:`0 ${e.spacing(2)}px`,[`@media (max-width: ${e.breakpoints.values.md}px)`]:{flexWrap:"wrap"}},alert:{marginTop:e.spacing(2),textAlign:"left"},info:{paddingRight:e.spacing(4),textAlign:"left",[`@media (max-width: ${e.breakpoints.values.md}px)`]:{marginBottom:e.spacing(2),width:"100%"}}}),{name:"BroadcastModalFooter"});var D=a(14041);const L=({isSendDisabled:e,isSending:t,onCancel:a,onSend:s,showError:l})=>{const n=$();return D.createElement(D.Fragment,null,D.createElement("div",{className:n.root},D.createElement("div",{key:"info",className:n.info,"data-testid":"BroadcastModalFooter-Info"},D.createElement(i.s,{id:"messaging.modal.broadcast.info"})),D.createElement(v.$,{type:"primary",key:"send",onClick:s,disabled:e,"data-testid":"BroadcastModalFooter-SendButton",loading:t,"data-
1pendoid":E.RA.sendBroadcastMessageButton},D.createElement(i.s,{id:"messaging.modal.broadcast.button.save"})),D.createElement(v.$,{key:"cancel",onClick:a,"data-testid":"BroadcastModalFooter-CancelButton","data-pendoid":E.RA.cancelBroadcastMessageButton},D.createElement(i.s,{id:"messaging.modal.broadcast.button.cancel"}))),l&&D.createElement(V.F,{className:n.alert,type:"error",message:D.createElement(i.s,{id:"messaging.modal.broadcast.error"}),showIcon:!0,"data-testid":"BroadcastModalFooter-alert"}))};var H=a(14041);const P=()=>{const[e,t]=(0,s.useState)([]),a=(0,l.wA)(),{t:n}=(0,d.t)(),o=(0,l.d4)(T.T.getBroadcastModalVisible),i=(0,l.d4)(T.T.getBroadcastMessageSending),r=(0,l.d4)(T.T.getBroadcastMessageSendError),c=(0,l.d4)(T.T.getBroadcastMessageText),m=n("messaging.modal.broadcast.sent"),g=()=>{t([]),a(h.o.setBroadcastModalVisible(!1))},p=0===c.length||c.length>S.Gt||0===e.length;return H.createElement(B.a,{footer:H.createElement(L,{isSendDisabled:p,isSending:i,onCancel:g,onSend:()=>{const t={body:c,groupIds:e};a(h.o.sendBroadcastMessage(t,{meta:{successMessage:m}}))},showError:r}),onCancel:g,title:n("messaging.modal.broadcast.title"),open:o,centered:!0,destroyOnClose:!0},H.createElement(F,{selectedGroupIds:e,setSelectedGroupIds:t}))};var Z=a(13215),Y=a(96705);const W=(0,y.wY)(e=>({root:{flexShrink:0,margin:e.spacing(4)}}),{name:"ListFilter"});var z=a(14041);let j;const U=()=>{const e=W(),t=(0,l.wA)(),{t:a}=(0,d.t)(),{track:n}=(0,Y.n)(),o=(0,l.d4)(T.T.getGroupsForTreeSelect),i=(0,l.d4)(T.T.getSelectedGroupIds),r=a("messaging.filters.groups.allFleets"),c=(0,s.useMemo)(()=>[{value:"all-groups",title:r,children:o}],[r,o]);return z.createElement("div",{className:e.root},z.createElement(M.NJ,{onChange:q({dispatch:t,track:n}),placeholder:a("messaging.filters.search.placeholder"),allowClear:!0}),z.createElement(Z.h,{size:4}),z.createElement(k.f,{"data-testid":"ListFilter-select-groups",maxTagCount:"responsive",onChange:Q({dispatch:t}),placeholder:a("messaging.filters.groups.placeholder"),treeCheckable:!0,treeData:c,treeDefaultExpandAll:!0,value:i}))},q=({dispatch:e,track:t})=>a=>{clearTimeout(j),j=setTimeout(()=>{e(h.o.setFilters({search:a.target.value})),t(E.AZ.searchVehicles)},200)},Q=({dispatch:e})=>t=>{const a=R(t);clearTimeout(j),j=setTimeout(()=>{e(h.o.setFilters({groupIds:a}))},200)};var X=a(28297),J=a(2444),K=a.n(J),ee=a(77177),te=a(81736),ae=Object.defineProperty,se=Object.defineProperties,le=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,re=(e,t,a)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,de=(e,t)=>{for(var a in t||(t={}))oe.call(t,a)&&re(e,a,t[a]);if(ne)for(var a of ne(t))ie.call(t,a)&&re(e,a,t[a]);return e},ce=(e,t)=>se(e,le(t));const me=(0,y.wY)(e=>({root:{borderTop:`1px solid ${e.colors.onsurfaceGrayBorders}`,display:"flex",flexDirection:"column",flexGrow:1,height:"100%",overflow:"hidden",overflowY:"scroll"},vehicleList:{backgroundColor:e.colors.surfaceOverlay,listStyleType:"none",marginBottom:0,padding:0},displayName:ce(de({},e.typography.sizes.md),{fontWeight:e.typography.weights.bold,flex:1,overflow:"hidden",paddingRight:e.spacing(1),textOverflow:"ellipsis",whiteSpace:"nowrap"}),listItemRow:ce(de({},e.typography.sizes.sm),{display:"flex",marginBottom:e.spacing(1),"&:last-child":{marginBottom:0}}),messagePreview:{color:e.colors.onsurfaceFont,fontWeight:e.typography.weights.bold,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},listItem:{backgroundColor:e.colors.surfaceOverlay,borderBottom:`1px solid ${e.colors.onsurfaceGrayBorders}`,color:e.colors.onsurfaceFont,"&:hover":{backgroundColor:e.colors.surfaceBlueHover}},listItemSelected:{backgroundColor:e.colors.surfaceLevel1},listItemButton:{padding:`${e.spacing(3)}px ${e.spacing(4)}px`,textAlign:"left",width:"100%"}}),{name:"VehicleList"});var ge=a(22284),pe=a(70127),ue=a(14041);const he=({vehicle:e})=>{var t,a;const s=me(),o=(0,l.wA)(),i=(0,c.Zp)(),r=(0,l.d4)(T.T.getSelectedVehicleId),d=(0,l.d4)(T.T.getUnreadMessagesByVehicleId);if((0,O.g)(e))return null;const{id:m,displayName:g,registrationPlate:p,driverName:u}=e,{body:f,sent:v}=null!=(a=null==(t=d[m])?void 0:t[0])?a:{},y=m===r;return ue.createElement("li",{key:m,className:(0,n.$)(s.listItem,y&&s.listItemSelected),"data-testid":"messaging-vehicle-list-item"},ue.createElement(pe.N,{onClick:()=>o(h.o.setSelectedVehicleId({navigate:i,vehicleId:m})),className:s.listItemButton,"data-testid":"messaging-vehicle-list-item-button","data-
1pendoid":E.RA.listItemButton},ue.createElement("div",{className:s.listItemRow},ue.createElement("div",{className:s.displayName},ue.createElement("span",{"data-testid":"messaging-vehicle-list-item-displayName"},g),u&&ue.createElement("span",{"data-testid":"messaging-vehicle-list-item-driverName"}," ⢠",u)),v&&ue.createElement("div",null,ue.createElement(ge.X,{value:v,friendly:!0,noToday:!0,"data-testid":"messaging-vehicle-list-item-timestamp"}))),p&&ue.createElement("div",{className:s.listItemRow,"data-testid":"messaging-vehicle-list-item-rego"},p),f&&ue.createElement("div",{className:s.listItemRow,"data-testid":"messaging-vehicle-list-item-preview"},ue.createElement("div",{className:s.messagePreview},f))))};var fe=a(14041);const ve=()=>{const e=me(),{t}=(0,d.t)(),a=(0,l.d4)(T.T.getVehicleList),s=(0,l.d4)(T.T.getSelectedVehicleId),n=(0,l.d4)(T.T.getUnreadMessagesByVehicleId);if((0,O.g)(a)||0===a.length)return fe.createElement(te.Y,{image:fe.createElement(ee.Py,null),title:t("messaging.vehicle.list.empty.title"),description:t("messaging.vehicle.list.empty.description")});const o=s?a.findIndex(e=>e.id===s):0;return fe.createElement("div",{className:e.root},fe.createElement("ul",{className:e.vehicleList},fe.createElement(K(),{itemRenderer:Ee({vehicleList:a}),itemSizeGetter:ye({vehicleList:a,unreadMessagesByVehicleId:n}),length:a.length,initialIndex:o,type:"variable"})))},Ee=({vehicleList:e})=>function(t){const a=e[t];return(0,O.g)(a)?fe.createElement(fe.Fragment,null):fe.createElement(he,{key:a.id,vehicle:a})},ye=({vehicleList:e,unreadMessagesByVehicleId:t})=>a=>{var s,l;const n=e[a];if((0,O.g)(n))return 0;const{registrationPlate:o}=n,{body:i}=null!=(l=null==(s=t[n.id])?void 0:s[0])?l:{};return i?o?S.ZH.MESSAGE_AND_REGO:S.ZH.MESSAGE_NO_REGO:o?S.ZH.NO_MESSAGE_REGO:S.ZH.NO_MESSAGE_NO_REGO};var be=a(6675);const we=(0,y.wY)(e=>({root:{backgroundColor:e.colors.surfaceOverlay,borderTop:({showHeader:t})=>t?`1px solid ${e.colors.onsurfaceGrayBorders}`:"none",display:"flex",height:"100vh",position:"relative",width:"100%",maxHeight:"100%"},isHidden:{},leftColumn:{borderRight:`1px solid ${e.colors.surfaceLevel3}`,display:"flex",flexDirection:"column",flexShrink:0,height:"100%",maxWidth:400,overflow:"hidden",width:"40%",zIndex:2,"&$isHidden":{[`@media (max-width: ${e.breakpoints.values.md}px)`]:{display:"none"}},[`@media (max-width: ${e.breakpoints.values.md}px)`]:{width:"100%",maxWidth:"none"}},rightColumn:{height:"100%",overflow:"hidden",width:"100%","&$isHidden":{[`@media (max-width: ${e.breakpoints.values.md}px)`]:{display:"none"}}}}),{name:"Messaging"});var Ie=a(14041);let xe;const Be=()=>{const e=(0,g.a)(),{timeZone:t}=(0,d.t)(),a=(0,l.d4)(T.T.getMessagingDataFetchError),f=(0,l.d4)(T.T.getSelectedVehicleId),v=!e||!f,y=we({showHeader:v});(()=>{const e=(0,l.wA)();(0,s.useEffect)(()=>{e(h.o.fetchGroups()),e(h.o.fetchVehicles())},[e])})(),(()=>{const[e,t]=(0,s.useState)(""),a=(0,l.wA)(),n=(0,p.T)("READ.DRIVER");(0,s.useEffect)(()=>(n&&(a(h.o.fetchLoggedInDrivers()),xe=setTimeout(()=>{t((new Date).toISOString())},3e4)),()=>clearTimeout(xe)),[a,n,e])})(),(()=>{const e=(0,l.wA)(),t=(0,c.Zp)(),a=(0,l.d4)(T.T.isSelectedVehicleIdValid);(0,s.useEffect)(()=>{"boolean"!=typeof a||a||e(h.o.setSelectedVehicleId({vehicleId:null,navigate:t}))},[e,t,a])})(),(()=>{const e=(0,l.wA)(),t=(0,c.Zp)(),{pathname:a}=(0,c.zy)();(0,s.useEffect)(()=>{var s;const l=null!=(s=a.split("/messaging/")[1])?s:null;e(h.o.setSelectedVehicleId({vehicleId:l,navigate:t}))},[e,t,a])})();const b=(0,be.Y)({isEnabled:!0}),w=(0,u.N)();return!b&&a?Ie.createElement(m.AX,null):Ie.createElement(r.b,{timeZone:w?t:o.oT},Ie.createElement(m.YW,null,v&&Ie.createElement(m.zY,null,Ie.createElement(m.sT,{title:Ie.createElement(i.s,{id:"messaging.page.title"})})),Ie.createElement(m.TK,{forAnUnscrollablePage:!0},Ie.createElement("div",{className:y.root},Ie.createElement("div",{className:(0,n.$)(y.leftColumn,f&&y.isHidden)},Ie.createElement(U,null),Ie.createElement(I,null),Ie.createElement(ve,null)),Ie.createElement("div",{className:(0,n.$)(y.rightColumn,!f&&y.isHidden)},Ie.createElement(X.n,{isPolling:b,onSendTrackingEvent:{action:E.AZ.sendMessage,category:E.yI},sendButtonPendoId:E.RA.sendMessageButton})),Ie.createElement(P,null)))))}},57618:(e,t,a)=>{a.d(t,{b:()=>o});var s=a(80601),l=a(56706),n=a(14041);const o=({children:e,timeZone:t})=>{const{locale:a,messages:o,onError:i}=(0,s.t)();return n.createElement(l.A,{key:a,locale:a,messages:o,onError:i,timeZone:t},e)}}}]); 2//# sourceMappingURL=messagingPage.myeroad.d86a122eeea634d54e4d.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.