// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t){var n={};n.name="Guest Name:",n.reservationId="United Airlines Itinerary Number:",n.hotelName="Hotel",n.hotelAddress="Address:",n.hotelPhone="Telephone:",n.checkInDateTime="Check-in:";var a,r,o,s,i,c,g,h,d,m,l,p,u=Scanner.fromMessage(e);if(u.setLocale(t),a=u.getSpan().next(n.name).nextAnyTag("td").tagContents(),s=u.getSpan().next(n.reservationId).nextAnyTag("td").tagContents(),d=u.getSpan().next(n.hotelName).nextAnyTag("td").nextAnyTag("td").tagContents().innerCapture(/([^\[\]]*)/,1).trim(),l=u.getSpan().next(n.hotelAddress).nextAnyTag("td").tagContents().innerAddress(),m=u.getSpan().next(n.hotelPhone).nextAnyTag().innerPhoneNumber(),c=u.getSpan().next(n.checkInDateTime).nextDate(),g=c.nextDate(),/Cancellation/.test(e.subject)&&(i="Cancelled"),ASSERT(a,c,g))return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:a},totalPrice:r,priceCurrency:o,checkinTime:c,checkoutTime:g,modifyReservationUrl:p,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:d,url:h,telephone:m,address:l}}]}}).call();