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