(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n=a.getSpan(),p=t.isCancellation?"Cancelled":"Confirmed",o=[],u=[],l=[];n.next("Passengers").parentTag("table6").allInnerTags("table8").shift().allInnerTags("td8")[1].tagContents().split(/\n/).slice(2).filter(function(e){return!t.ticketNumberRegExp.test(e)&&""+e}).forEach(function(e){o.push({name:e.trim(),ticketNumber:e.next(t.ticketNumberRegExp).nextRegExp(/\d+/)})});var s,m,d,c,g,h,v,A,f,C,D,N,b,i=n.innerCapture(t.reservationNumber,1);return a.getSpan().allInnerCapture(/ [A-Z]{3}\s+[A-Z]{3} /g,0).forEach(function(e){var r=e.previousRegExp(/ \w{3} \w{3} \d{2} /).innerDate();r===b&&N>unSpanDate_(r)&&(r=N);var i=e.innerCapture(/([A-Z]{3})\s+([A-Z]{3})/);g=i[1],f=i[2];var n=e.nextDate().innerCapture(t.timeFormatRegExp);C=n[2],h=n[1];var p=e.next(t.airlineAndFlightNumberRegExp).innerCapture(t.airlineAndFlightNumberRegExp);s=p[1],d=p[2],v=a.getDetachedSpan(r+" "+h).innerDate(),D=a.getDetachedSpan(r+" "+C).innerDate(),Date.parse(unSpanDate_(D))<Date.parse(unSpanDate_(v))&&(D=modifyDate(D,1),N=D.split(" ")[0]),l.push({airlineName:s,airlineCode:m,flightNumber:d,departureAirport:c,departureAirportCode:g,departureDateTime:v,arrivalAirport:A,arrivalAirportCode:f,arrivalDateTime:D}),b=e.previousRegExp(/ \w{3} \w{3} \d{2} /).innerDate()}),0===o.length&&o.push({}),l.forEach(function(e){o.forEach(function(r){ASSERT(e.airlineName||e.airlineCode,e.flightNumber,e.departureAirport||e.departureAirportCode,e.departureDateTime),u.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:e.airlineCode,airlineName:e.airlineName,flightNumber:e.flightNumber,departureAirportFuzzy:e.departureAirport,departureAirportCode:e.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:r.name},reservationId:i,reservationStatus:"http://schema.org/Reservation"+p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:r.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:r.seat,seatingType:null}}})})}),u}}).call();