(function(){return function(e,r,t){function a(){return(""+d).indexOf("AMERICAN AIRLINES")>=0?"AA":(""+d).indexOf("US AIRWAYS")>=0?"US":""}var n=Scanner.fromMessage(e);n.setLocale(r);var i,o,p,s,g,m,l,u,h,c,d,v,f,y,T,b,C=[],N={};if(c=n.getSpan().next(t.travelerInformation).nextTag("table2").allInnerTags("tr2"),u={},c.length)for(var A=1;A<c.length;A++)l=c[A].allInnerTags("td2").map(function(e){return e.tagContents()}),3===l.length&&(s=""+l[0],u[s]||(u[s]={seat:[],seatingType:[]}),u[s].seat.push(l[2]),u[s].seatingType.push(l[1]));if(m=n.getSpan().next(t.yourItinerary).nextTag("table1").allInnerTags("tr1"),m.length>2)for(var A=2;A<m.length;A++)if(h=m[A].allInnerTags("td1").map(function(e){return e.tagContents()}),8===h.length){d=h[0];var S=h[1];if(y=h[2].innerCapture(/^([A-Z]{3})/,1),f=getFuzzyDate(h[3]),b=h[4].innerCapture(/^([A-Z]{3})/,1),T=getFuzzyDate(h[5]),ASSERT(d,S,y,f,b,T)){g=Object.keys(u),N={};for(var I=0;I<g.length;I++)N[g[I]]={name:g[I],seat:u[g[I]].seat[C.length],seatingType:u[g[I]].seatingType[C.length]};v=a(d),i=n.getSpan().innerCapture(regExpFormatted(/\1 \2:\s+(\w{6})/,v,t.recordLocator),1),not(i)&&(i=n.getSpan().innerCapture(regExpFormatted(/\b\1:\s+(\w{6})/,t.recordLocator),1)),C.push({airlineName:d,airlineCode:v,flightNumber:S,reservationId:i,departureCode:y,departureTime:f,arrivalCode:b,arrivalTime:T,passengers:N})}}for(var z=[],A=0;A<C.length;A++)for(var F=C[A],x=Object.keys(F.passengers),I=0;I<x.length;I++){var k=F.passengers[x[I]],R={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:F.airlineName,airlineCode:F.airlineCode,flightNumber:F.flightNumber,departureAirportFuzzy:F.departureAirport,departureAirportCode:F.departureCode,departureTime:F.departureTime,arrivalAirportFuzzy:F.arrivalAirport,arrivalAirportCode:F.arrivalCode,arrivalTime:F.arrivalTime},underName:{"@type":"http://schema.org/Person",name:k.name},checkinUrl:o,reservationId:F.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:k.totalPrice,priceCurrency:p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:k.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:k.seatingType,seatNumber:k.seat}}};valid(k.membershipNumber)&&(R.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:k.membershipNumber,programName:k.programName}),z.push(R)}if(z.length)return z}}).call();