(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);for(var n=a.getSpan().nextText(t.travelHeader).nextTag("table3"),i=n.allInnerTags("tr3"),o=[],p=0;p<i.length;p++)for(var l=i[p].allInnerTags("table5"),s=0;s<l.length;s++)(""+l[s]).match(t.flightCheck)&&o.push(l[s]);for(var g=[],s=0;s<o.length;s++){var h=o[s].allInnerTags("td5"),d=h[0].tagContents().innerDate();(""+d).length<7&&(d=combineDateAndTime(d.nextDate(),d));var v=h[1].tagContents().innerCapture(/($<departureAirportName>.+)\s?\(($<departureAirportCode>.+?)\)/),m=v.$departureAirportName.trim(),u=v.$departureAirportCode,C=h[2].tagContents().innerCapture(/($<airline>.+?)\s?\n?($<airlineCode>[A-Z]{2})\s($<flightNum>\d+)/),c=C.$airline,T=C.$airlineCode,A=C.$flightNum,x=h[4].tagContents().innerDate();(""+x).length<7&&(x=combineDateAndTime(x.nextDate(),x));var N=h[5].tagContents().innerCapture(/($<arrivalAirportName>.+)\s?\(($<arrivalAirportCode>.+?)\)/),f=N.$arrivalAirportName.trim(),k=N.$arrivalAirportCode,$=h[7].tagContents().innerCapture(/\-\s(.+)/,1);ASSERT(m,f,d,x)&&g.push({departureDate:d,arrivalDate:x,arrivalAirportCode:k,departureAirportCode:u,departureAirport:m,arrivalAirport:f,airlineName:c,airlineCode:T,flightNumber:A,seatingType:$})}t.reservationCheck=RegExp(t.reservationCheck+"|"+g[0].airlineName);for(var b=[],y=a.getSpan().nextText(t.reservationIdPrefix).nextTag("table3"),D=y.innerRegExp(t.reservationCheck),p=0;p<g.length;p++){var s=p+1;s===g.length&&(s=g.length-1),t.reservationCheck=(""+t.reservationCheck).replace(/\//g,""),t.reservationCheck=RegExp(t.reservationCheck+"|"+g[s].airlineName);var S=D.nextRegExp(/[A-Z0-9]{6}/);(0===(""+S).length||(""+S.parentAnyTag("td").tagContents()).length>6)&&(S=b[p-1]),b.push(S),D=y.innerText(S).nextRegExp(t.reservationCheck)}var E,F,I,R=a.getSpan().nextText(t.passengerNamePrefix).nextText(t.passengerHeader).nextTag("table2"),z=R.allInnerTags("tr2"),P=[];if((""+R).match(/ETKT/))for(var p=0;p<z.length/2;p++)E=z[2*p].allInnerTagsFiltered("td2"),F=E[0],I=z[2*p+1].innerCapture(/ETKT\s(\d+)/,1),P.push({passengerName:F,ticketNumber:I});else for(var p=0;p<z.length;p++)E=z[p].allInnerTagsFiltered("td2"),F=E[0],P.push({passengerName:F,ticketNumber:I});for(var H=[],p=0;p<g.length;p++)for(var K=g[p],s=0;s<P.length;s++){var Z=P[s];H.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:K.airlineName,airlineCode:K.airlineCode,flightNumber:K.flightNumber,departureAirportFuzzy:K.departureAirport,departureTime:K.departureDate,departureAirportCode:K.departureAirportCode,arrivalAirportFuzzy:K.arrivalAirport,arrivalTime:K.arrivalDate,arrivalAirportCode:K.arrivalAirportCode},underName:{"@type":"http://schema.org/Person",name:Z.passengerName},reservationId:b[p],reservationStatus:"http://schema.org/ReservationConfirmed",reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:Z.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:K.seatingType}}})}if(H.length)return H}}).call();