(function(){return function(e,t){var r=Scanner.fromMessage(e);r.setLocale(t);var a,n,i,o,p=r.getSpan(),g="Confirmed",l=[],s=[];a=/- (.*)/.exec(e.subject)[1];var m=p.allInnerTags("table2").filter(function(e){return(""+e).indexOf("Flight")>-1});return m.forEach(function(e,t){for(var e=m[t],a=/\((.*)\).*to.*\((.*)\).*\n/.exec(""+e),n=e.getString().match(/SQ\d{1,}/g),i=e.next(n[0]).nextTag("table5"),o=0;o<n.length;o++){var g,s,u,c,h,d,T,v,b,f,y="Singapore Airlines",N="SQ";u=o+1!==n.length?i.next(n[o+1]).previousTag("td4").tagContents():i.nextClosingTag("table4").previousTag("td4").tagContents(),1===n.length?(d=a[1],b=a[2]):d=b=null,g=n[o].match(/\d+/)[0];var A=(""+i.nextAnyTag("td").tagContents()).split("\n");h=A[0],c=A[1].replace(/[\(\)]/g," "),c=getFuzzyDate(r.getDetachedSpan(c).firstDate());var C=(""+i.nextAnyTag("table").nextAnyTag("td").tagContents()).split("\n");v=C[0],T=C[1].replace(/[\(\)]/g," "),T=getFuzzyDate(r.getDetachedSpan(T).firstDate()),f=p.next("Passengers").parentTag("table4").allInnerTags("tr4"),f.shift(),f.forEach(function(e){var t;t=e.nextAnyTag("td").nextAnyTag("td").tagContents(),l.push({airlineName:y,airlineCode:N,flightNumber:g,departureDateTime:c,departureAirport:h,departureAirportCode:d,arrivalDateTime:T,arrivalAirport:v,arrivalAirportCode:b,ticketNumber:s,underPersonName:t,seatType:u})}),i=i.nextTag("table5").nextTag("table5")}}),l.forEach(function(e){ASSERT(e.departureDateTime,e.arrivalDateTime),s.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:e.underPersonName},checkinUrl:o,reservationId:a,reservationStatus:"http://schema.org/Reservation"+g,totalPrice:n,priceCurrency:i,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}})}),s.length>=1?s:CONTINUE}}).call();