// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,p,s,o,g,d,m,u,l,h,c,T,C,v,x,b,y,N,f,S=[],A={};u="air busan",m=a.getSpan(),g=m.next(r.reservationId_prefix).nextTag("td3"),i=g.tagContents(),g=m.next(r.fromPerson).nextTag("tr3").nextTag("tr3"),s=g.nextTag("td3").tagContents(),g=g.nextTag("td3").nextTag("td3"),n=g.tagContents().innerCapture(/([\d]+)\s*/,1),g=m.next(r.totalPrice),y=g.innerCapture(/([,\d]+)(.*)/,2),b=g.innerCapture(/([,\d]+)(.*)/,1);var z=m.next(r.flightSummary).nextTag("table3");g=z.nextTag("tr3").nextTag("tr3");do o=g.nextTag("td3").tagContents().innerCapture(/([\d-]+)\s*(\(.*\))/,1),c=g.nextTag("td3").nextTag("td3").tagContents(),x=c.innerCapture(/\s*(.*)\s.*\s(.*)/),c=x[1],T=null,v=x[2],x=null,g=g.nextTag("td3").nextTag("td3").nextTag("td3"),f=g.tagContents(),f=f.innerCapture(/(\d+\:\d+).*?(\d+\:\d+)/),h=o+" "+f[1],h=getFuzzyDate(a.getDetachedSpan(h).firstDate()),C=o+" "+f[2],C=a.getDetachedSpan(C).innerDate(),d=g.nextTag("td3").tagContents(),l=d.innerCapture(/\s*([A-z]+)(\d+)/,1),d=d.innerCapture(/\s*([A-z]+)(\d+)/,2),ASSERT(l,d,c,h,v,C)&&S.push({reservationId:i,airlineName:u,airlineCode:l,flightNumber:d,departureAirport:c,departureCode:T,departureTime:h,arrivalAirport:v,arrivalCode:x,arrivalTime:C,passengers:A}),g=g.nextTag("tr3");while(g.nextTag("td3").tagContents().innerCapture(/^(\d+)\s*/,1)!=a.getNullSpan());ASSERT(s)&&(A[""+s]={name:s,seats:{},seatingType:N,ticketNumber:null,totalPrice:b,priceCurrency:y});for(var k=[],F=0;F<S.length;F++)for(var P=S[F],D=Object.keys(P.passengers),I=0;I<D.length;I++){var R=P.passengers[D[I]],M={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:P.airlineName,airlineCode:P.airlineCode,flightNumber:P.flightNumber,departureAirportFuzzy:P.departureAirport,departureAirportCode:P.departureCode,departureTime:P.departureTime,arrivalAirportFuzzy:P.arrivalAirport,arrivalAirportCode:P.arrivalCode,arrivalTime:P.arrivalTime},underName:{"@type":"http://schema.org/Person",name:R.name},checkinUrl:p,reservationId:P.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:R.totalPrice,priceCurrency:R.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:n,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:R.seats[P.flightNumber],seatingType:R.seatingType}}};valid(R.membershipNumber,R.programName)&&(M.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:R.membershipNumber,programName:R.programName}),k.push(M)}if(k.length)return k}}).call();