,viaRoads:"",delayColor:n,travelDurationMin:Math.round(e.results[0].travelDurationTraffic/60)}}})).catch((e=>{}))}))}function ve(e,t,n){return(0,_.mG)(this,void 0,void 0,(function*(){let i;if(!(t.end&&t.end.latitude&&t.end.longitude&&t.start&&t.start.latitude&&t.start.longitude))return(0,B.H)(q.Nol,"TrafficCard Failed to get reverse commute data with current data"),null;try{i=yield e.getDirectionsWithLocationStrings(p.customRoutesApiKey,"",t.end.latitude,t.end.longitude,t.start.latitude,t.start.longitude,(0,H.Yq)().CurrentMarket)}catch(e){return(0,B.OO)(e,q.Nol,"TrafficCard Failed to get reverse commute directions data"),null}if(i&&i.results&&i.results.length>0){const e=i.results[0],r=t.destinationAddressType===c.Work?c.Home:c.Work;return{destinationAddressType:r,commuteDetails:ce(e,n,r),start:t.end,end:t.start}}return(0,B.H)(q.Nol,"TrafficCard Failed to get reverse commute directions data: empty directionsResponse"),null}))}function Ce(e){return e?{latitude:e.Latitude,longitude:e.Longitude,locality:e.City,accuracy:e.Accuracy}:null}function Te(e){return!(!e.latitude||!e.longitude)}function Se(e){new URL(window.location.href).searchParams.forEach(((t,n)=>{"item"===n&&e.searchParams.append(n,t)}))}function Le(e,t){if(!e)return null;const n=(0,H.Yq)().CurrentMarket,i=new Y.$;return e.map((e=>{const r=t&&de(e.TrafficCongestion,t);return{start:Ce(e.Start&&e.Start.Location),end:Ce(e.End&&e.End.Location),name:t&&t.cityToCityTemplate&&t.cityToCityTemplate.replace("{0}",e.Start.Location.City).replace("{1}",e.End.Location.City),description:`${n&&i.localizedNumberString(e.TravelDuration,n)} ${t&&t.min}`,congestion:e.TrafficCongestion,duration:e.TravelDuration,delayColor:r&&r[0],delay:r&&r[1]}}))}function Ie(e){if(!e)return new Array;const t=new Array;for(const n of e){const e={id:n.Id,location:{latitude:n.Location.Latitude,longitude:n.Location.Longitude},name:n.Name,url:n.Url,temporaryPassword:n.TemporaryPassword,copyrightNotice:n.CopyrightNotice,gridId:n.GridId,isAreaCamera:n.IsAreaCamera,score:n.Score,labels:n.Labels,congestion:n.TrafficCongestion};t.push(e)}return t}function Ae(e,t,n,i,r){var o,a,s;if(!n)return;const{locationDetectionMode:u,cameras:l,collisionsAndConstructions:c,tr