// Copyright 2014 Apple Inc.  All Rights Reserved.
new ReverseTemplateList([new ReverseTemplate("enterprisecarshare.com-en",function(e){return/Enterprise CarShare (?:New|Reconfirmed|Changed)? Reservation Confirmation/.test(e.subject)},function(e){var t=Scanner.fromMessage(e);t.setLocale("en_US");var n,a,r,o,i,s,p,c,d,g,m,h,l,u,S,v,C,y,f,T,x;if(n=t.getSpan().innerCapture(/Dear (.*),/,1),not(n)&&(a=parseEmailListFromMessageHeader(e.headers,"to")[0]),g=t.getSpan().nextText("Vehicle:").nextAnyTag("td").tagContents(),x=t.getSpan().nextText("Start:").nextAnyTag("td").innerDate(),C=t.getSpan().nextText("End:").nextAnyTag("td").innerDate(),valid(x,C)||(l=t.getSpan().innerCapture(/A ($<brand>.*) is reserved for you ($<time>from .* to .*?)\. Your/),r=l?t.getDateDD(l.$time):null,g=l?l.$brand:null,valid(r)&&(x=r.iso8601,C=r.endIso8601)),o=t.getSpan().innerCapture(/Reservation ID: #(\d+)/,1),not(o)&&(o=t.getSpan().nextText("Reservation ID:").nextAnyTag("td").tagContents()),c=t.getSpan().innerCapture(/(?:Total )?Cost:\s+.*?([\d,.]+)\s/,1),not(c)&&(c=t.getSpan().innerCapture(/will be charged to your credit card in the amount of .*?([\d,.]+)/,1)),f=t.getSpan().innerCapture(/Location Details\s+(.*)\s/,1),not(f)&&(f=t.getSpan().innerCapture(/Your vehicle will be ready and waiting for you at the (.*?)\s*\. Don't/,1)),S=f,ASSERT(OR(n,a),g,x))return[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:c,priceCurrency:d,reservationId:o,reservationStatus:"http://schema.org/ReservationConfirmed",checkinUrl:i,modifyReservationUrl:s,cancelReservationUrl:p,underName:{"@type":"http://schema.org/Person",name:n,email:a},provider:{"@type":"http://schema.org/Organization",name:"Enterprise CarShare"},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:g},license:m,color:h},pickupTime:x,pickupLocation:{"@type":"http://schema.org/Place",name:y,telephone:T,address:f},dropoffTime:C,dropoffLocation:{"@type":"http://schema.org/Place",name:u,telephone:v,address:S}}]},"0/1/2/3/4/5/6/118/119","SG148049d9")]);