// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){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(a.getDetachedSpan(e))}var a=Scanner.fromMessage(e);a.setLocale(t);var p,i,o,c,s,l,u,m,g,h,d,C,S,f,v,y,R,k,P,T,U="Skyrent";o=a.getSpan().innerCapture(r.reservationId,1),p=a.getSpan().innerCapture(r.guestName,1),i=a.getSpan().innerCapture(r.guestEmail,1),u=l=""+a.getSpan().innerCapture(r.modifyUrl,1);var N=a.getSpan().innerCapture(r.price,1);if(m=N.innerCapture(/([\d,.]+)/,1),g=N.innerCapture(/([^\d,.]+)/,1).trim(),T=""+a.getSpan().innerCapture(r.pickup,1),T=n(T),k=""+a.getSpan().innerCapture(r.pickup,2),y=""+a.getSpan().innerCapture(r.dropoff,1),y=n(y),f=""+a.getSpan().innerCapture(r.dropoff,2),h=""+a.getSpan().innerCapture(r.car,1),r.confirmSubject.test(e.subject)&&(P=""+a.getSpan().innerCapture(r.pickupTelephone,2),!ASSERT(p,o,T,y,OR(k,R),OR(f,S))))return CONTINUE;if(r.cancellationSubject.test(e.subject)){o=a.getSpan().innerCapture(r.cancellationReservationId,1),p=a.getSpan().innerCapture(r.cancellationGuestName,1),i=a.getSpan().innerCapture(r.cancellationGuestEmail,1),T=""+a.getSpan().innerCapture(r.cancellationPickup,1),T=n(T),y=""+a.getSpan().innerCapture(r.cancellationDropoff,1),y=n(y);var N=a.getSpan().innerCapture(r.cancellationPrice,1);if(m=N.innerCapture(/([\d,.]+)/,1),g=N.innerCapture(/([^\d,.]+)/,1).trim(),!ASSERT(p,o,T,y))return CONTINUE;c="Cancelled"}return 0===(""+h).length||null===h?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:g,reservationId:o,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:s,modifyReservationUrl:l,cancelReservationUrl:u,underName:{"@type":"http://schema.org/Person",name:p,email:i},provider:{"@type":"http://schema.org/Organization",name:U},pickupTime:T,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:P,address:k},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:S,telephone:v,address:f}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:g,reservationId:o,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:s,modifyReservationUrl:l,cancelReservationUrl:u,underName:{"@type":"http://schema.org/Person",name:p,email:i},provider:{"@type":"http://schema.org/Organization",name:U},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:h},license:d,color:C},pickupTime:T,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:P,address:k},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:S,telephone:v,address:f}}]}}).call();