(function(){return function(e,t,r){var a,n,i,g,o,s,d,m,p,h,l,c=[],x=Scanner.fromMessage(e),u=[];x.setLocale(t);var T=x.getSpan().next(r.bookingReference).nextTag("td2");h=T.tagContents().innerCapture(r.bookingCapture,1),T=T.next(r.flightItinerary);for(var v=T.next(r.passengerInfo).nextTag("table3").nextTag("table3").nextTag("table3");v.exists()&&!r.baggage.test(v.nextTag("td3").tagContents().getString());)c.push({name:v.nextTag("td3").nextTag("td3").tagContents().innerCapture(/\s*([^(]+)/i,1).trim(),ticketNumber:v.nextTag("td2").tagContents()}),v=v.nextTag("table3");var C=regExpFormatted(/\1 \w\w \d{2,4}/gi,r.flight),b=(""+x.getSpan()).match(C).length;T=T.next(C);for(var f=0;f<b;f++){var N=T.parentTag("td2").innerCapture(regExpFormatted(/\1\s+($<airlineID>\w{2})\s*($<flightNo>\d{4})/i,r.flight));n=N.$airlineID,i=N.$flightNo,"AF"===n.getString()&&(a="Air France");var S=T.nextTag("td4"),F=S.tagContents();s=S.nextTag("td4").innerDate();if(2===S.nextTag("td4").tagContents().getString().match(/\d{1,2}\s*:\s*\d{1,2}/g).length){var y=S.nextTag("td4").tagContents().innerCapture(/\d{1,2}\s*:\s*\d{1,2}[^\d]*(\d{1,2}\s*:\s*\d{1,2})/,1);s=combineDateAndTime(s,y)}"ja_JP"===t&&(s=combineDateAndTime(s,s));var $=S.nextTag("td4").nextTag("td4").innerCapture(regExpFormatted(/\(($<departureCode>\w+)\)\s*,\s*($<departureLoc>[^[]+)/i));o=$.$departureCode,g=F.getString()+","+$.$departureLoc.trim();var A=S.next(r.arrival).nextTag("td4");F=A.tagContents(),p=combineDateAndTime(s,A.nextTag("td4").innerDate()),/.\+1/i.test(A.nextTag("td4").tagContents().getString())&&(p=modifyDate(p,1));var k=A.nextTag("td4").nextTag("td4").innerCapture(regExpFormatted(/\(($<arrivalCode>\w+)\)\s*,\s*($<arrivalLoc>[^[]+)/i));if(m=k.$arrivalCode,d=F.getString()+","+k.$arrivalLoc.trim(),l=A.next(r.class).parentTag("td3").tagContents().innerCapture(regExpFormatted(/\1\s*([^ ]+)/i,r.class),1),ASSERT(n,i,s,g,p,d))for(var D=0;D<c.length;D++){var z=c[D],E={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:a,airlineCode:n,flightNumber:i,departureAirportFuzzy:g,departureAirportCode:o,departureTime:s,arrivalAirportFuzzy:d,arrivalAirportCode:m,arrivalTime:p},underName:{"@type":"http://schema.org/Person",name:z.name},checkinUrl:"",reservationId:h,reservationStatus:"http://schema.org/ReservationConfirmed",reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:z.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:l}}};valid(OR(z.membershipNumber,z.programName))&&(E.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:z.membershipNumber,programName:z.programName}),u.push(E)}T=T.next(C)}if(u.length)return u}}).call();