// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var r=Scanner.fromMessage(e);r.setLocale(t);var a,o,p,i,c,s,g,m,h,u,d,l,f,C,v,x,S,R,y,L;if(n.confirmSubject.test(e.subject)){a=r.getSpan().nextRegExp(n.guestName).tagContents().innerCapture(n.guestName,1),p=r.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1),L=r.getSpan().nextRegExp(n.dates).nextDate(),x=r.getDetachedSpan(""+L.next(n.dropoffDate).innerCapture(n.dropoffDate,1)).innerDate(),R=r.getSpan().nextRegExp(n.pickupLoc).tagContents().innerCapture(n.pickupLoc,1),C=r.getSpan().nextRegExp(n.dropoffLoc).tagContents().innerCapture(n.dropoffLoc,1),y=r.getSpan().next(n.pickupLoc).nextPhoneNumber().innerCapture(/[^\d\+]*(.*)/,1),v=r.getSpan().next(n.dropoffLoc).nextPhoneNumber().innerCapture(/[^\d\+]*(.*)/,1),u=r.getSpan().nextRegExp(n.car).tagContents().innerCapture(n.car,1),g=s=r.getSpan().innerLink();var E=r.getSpan().nextRegExp(n.price).tagContents().innerCapture(n.price,1);if(m=E.innerCapture(/([\d,.]+)/,1),h=E.innerCapture(/([^\d,.]+)/,1).trim(),!ASSERT(a,p,L,x,R,C))return CONTINUE}if(n.cancellationSubject.test(e.subject)){if(!ASSERT(a,p))return CONTINUE;i="Cancelled"}return u?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:h,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:c,modifyReservationUrl:s,cancelReservationUrl:g,underName:{"@type":"http://schema.org/Person",name:a,email:o},provider:{"@type":"http://schema.org/Organization",name:"Avis"},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:u},license:d,color:l},pickupTime:L,pickupLocation:{"@type":"http://schema.org/Place",name:S,telephone:y,address:R},dropoffTime:x,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:v,address:C}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:h,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:c,modifyReservationUrl:s,cancelReservationUrl:g,underName:{"@type":"http://schema.org/Person",name:a,email:o},provider:{"@type":"http://schema.org/Organization",name:"Avis"},pickupTime:L,pickupLocation:{"@type":"http://schema.org/Place",name:S,telephone:y,address:R},dropoffTime:x,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:v,address:C}}]}}).call();