// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t,a){if(int(e.epoch)<=1443052800)return CONTINUE;var i=Scanner.fromMessage(e);i.setLocale(r);var n,p,o,s,m,g,u=i.getSpan(),d=[],l=[];n=u.next(t.reservationId_prefix).nextAnyTag("table").nextAnyTag("td").tagContents(),o=u.next(t.price_prefix).nextAnyTag("td").tagContents(),p=u.next(t.price_prefix).nextAnyTag("td").nextAnyTag("td").tagContents(),s=u.next(t.checkinUrl_prefix).nextLink();var c=u.allInnerTags("tr3").filter(function(e){var r=""+e.tagContents();return 0!==r.length&&(r.indexOf("Depart ")>-1||r.indexOf("Arrive in")>-1)});return c.forEach(function(e){var r,a,n,p,o,s,l,c,h,v,A,N,T,x="Southwest Airlines",C="WN";e=e.allInnerTags("td3"),""+e[0].tagContents()!=""&&(m=g=e[0].tagContents()),r=e[1].tagContents();var f;f=e[e.length-1],n=/(?:Depart|Change planes.*in)\s(.*)\s\((.*)\).*at\s(.*)/.exec(""+f),s=n[1],l=n[2],p=n[3],c=/Arrive in\s(.*)\s\((.*)\)\s.*at\s(.*)\s\s\n/.exec(""+f),A=c[1],N=c[2],h=c[3],o=getFuzzyDate(i.getDetachedSpan(m+" "+p).firstDate()),v=getFuzzyDate(i.getDetachedSpan(g+" "+h).firstDate()),T=u.next(t.passengers_prefix).nextAnyTag("table").nextAnyTag("td").nextAnyTag("td").tagContents();var y,b="Rapid Rewards";d.push({airlineName:x,airlineCode:C,flightNumber:r,departureDateTime:o,departureAirport:s,departureAirportCode:l,arrivalDateTime:v,arrivalAirport:A,arrivalAirportCode:N,ticketNumber:a,underPersonName:T,programName:b,membershipNumber:y})}),d.forEach(function(e){ASSERT(e.departureDateTime,e.arrivalDateTime,e.departureAirportCode,e.arrivalAirportCode),l.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:s,reservationId:n,reservationStatus:"http://schema.org/Reservation"+a,totalPrice:p,priceCurrency:o,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}})}),l.length>=1?l:CONTINUE}}).call();