(function(){return function(e,t,r){function a(){return{reservationId:null,reservationStatus:null,totalPrice:null,priceCurrency:null}}function n(){return{checkinUrl:null,airlineCode:null,airlineName:null,flightNumber:null,departureAirportFuzzy:null,departureAirportCode:null,departureTime:null,arrivalAirportFuzzy:null,arrivalAirportCode:null,arrivalTime:null,seatingType:null}}function i(){return{name:null,email:null,telephone:null,membershipNumber:null,programName:null,ticketNumber:null}}function l(){return{seatNumber:null,seatingType:null}}function u(e){return e.tagContents().innerCapture(/.*, .* \((.*)\),[\s]?.*/,1)}function g(e){return e.tagContents().innerCapture(/(.*) \(.*\),[\s]?.*/,1).trim()}var p=a(),o=[],T=[],s=[],m=Scanner.fromMessage(e),d=[];m.setLocale(t);var x=m.getSpan().nextText(r.travelTableTitle).nextTag("table4").nextText(r.flightTableTitle).parentTag("td5");if(x.isNullSpan_&&(x=m.getSpan().nextText(r.travelTableTitle).nextTag("table4").nextTag("td5")),x.isNullSpan_)var x=m.getSpan().nextText(r.travelAlt).nextTag("table4").nextText(r.flightAlt).parentTag("td5");for(var v=x.nextText(r.paymentTableTitle),c=v.nextText(r.passengerTableTitle).nextTag("table5"),b=c.nextTag("td6");b!==m.getNullSpan()&&c.contains(b);){var h=i();h.name=b.tagContents();if(""===""+b.nextTag("td6").nextTag("td6").tagContents())b=b.nextTag("td6"),T.push(h);else{b=b.nextTag("td6").nextTag("td6");var C=b.innerCapture(RegExp(r.membershipLabel+"\\s*([A-Za-z ]*)\\s+([0-9]*)"));C&&null!==C[2]&&(h.membershipNumber=C[2].tagContents()),C&&null!==C[1]&&(h.programName=C[1].tagContents()),h.ticketNumber=b.innerCapture(regExpFormatted(/\s*\:\s*([\d|\s]+)/,r.ticketNumberLabel),1).trim(),T.push(h),r.extraPassengerSpacing&&(b=b.nextTag("table6").nextTag("table6").nextTag("table6").nextTag("table6").nextTag("td6").nextTag("td6").nextTag("td6")),b=b.nextTag("td6")}}var N=c.nextText(r.preferencesTableTitle).nextTag("table5");p.totalPrice=m.getSpan().nextTag("table4").nextText(r.ticketPriceLabel).nextTag("td6").tagContents(),p.priceCurrency=p.totalPrice.nextTag("td6").tagContents(),p.reservationId=m.getSpan().next(r.reservationIdLabel).parentAnyTag("td").tagContents().innerCapture(/:\s*?([A-Z\d]+)/,1),p.reservationStatus="http://schema.org/ReservationConfirmed";var y,f,A,z,S;for(y=x.nextTag("table6");y!==m.getNullSpan()&&x.contains(y);){var F=n();S=y.previousDate(),f=y.nextTag("td6"),z=f.tagContents().innerCapture(/($<airlineCode>.{2})($<flightNumber>.*)\s+-\s+($<seatingType>.*)/),z&&(F.airlineCode=z.$airlineCode,F.flightNumber=z.$flightNumber,F.seatingType=z.$seatingType);var k=f.nextTag("td6").nextDate();F.departureTime=getFuzzyDate(m.getDetachedSpan(S+" "+k));var D=k.nextTag("td6");F.departureAirportCode=u(D),F.departureAirportFuzzy=g(D);var P=D.nextTag("td6").nextTag("td6").nextTag("td6").nextTag("td6").nextTag("td6").nextDate();F.arrivalTime=getFuzzyDate(m.getDetachedSpan(S+" "+P)),unSpanDate_(F.departureTime)>unSpanDate_(F.arrivalTime)&&(F.arrivalTime=modifyDate(F.arrivalTime,1));var I=P.nextTag("td6");F.arrivalAirportCode=u(I),F.arrivalAirportFuzzy=g(I),ASSERT(F.airlineCode,F.flightNumber,F.arrivalTime,F.arrivalAirportCode,F.departureTime,F.departureAirportCode)&&o.push(F),y=y.nextTag("table6").nextTag("table6")}var $,L,R=N;for(L=0;L<T.length;L++){R=R.nextTag("tr6");var E=[];for($=0;$<o.length;$++){var U=l();R=R.nextTag("tr6");var _=R.nextTag("td6").nextTag("td6").nextTag("td6").nextTag("td6").tagContents();""+_!="-"&&(U.seatNumber=_),E.push(U)}s.push(E),R=R.nextTag("tr6").nextTag("tr6")}for($=0;$<o.length;$++){var F=o[$];for(L=0;L<T.length;L++){var M=T[L],A={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:F.airlineCode,airlineName:F.airlineName,flightNumber:F.flightNumber,departureAirportFuzzy:F.departureAirportFuzzy,departureAirportCode:F.departureAirportCode,departureTime:F.departureTime,arrivalAirportFuzzy:F.arrivalAirportFuzzy,arrivalAirportCode:F.arrivalAirportCode,arrivalTime:F.arrivalTime},underName:{"@type":"http://schema.org/Person",name:M.name},checkinUrl:"",reservationId:p.reservationId,reservationStatus:p.reservationStatus,totalPrice:p.totalPrice,priceCurrency:p.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:M.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:s[L][$].seatNumber,seatingType:F.seatingType}}};valid(OR(M.membershipNumber,M.programName))&&(A.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:M.membershipNumber,programName:M.programName}),d.push(A)}}return d.length?d:CONTINUE}}).call();