// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){function r(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,o,c,i,s,g,u,m,h,l,d,C,f,v,R,S,x,y,E,k;p=a.getSpan().nextRegExp(n.guestName).tagContents().innerCapture(n.guestName,1),c=a.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1),k=""+a.getSpan().nextRegExp(n.pickupDate).tagContents().innerCapture(n.pickupDate,1),k=r(k),S=""+a.getSpan().nextRegExp(n.dropoffDate).tagContents().innerCapture(n.dropoffDate,1),S=r(S);var L=a.getSpan().nextRegExp(n.pickupLoc).tagContents().innerCapture(n.pickupLoc,1);y=""+L.innerCapture(/(.+)\(/,1),E=""+L.innerCapture(/.+\((.+)\)/,1);var N=a.getSpan().nextRegExp(n.dropoffLoc).tagContents().innerCapture(n.dropoffLoc,1);v=""+N.innerCapture(/(.+)\(/,1),R=""+N.innerCapture(/.+\((.+)\)/,1),l=a.getSpan().nextRegExp(n.car).tagContents().innerCapture(n.car,1);var P=a.getSpan().nextRegExp(n.price).tagContents().innerCapture(n.price,1);if(m=P.innerCapture(/([\d,.]+)/,1),h=P.innerCapture(/([^\d,.]+)/,1),n.confirmSubject.test(e.subject)){if(!ASSERT(p,c,k,S,y,v))return CONTINUE;i="Confirmed"}if(n.cancellationSubject.test(e.subject)){if(y=a.getSpan().innerCapture(n.cancelPickupLoc,1),v=a.getSpan().innerCapture(n.cancelDropoffLoc,1),!ASSERT(p,c,k,S,y,v))return CONTINUE;i="Cancelled"}return 0===(""+l).length||null===l?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:h,reservationId:c,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:s,modifyReservationUrl:g,cancelReservationUrl:u,underName:{"@type":"http://schema.org/Person",name:p,email:o},provider:{"@type":"http://schema.org/Organization",name:"Nippon"},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:x,telephone:E,address:y},dropoffTime:S,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:R,address:v}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:m,priceCurrency:h,reservationId:c,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:s,modifyReservationUrl:g,cancelReservationUrl:u,underName:{"@type":"http://schema.org/Person",name:p,email:o},provider:{"@type":"http://schema.org/Organization",name:"Nippon"},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:l},license:d,color:C},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:x,telephone:E,address:y},dropoffTime:S,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:R,address:v}}]}}).call();