(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p,o,m,s,u,d,g,l,h,c,v,C,N,b,f,y,S,$=[],T=[];if(i=a.getSpan().innerCapture(t.name,1).trim(),h=a.getSpan().innerCapture(regExpFormatted(/\1\s+(.*)/,t.ticketNumber),1),N=a.getSpan().innerCapture(regExpFormatted(/\1\s+([A-Z\d]{4,})/,t.reservationId),1),not(i))return CONTINUE;T[""+i]={name:i,seats:{},seatingType:{},ticketNumber:h,totalPrice:c,priceCurrency:v},b=a.getSpan().allInnerCapture(t.arrival,1);for(var A=0;A<b.length;A++)1===b.length&&(S=/(\w{3})\s(\w{3})$/.exec(e.subject),u=S[1],l=S[2]),y=b[A].withStart(b[A].previous(t.contentRegex).getEnd()).withEnd(b[A].previous(/.*/).next(t.flightSectionEnd).getEnd()),f=y.innerCapture(t.flightInfo),m=a.getDetachedSpan(f.$departureDate+" "+f.$departureHour+":"+f.$departureMinute).innerDate(),f.$arrivalDate.exists()||(f.$arrivalDate=f.$departureDate),d=a.getDetachedSpan(f.$arrivalDate+" "+f.$arrivalHour+":"+f.$arrivalMinute).innerDate(),o=f.$airlineCode,n=f.$flightNumber,s=f.$departureAirport,g=f.$arrivalAirport,p=a.getSpan().innerCapture(regExpFormatted(/\1\s+(.*)/,t.price),1),c=p.innerCapture(/([\d,.]+)/,1),v=p.innerCapture(/([^\d,.]+)/,1).trim(),ASSERT(o,n,s,m,g,d)&&$.push({reservationId:N,airlineCode:o,flightNumber:n,departureAirport:s,departureCode:u,departureTime:m,arrivalAirport:g,arrivalCode:l,arrivalTime:d,passengers:T});var D=[];for(A=0;A<$.length;A++)for(var E=$[A],F=Object.keys(E.passengers),k=0;k<F.length;k++){var x=E.passengers[F[k]],I={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:E.airlineName,airlineCode:E.airlineCode,flightNumber:E.flightNumber,departureAirportFuzzy:E.departureAirport,departureAirportCode:E.departureCode,departureTime:E.departureTime,arrivalAirportFuzzy:E.arrivalAirport,arrivalAirportCode:E.arrivalCode,arrivalTime:E.arrivalTime},underName:{"@type":"http://schema.org/Person",name:x.name},checkinUrl:C,reservationId:E.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:c,priceCurrency:v,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:h,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:x.seats[E.flightNumber],seatingType:x.seatingType[E.flightNumber]}}};valid(x.membershipNumber,x.programName)&&(I.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:x.membershipNumber,programName:x.programName}),D.push(I)}return D.length?D:void 0}}).call();