(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var n,i,p,s,o,g,l,d,m,u,h,T,v=[],x=[],c=[];if(/on hold/i.test(e.plain))return CONTINUE;""+(n=a.getSpan().next(t.reservationId).nextAnyTag("td").tagContents().trim())||(n=a.getSpan().next(t.reservationIdAlt).nextRegExp(/[A-Z\d]{6}/));for(var A,C,f=a.getSpan().next(t.passengers).next(t.passenger);0!==(""+f).length;)A=f.innerCapture(t.passenger),d={},d.name=A.$name,d.ticketNumber=A.$ticketNumber,ASSERT(d.name)&&(C=!0,v.push(d)),f=f.next(t.passenger);for(u=a.getSpan().next(t.flightDetails).nextTag("table5").parentTag("table4").allInnerTags("table5"),g=0;g<u.length;g++)if(m={},l=u[g].allInnerTags("td5"),l.length>4){if(!C)for(var b=l[1].next(t.passengerAlt).parentTag("table6").allInnerTags("td6"),y=0;y<b.length;y++)d={},d.name=b[y].nextTag("td7").tagContents().trim(),d.name.exists()&&(C=!0,v.push(d));h=l[0].innerCapture(t.flightInfo),m.airlineCode=h.$airlineCode,m.flightNumber=h.$flightNumber,i=l[1].innerDate(),p=l[1].next(t.departure).nextTag("td6").innerDate(),m.departureTime=combineDateAndTime(i,p),m.departureAirport=l[1].next(t.departure).nextTag("td6").tagContents().innerCapture(/(.*)\s\n/,1),m.departureAirportCode=/^([A-Z]{3}) .*/.exec(""+m.departureAirport)[1],s=l[1].next(t.arrival).nextTag("td6").innerDate(),m.arrivalTime=combineDateAndTime(i,s),m.arrivalAirport=l[1].next(t.arrival).nextTag("td6").tagContents().innerCapture(/(.*)\s\n/,1),Date.parse(m.arrivalTime)<Date.parse(m.departureTime)&&(m.arrivalTime=modifyDate(m.arrivalTime,1)),m.arrivalAirportCode=/^([A-Z]{3}) .*/.exec(""+m.arrivalAirport)[1],m.seatingType=l[1].next(t.seat).nextTag("td7").tagContents().trim(),m.passengers=[];for(var N=0;N<v.length;N++){d={};var S=l[8].allInnerTags("td7"),k=S[3*N+2].innerCapture(/([\dA-Z]{3,4})/,1);d.seat=k;var F=S[3*N].tagContents();d.name=F.replace(/[\u200B-\u200D\uFEFF]/g,"");var D=a.getSpan().next(t.passengers).nextRegExp(regExpFormatted(/\n\1\:\s+\d{10,}\s+<.*?>/,""+d.name));d.ticket=D.innerCapture(regExpFormatted(/\n\1\:\s+($<ticketNumber>\d{10,})\s+<($<link>.*?)>/,""+d.name),1),m.passengers.push(d)}ASSERT(m.departureAirport,m.arrivalAirport,m.departureTime,m.arrivalTime,m.airlineCode,m.flightNumber)&&x.push(m)}for(T=t.bookingPending?"Pending":"Confirmed",g=0;g<x.length;g++){m=x[g];for(var I=m.passengers,N=0;N<I.length;N++){d=I[N];c.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:"Aero M\xe9xico",airlineCode:m.airlineCode,flightNumber:m.flightNumber,departureAirportFuzzy:m.departureAirport,departureTime:m.departureTime,departureAirportCode:m.departureAirportCode,arrivalAirportFuzzy:m.arrivalAirport,arrivalTime:m.arrivalTime,arrivalAirportCode:m.arrivalAirportCode},underName:{"@type":"http://schema.org/Person",name:d.name},checkinUrl:o,reservationId:n,reservationStatus:"http://schema.org/Reservation"+T,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:d.ticket,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:m.seatingType,seat:d.seat}}})}}return c.length?c:void 0}}).call();