(function(){return function(e,r){var t=Scanner.fromMessage(e);t.setLocale("en_US");for(var a=t.getSpan(),i=[],n=[],o=[],p=e.plain.split(/Departing From/i).length-1,m=(e.plain.slice(),0);m<p;m++)a=a.next(/(^Flight [A-Z]{2}[\s\S]*?)(?:^Flight [A-Z]|^Hotel$|^Car Rental$|^Plan)/gm),o.push(""+a);var c=[];c.push(r.underName);for(var l=t.getSpan().next(r.underName).next(/\n/).next(/\w+\s\w+/);!/Trip Confirmation/.test(""+l);)c.push(l),l=l.next(/\n/).next(/\w+\s\w+/);return o.forEach(function(e){var r,a,i,o,p,m,c,l,s,u,h,g,d,v,x,A,N="Confirmed",C=t.getDetachedSpan(e),D=e.slice(),e=e.split("\n"),b=/^([A-Z]{3})-([A-Z]{3})$/.exec(e[2].trim());s=b[1],g=b[2];var f=/([A-Z]{2})([0-9]{4})/.exec(e[0].trim());a=f[1],i=f[2],r=/Airline.*\n.*\n(.*)\n/.exec(D)[1].split("<")[0].trim(),l=/Departing From.*\n.*\n(.*)\n/.exec(D)[1],h=/Arriving At.*\n.*\n(.*)\n/.exec(D)[1],d=/Reference #.*\n.*\n(.*)\n/.exec(D),d&&2===d.length&&(d=d[1]),m=/Seat #.*\n.*\n(.*)\n/.exec(D),m&&2===m.length&&(m=m[1]),p=/Cabin.*\n.*\n(.*)\n/.exec(D),p&&2===p.length&&(p=p[1]),c=C.nextDate(),u=C.nextDate().nextDate(),/Domingo/.test(""+c)&&(c=C.nextDate().nextDate(),u=C.nextDate().nextDate().nextDate()),n.push({airlineName:r,airlineCode:a,flightNumber:i,departureDateTime:c,departureAirport:l,departureAirportCode:s,arrivalDateTime:u,arrivalAirport:h,arrivalAirportCode:g,ticketNumber:o,checkinUrl:A,reservationId:d,reservationStatus:N,totalPrice:v,priceCurrency:x,seatNumber:m,seatType:p})}),n.forEach(function(e){ASSERT(e.departureDateTime,e.arrivalDateTime,e.departureAirportCode,e.arrivalAirportCode);for(var r=0;r<c.length;r++)i.push({"@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.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:c[r]},checkinUrl:e.checkinUrl,reservationId:e.reservationId,reservationStatus:"http://schema.org/Reservation"+e.reservationStatus,totalPrice:e.totalPrice,priceCurrency:e.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:e.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:e.seatNumber,seatingType:e.seatType}},programMembershipUsed:{"@type":"http://schema.org/ProgramMembership",membershipNumber:e.membershipNumber,programName:e.programName}})}),i.length>=1?i:CONTINUE}}).call();