// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,p,n,o,m,s,g,u,l,h,d,c,v,N,b=[],C=[];if(i=a.getSpan().innerCapture(regExpFormatted(/\1\s+(.*),/,t.name),1),c=a.getSpan().innerCapture(regExpFormatted(/\1\n\s*(.*)\s*-/,t.reservationId),1),not(i))return CONTINUE;C[""+i]={name:i,seats:{},seatingType:{},ticketNumber:u,totalPrice:l,priceCurrency:h},v=a.getSpan().innerCapture(regExpFormatted(/\1\n\s*($<airlineCode>\w{2})($<flightNumber>\d+)/,t.flight)),n=v.$airlineCode,p=v.$flightNumber,m=a.getSpan().innerCapture(regExpFormatted(/\1\n\s*(.*)/,t.departureAirport),1),o=m.nextDate(),g=a.getSpan().innerCapture(regExpFormatted(/\1\n\s*(.*)/,t.arrivalAirport),1),s=g.nextDate(),ASSERT(n,p,m,o,g,s)&&b.push({reservationId:c,airlineCode:n,flightNumber:p,departureAirport:m,departureTime:o,arrivalAirport:g,arrivalTime:s,passengers:C});var f=[];for(N=0;N<b.length;N++)for(var y=b[N],T=Object.keys(y.passengers),A=0;A<T.length;A++){var F=y.passengers[T[A]],S={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:y.airlineName,airlineCode:y.airlineCode,flightNumber:y.flightNumber,departureAirportFuzzy:y.departureAirport,departureAirportCode:y.departureCode,departureTime:y.departureTime,arrivalAirportFuzzy:y.arrivalAirport,arrivalAirportCode:y.arrivalCode,arrivalTime:y.arrivalTime},underName:{"@type":"http://schema.org/Person",name:F.name},checkinUrl:d,reservationId:y.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:l,priceCurrency:h,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:u,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:F.seats[y.flightNumber],seatingType:F.seatingType[y.flightNumber]}}};valid(F.membershipNumber,F.programName)&&(S.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:F.membershipNumber,programName:F.programName}),f.push(S)}return f.length?f:void 0}}).call();