(function(){return function(e,r,t){var a=Scanner.fromMessage(e);if(a.setLocale(t),a.getSpan().nextRegExp(/Ticket number\(s\)/).exists()){var n,i,p,s,o,l,m,u,g,c,d,h,b,T,v,f,y,A,x,C,N,k=[],S={},$=[];n=a.getSpan().innerCapture(/\bYour confirmation number is (\w+)[.\s]/,1),i=a.getSpan().nextText("Skip the line, check in now!").nextTag("td2").innerLink(),not(i)&&(i=a.getSpan().nextText("Your confirmation number is").nextTag("table3").allInnerLinks(),i=5===i.length?i[1]:null),d=a.getSpan().nextRegExp(/Ticket number\(s\)/).parentTag("table3").allInnerTagsFiltered("td3").slice(2);for(var D=0;D<d.length;D++)d[D].innerCapture(/($<name>.*) <.*?>/)&&(c=d[D].innerCapture(/($<name>.*) <.*?>/,1),h=d[D+1]&&d[D+1].innerCapture(/^(\d+)$/,1)),valid(c)&&(S[""+h]={name:c,ticketNumber:h,seats:{},seatingType:{}}),c=null;for(T=a.getSpan().nextText("Your itinerary").nextAnyTag("table"),l=T.getTagNumber(),T=T.allInnerTags("tr"+l).map(function(e){return e.allInnerTags("td"+l).map(function(e){return e.innerTag("td"+(int(l)+1)).exists()?e.allInnerTagsFiltered("td"+(int(l)+1)):e.tagContents()})}).filter(function(e){return e.length>=6}),p=0;p<T.length;p++){for(g=[],s=0;s<T[p].length;s++)T[p][s]instanceof Array?g=g.concat(T[p][s]):g.push(T[p][s]);T[p]=g}for(p=0;p<T.length;p++)if(T[p][0].innerDate().exists()){for(b=T[p],f=combineDateAndTime(b[0].lastInnerDate(),b[1].innerDate()),x=combineDateAndTime(b[0].lastInnerDate(),b[1].lastInnerDate()),Date.parse(f)>Date.parse(x)&&(x=modifyDate(x,1)),g=b[2].innerCapture(/^($<departureAirport>.*?)(?:\s+\(($<departureCode>[A-Z]{3})\))?\s+to\s+($<arrivalAirport>.*?)(?:\s+\(($<arrivalCode>[A-Z]{3})\))?$/),y=g?g.$departureAirport:null,A=g?g.$departureCode:null,C=g?g.$arrivalAirport:null,N=g?g.$arrivalCode:null,v=b[3],$=Object.keys(S),o=0;o<$.length;o++)u=""+b[3].next(S[$[o]].name).nextAnyTag("td").nextAnyTag("td").tagContents(),S[$[o]].seats[""+v]=/Select seat/.test(u)?"":u,m=""+b[3].next(S[$[o]].name).nextAnyTag("td").tagContents(),m=m.replace(/\n/," "),S[$[o]].membershipNumber="N/A"===m?"":m,valid(m)&&(S[$[o]].programName="Frequent Flyer");ASSERT(v,f,y,x,C)&&k.push({flightNumber:v,departureTime:f,departureCode:A,departureAirport:y,arrivalTime:x,arrivalCode:N,arrivalAirport:C,passengers:S})}var F=[];for(p=0;p<k.length;p++){var I=k[p];for($=Object.keys(I.passengers),s=0;s<$.length;s++){var z=I.passengers[$[s]],R={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",flightNumber:I.flightNumber,departureAirportFuzzy:I.departureAirport,departureAirportCode:I.departureCode,departureTime:I.departureTime,arrivalAirportFuzzy:I.arrivalAirport,arrivalAirportCode:I.arrivalCode,arrivalTime:I.arrivalTime},underName:{"@type":"http://schema.org/Person",name:z.name},checkinUrl:i,reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:z.totalPrice,priceCurrency:z.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:z.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:z.seats[I.flightNumber],seatingType:z.seatingType[I.flightNumber]}}};valid(z.membershipNumber,z.programName)&&(R.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:z.membershipNumber,programName:z.programName}),F.push(R)}}if(F.length)return F}}}).call();