new ReverseTemplateList([new ReverseTemplate("virginatlantic.com-flight-alt-en",function(t){return/Your Virgin Atlantic itinerary confirmation|Virgin Atlantic Airways e-Ticket /.test(t.subject)},function(t){if(/Your Virgin Atlantic itinerary confirmation|Virgin Atlantic Airways e-Ticket /.test(t.subject)){var e=Scanner.fromMessage(t);e.setLocale("en_US");var n,a,r,i,g,l,o,d,s,p,u=[],T=e.getSpan();n=T.next(/Your booking reference is/).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s([^\n]+)/,"Your booking reference is"),1);for(var A=T.next(/Flights/).nextTag("table6"),x=/($<a>[^\(\)]+)\s\(($<b>[^\(\)]+)\)/,m=0,y=A.nextAbsoluteDate(),v=0;!y.isNullSpan_&&/[\d]{2}[^\d\s]{3}|[^\d\s]{3}/.test(""+y);)y=y.nextAbsoluteDate(),/^[^\d\s]{3}/.test(""+y)||(1!==v?v+=1:(m+=1,v=0));for(;!A.isNullSpan_&&!regExpFormatted(/\1/,""+A.nextAnyTag("td").tagContents()).test("Passengers");){var b=A.nextTag("td6").tagContents().innerCapture(x);l=b.$a?b.$a:null,o=(b.$b?b.$b:null).trim(),/^\s+$/.test(""+o)&&(o=null);var C=A.nextTag("td6").nextTag("td6").nextTag("td6").tagContents().innerCapture(x);s=C.$a?C.$a:null,p=(C.$b?C.$b:null).trim(),/^\s+$/.test(""+p)&&(p=null),g=combineDateAndTime(A.next(/Depart/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents(),A.next(/Depart/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents()),d=combineDateAndTime(A.next(/Arriving/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents(),A.next(/Arriving/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents());var c=l.next(/Flight Number/).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s($<a>[^\d]+)?($<b>\d+)/,"Flight Number"));r=c.$b?c.$b:null,i=c.$a?c.$a:null,ASSERT(s,l,g,d)&&u.push({airlineCode:i,flightNumber:r,departureAirport:l,departureCode:o,departureTime:g,arrivalAirport:s,arrivalCode:p,arrivalTime:d}),A=A.nextTag("table6")}var $=function(t){var e=t.nextAnyTag("td").tagContents().innerCapture(regExpFormatted(x)),n=e.$a?e.$a:null,a=(e.$b?e.$b:null).trim(),r=t.nextTag("td6").nextTag("td6").nextTag("td6").tagContents().innerCapture(x);return[n,a,r.$a?r.$a:null,(r.$b?r.$b:null).trim()]};if(u.length!==m){u=[],A=T.next(/Flights/).nextTag("table6");for(var h=A.next(/Departing/).previousAnyTag("tr");!h.isNullSpan_;){var f=$(h);l=f[0],o=f[1],s=f[2],p=f[3],g=combineDateAndTime(h.next(/Depart/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents(),h.next(/Depart/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents()),d=combineDateAndTime(h.next(/Arriving/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents(),h.next(/Arriving/).parentAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents());var c=h.next(/Flight Number/).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s($<a>[^\d]+)($<b>\d+)/,"Flight Number"));c?(r=c.$b?c.$b:null,i=c.$a?c.$a:null):(c=h.next(/Flight Number/).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s($<b>\d+)/,"Flight Number")),r=c.$b?c.$b:null,i=null),ASSERT(s,l,g,d)&&u.push({airlineCode:i,flightNumber:r,departureAirport:l,departureCode:o,departureTime:g,arrivalAirport:s,arrivalCode:p,arrivalTime:d}),h=h.next(/Departing/).next(/Departing/).previousAnyTag("tr")}}var F=T.next(/Passengers/).next(/eTicket/).previousAnyTag("td").tagContents(),N=[];if(F.isNullSpan_)N.push({name:F});else for(;!F.isNullSpan_;)N.push({name:F}),F=F.next(/eTicket/).next(/eTicket/).previousAnyTag("td").tagContents();for(var S=[],D=0;D<u.length;D++)for(var k=u[D],E=0;E<N.length;E++){var z={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:k.airlineName,airlineCode:k.airlineCode,flightNumber:k.flightNumber,departureAirportFuzzy:k.departureAirport,departureAirportCode:k.departureCode,departureTime:k.departureTime,arrivalAirportFuzzy:k.arrivalAirport,arrivalAirportCode:k.arrivalCode,arrivalTime:k.arrivalTime},underName:{"@type":"http://schema.org/Person",name:N[E].name},checkinUrl:a,reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed"};S.push(z)}if(S.length)return S}},"0/1/2/3/4/5/6/152/175/854","SG24ce0132")]);