// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,a){function n(e){return e=e.replace(/[^\d\sa-zA-z:\u6642\u5206]+/g," ").replace(/\s+/g," ").replace(/^(\d+)\s(\d+)\s/,"$1/$2/"),e=getFuzzyDate(r.getDetachedSpan(e))}var r=Scanner.fromMessage(e);r.setLocale(t);var o,c,i,p,s,l,m,h,u,g,d,f,C,v,S,y,R,T,P,k,U="Timescar";if(a.confirmSubject.test(e.subject)&&!ASSERT(o,i,k,y,T||R,v||C))return CONTINUE;if(a.cancellationSubject.test(e.subject)){i=r.getSpan().innerCapture(a.cancellationReservationId,1),o=r.getSpan().innerCapture(a.cancellationGuestName,1),T=""+r.getSpan().innerCapture(a.cancellationPickup,1),P=""+r.getSpan().innerCapture(a.cancellationPickupTelephone,1),k=""+r.getSpan().innerCapture(a.cancellationPickupTime,1),k=n(k),v=""+r.getSpan().innerCapture(a.cancellationDropoff,1),S=""+r.getSpan().innerCapture(a.cancellationDropoffTelephone,1),y=""+r.getSpan().innerCapture(a.cancellationDropoffTime,1),y=n(y);var z=r.getSpan().innerCapture(a.cancellationPrice,1);if(h=z.innerCapture(/([\d,.]+)/,1),u=z.innerCapture(/([^\d,.]+)/,1).trim(),!ASSERT(o,i,k,y,T||R,v||C))return CONTINUE;p="Cancelled"}return g?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:u,reservationId:i,reservationStatus:"http://schema.org/Reservation"+(p||"Confirmed"),checkinUrl:s,modifyReservationUrl:l,cancelReservationUrl:m,underName:{"@type":"http://schema.org/Person",name:o,email:c},provider:{"@type":"http://schema.org/Organization",name:U},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:g},license:d,color:f},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:P,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:C,telephone:S,address:v}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:u,reservationId:i,reservationStatus:"http://schema.org/Reservation"+(p||"Confirmed"),checkinUrl:s,modifyReservationUrl:l,cancelReservationUrl:m,underName:{"@type":"http://schema.org/Person",name:o,email:c},provider:{"@type":"http://schema.org/Organization",name:U},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:P,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:C,telephone:S,address:v}}]}}).call();