(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p=t.cancel.test(e.plain)?"Cancelled":"Confirmed";i=a.getSpan().next(t.flightReservation).innerCapture(t.flightReservation,1);var o=a.getSpan().innerCapture(t.customerName,1);""+o||(o=a.getSpan().innerCapture(t.customerNameAlt,1));for(var l=o.split(/\n/).filter(function(e){return(""+e).length>2}),m=[],u={};i.exists();){var u={},s=i.previousDate(),v=s.nextRegExp(/([A-Z]{2,})\s(\d+)/).innerCapture(/([A-Z]{2,})\s(\d+)/);u.airlineCode=v[1],u.flightNumber=v[2];var g=i.nextDate(),h=g.nextDate();s=unSpanDate_(s),u.departureDateTime=combineDateAndTime(s,g),u.arrivalDateTime=combineDateAndTime(s,h),Date.parse(u.departureDateTime)>Date.parse(u.arrivalDateTime)&&(u.arrivalDateTime=modifyDate(u.arrivalDateTime,1));var c=i.nextRegExp(t.flightRegex).innerCapture(t.flightRegex);if(u.departureAirport=c[1].trim(),u.arrivalAirport=c[2].trim(),ASSERT(u.departureDateTime,u.arrivalDateTime,u.flightNumber,u.arrivalAirport,u.departureAirport))for(var d=0;d<l.length;d++){var n=l[d].innerCapture(/(.+?)\(/,1).trim(),f={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:u.airlineCode,flightNumber:u.flightNumber,departureAirportFuzzy:u.departureAirport,departureTime:u.departureDateTime,arrivalAirportFuzzy:u.arrivalAirport,arrivalTime:u.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:n},reservationId:i,reservationStatus:"http://schema.org/Reservation"+p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat"}}};m.push(f)}i=i.next(t.flightReservation).innerCapture(t.flightReservation,1)}if(m.length)return m}}).call();