// Copyright 2014 Apple Inc.  All Rights Reserved.
new ReverseTemplateList([new ReverseTemplate("airchina-confirmation-zh",function(e){return/\u9884\u5b9a\u786e\u8ba4/.test(e.subject)},function(e){if(!/\u9884\u5b9a\u786e\u8ba4/.test(e.subject))return CONTINUE;var t=Scanner.fromMessage(e);t.setLocale("zh_Hans_CN");for(var r=[],a=t.getSpan().nextText("\u8ba2\u5355\u53f7").nextTag("td2").tagContents(),n=t.getSpan().nextText("\u822a\u7a0b\u8d39\u7528\u660e\u7ec6").nextTag("table1").allInnerTagsFiltered("td1")[5],i=t.getSpan().innerCapture(/\u822a\u7a0b\u8d39\u7528\u660e\u7ec6\uff08\u5355\u4f4d\uff1a(.*)\uff09/,1),p=t.getSpan().nextText("\u4e58\u5ba2\u4fe1\u606f").nextTag("table1").allInnerTagsFiltered("td1"),l=0;l<p.length/11;l++){var s=11*l,o=p[s+0],g=p[s+6],m=t.getSpan().nextText("\u53bb\u7a0b\u822a\u6bb5").nextTag("table1").allInnerTagsFiltered("td1");""+t.getSpan().nextText("\u56de\u7a0b\u822a\u6bb5")!=""&&m.push.apply(m,t.getSpan().nextText("\u56de\u7a0b\u822a\u6bb5").nextTag("table1").allInnerTagsFiltered("td1"));for(var c=0;c<m.length/5;c++){var T,h,d,u=5*c,x=m[u+0].split(","),v=x[0].trim(),S=combineDateAndTime(x[2].trim(),x[3].trim()),b=m[u+1].split(","),y=b[0].trim(),F=combineDateAndTime(b[2].trim(),b[3].trim());if([,T,h,d]=m[u+2].innerCapture(/(\w{2}).*?(\d+).*\n(.*)/),ASSERT(a,p,x,b,T,h,d)){var f={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:d,airlineCode:T,flightNumber:h,departureAirportFuzzy:v,departureTime:S,arrivalAirportFuzzy:y,arrivalTime:F},underName:{"@type":"http://schema.org/Person",name:o},reservationId:a,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:g,ticketedSeat:{"@type":"http://schema.org/Seat"}},totalPrice:n,priceCurrency:i,reservationStatus:"http://schema.org/ReservationConfirmed"};r.push(f)}}}return r.length?r:void 0},"0/1/2/3/4/5/240/300/301","SGb632d1a8"),new ReverseTemplate("airchina-pending-zh",function(e){return/\u9884\u5b9a\u5c1a\u672a\u5b8c\u6210/.test(e.subject)},function(e){if(!/\u9884\u5b9a\u5c1a\u672a\u5b8c\u6210/.test(e.subject))return CONTINUE;var t=Scanner.fromMessage(e);t.setLocale("zh_Hans_CN");for(var r=[],a=t.getSpan().nextText("\u8ba2\u5355\u53f7").nextTag("td2").tagContents(),n=t.getSpan().nextText("\u822a\u7a0b\u8d39\u7528\u660e\u7ec6").nextTag("table1").allInnerTagsFiltered("td1")[5],i=t.getSpan().innerCapture(/\u822a\u7a0b\u8d39\u7528\u660e\u7ec6\uff08\u5355\u4f4d\uff1a(.*)\uff09/,1),p=t.getSpan().nextText("\u4e58\u5ba2\u4fe1\u606f").nextTag("table1").allInnerTagsFiltered("td1"),l=0;l<p.length/11;l++){var s=11*l,o=p[s+0],g=p[s+6],m=t.getSpan().nextText("\u53bb\u7a0b\u822a\u6bb5").nextTag("table1").allInnerTagsFiltered("td1");""+t.getSpan().nextText("\u56de\u7a0b\u822a\u6bb5")!=""&&m.push.apply(m,t.getSpan().nextText("\u56de\u7a0b\u822a\u6bb5").nextTag("table1").allInnerTagsFiltered("td1"));for(var c=0;c<m.length/5;c++){var T,h,d,u=5*c,x=m[u+0].split(","),v=x[0].trim(),S=combineDateAndTime(x[2].trim(),x[3].trim()),b=m[u+1].split(","),y=b[0].trim(),F=combineDateAndTime(b[2].trim(),b[3].trim());if([,T,h,d]=m[u+2].innerCapture(/(\w{2}).*?(\d+).*\n(.*)/),ASSERT(a,p,x,b,T,h,d)){var f={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:d,airlineCode:T,flightNumber:h,departureAirportFuzzy:v,departureTime:S,arrivalAirportFuzzy:y,arrivalTime:F},underName:{"@type":"http://schema.org/Person",name:o},reservationId:a,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:g,ticketedSeat:{"@type":"http://schema.org/Seat"}},totalPrice:n,priceCurrency:i,reservationStatus:"http://schema.org/ReservationConfirmed"};r.push(f)}}}return r.length?r:void 0},"0/1/2/3/4/5/240/300/302","SGd6a0cb9b")]);