1"use strict";(self.webpackChunkSWRBookingFlowAppUi=self.webpackChunkSWRBookingFlowAppUi||[]).push([["src_app_modules_mailhandoff_module_ts"],{6149(w,R,o){o.d(R,{MailhandoffModule:()=>L});var v=o(8724),S=o(3049),b=o(467),u=o(5802),D=o(7705),m=o(3623),T=o(2501),p=o(3012),i=o(5547),N=o(6245),y=o(2284),C=o(8350),E=o(4366);const A=[{path:"",component:(()=>{class r{constructor(t,e,n,s,a){this.activatedRoute=t,this.router=e,this.webStorageDataService=n,this.locationService=s,this.apiResponse=a,this.cdr=(0,u.WQX)(D.gRc),this.ngZone=(0,u.WQX)(u.SKi)}ngOnInit(){this.getLocations()}setLocalData(){this.activatedRoute.queryParams.subscribe(t=>{if(!Object.keys(t).length)return void this.router.navigate(["/"]);const e=this.buildMailHandOffRequest(t),n=this.buildSearchRequest(e);this.webStorageDataService.setSessionStorageData(m.e.SESSIONSTORAGEKEYSCONSTANTS.SEARCH_REQUEST,n,!0),this.webStorageDataService.setSessionStorageData(m.e.SESSIONSTORAGEKEYSCONSTANTS.FRESH_SEARCH_REQUEST,n,!0),this.ngZone.run(()=>{this.cdr.detectChanges(),this.router.navigate(["/ticket-search-results"])})})}buildSearchRequest(t){const e=new p.n2,n=new T.g;n.numberofrailcards=0,n.Children=0,n.adults=e.adults,n.RailCardCode="";const s=(new Date).getFullYear(),a=!!t.retm;e.locfrom=this.locationService.getLocationByNlc(t.onlc,this.locations)?.code,e.DepartureLocationName=this.locationService.getLocationByNlc(t.onlc,this.locations)?.nameWithCRS??"",e.locto=this.locationService.getLocationByNlc(t.dnlc,this.locations)?.code,e.ArrivalLocationName=this.locationService.getLocationByNlc(t.dnlc,this.locations)?.nameWithCRS??"",e.adults=Number(t.nad??1),e.children=Number(t.nch??0),e.IsReturnRequest=a,e.oneway=!a,e.openreturn="open"==t.jtype?.toLowerCase();const d=Number(t.outy);if(e.datetimedepart=this.buildDateTime(Number.isNaN(d)?s:d,t.outm,t.outd,t.outh,t.outmi),e.passengergroup=[n],a){const c=Number(t.rety);e.datetimereturn=this.buildDateTime(Number.isNaN(c)?s:c,t.retm||0,t.retd||0,t.reth||0,t.retmi||0),e.PathConstraintType="VIA",e.IsNewMethod=!0,e.oneway=!1,e.Traveltype="DEPARTAFTER",e.IsReturnRequest=!0,e.TraveltypeReturn="DEPARTAFTER",e.returndepartafter=!0}switch(t.jtype?.toLowerCase()){case"return":e.TravelSolutionDirection="RETURN";break;case"open":e.TravelSolutionDirection="OPEN";break;default:e.TravelSolutionDirection="ONE_WAY"}return e}buildDateTime(t,e,n,s,a){const d=Number(t)<100?2e3+Number(t):Number(t),c=new Date(d,Number(e)-1,Number(n),Number(s),Number(a),0),g=new Date,l=c<g?g:c,h=f=>f.toString().padStart(2,"0");return`${l.getFullYear()}-${h(l.getMonth()+1)}-${h(l.getDate())}T${h(l.getHours())}:${h(l.getMinutes())}:00`}getLocations(){var t=this;return(0,b.A)(function*(){yield t.apiResponse.getLocationResult().then(e=>{null!=e&&(t.responseData=e,200===t.responseData.responseCode&&(t.webStorageDataService.setLocalStorageData(m.e.LOCALSTORAGEKEYSCONSTANTS.LOCATIONRESPONSE,t.responseData.data,!0),t.locations=t.responseData.data,t.setLocalData()),t.ngZone.run(()=>t.cdr.markForCheck()))})})()}buildMailHandOffRequest(t){return{onlc:t.onlc,dnlc:t.dnlc,outy:Number(t.outy),outm:Number(t.outm),outd:Number(t.outd),outh:Number(t.outh),outmi:Number(t.outmi),rety:Number(t.rety),retm:Number(t.retm),retd:Number(t.retd),reth:Number(t.reth),retmi:Number(t.retmi),nad:Number(t.nad??1),nch:Number(t.nch??0),jtype:t.jtype?.toLowerCase()}}static{this.\u0275fac=function(e){return new(e||r)(i.rXU(N.nX),i.rXU(N.Ix),i.rXU(y.D),i.rXU(C.N),i.rXU(E.A))}}static{this.\u0275cmp=i.VBU({type:r,selectors:[["app-mail-hand-off"]],standalone:!1,decls:2,vars:0,template:function(e,n){1&e&&(i.j41(0,"p"),i.EFF(1,"mail-hand-off works!"),i.k0s())},encapsulation:2})}}return r})()}];let O=(()=>{class r{static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275mod=i.$C({type:r})}static{this.\u0275inj=u.G2t({imports:[S.iI.forChild(A),S.iI]})}}return r})(),L=(()=>{class r{static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275mod=i.$C({type:r})}static{this.\u0275inj=u.G2t({imports:[O,v.G]})}}return r})()}}]);
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.