(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,l,o,p,g,s,u,m,h,c,d=[],C=[],T=[];for(n=a.getSpan().innerCapture(regExpFormatted(/\1\s+(\w+)/,r.reservationId),1),g=a.getSpan().next(r.passengerDetails).nextTag("table1").allInnerTags("tr1"),p=0;p<g.length;p+=3)u={},u.name=g[p].nextTag("td1").tagContents(),u.ticketNumber=""+g[p].next(r.ticketNumber).nextTag("td1").tagContents(),u.seatInfo=g[p].nextText("Seat").nextAnyTag("td").tagContents().split(";"),0!==(""+u.name).length&&d.push(u);i=a.getSpan().next(r.price).parentAnyTag("td").tagContents().innerCapture(/($<priceCurrency>[A-Z]+)\s($<totalPrice>[\d\.,]+)/),l=i.$totalPrice,o=i.$priceCurrency;var v=a.getSpan().next(r.flightDetails).nextTag("table1");do{var f=v.allInnerTags("tr1");for(p=0;p<f.length;p++)m={},s=f[p].allInnerTags("td1"),s.length>2&&(m.departureTime=s[1].allInnerDates()[0],m.arrivalTime=s[2].allInnerDates()[0],m.departureAirport=s[1].tagContents().innerCapture(/(.*)\n/,1),m.arrivalAirport=s[2].tagContents().innerCapture(/(.*)\n/,1),h=s[0].tagContents().innerCapture(/($<airlineCode>\w{2})($<flightNumber>\d+)/),m.airlineCode=h.$airlineCode,m.flightNumber=h.$flightNumber,m.airlineName=s[0].tagContents().innerCapture(r.airlineName,1),0===(""+m.airlineName).length&&(m.airlineName="WestJet"),ASSERT(m.departureAirport,m.arrivalAirport,m.departureTime,m.arrivalTime,m.airlineCode,m.flightNumber)&&C.push(m));v=v.nextTag("table1")}while(!r.stopLegsGroup.test(""+v.tagContents()));for(c="Confirmed",p=0;p<C.length;p++){m=C[p];for(var N=0;N<d.length;N++){u=d[N];T.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:m.airlineName,airlineCode:m.airlineCode,flightNumber:m.flightNumber,departureAirportFuzzy:m.departureAirport,departureTime:m.departureTime,arrivalAirportFuzzy:m.arrivalAirport,arrivalTime:m.arrivalTime},underName:{"@type":"http://schema.org/Person",name:u.name},checkinUrl:null,reservationId:n,reservationStatus:"http://schema.org/Reservation"+c,totalPrice:l,priceCurrency:o,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:u.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:u.seatInfo[p].innerCapture(/.*:\s([A-Z0-9-]*)/,1)}}})}}if(T.length)return T}}).call();