// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){if(!e||!t||!n)return CONTINUE;var r=Scanner.fromMessage(e);r.setLocale(t);var a,s,p,o,i,g,d,h,m,l,u,S;if(p=r.getSpan().nextText(n.person+"\uff1a").collapseToEnd().withEnd(r.getSpan().nextText(n.person).nextText(n.name).getStart()).trim(),l=r.getSpan().innerCapture(regExpFormatted(/\1.(\w+)/,n.number),1),s=r.getSpan().innerCapture(regExpFormatted(/\1.(.+)/,n.restaurant),1).trim(),g=r.getSpan().nextText(n.phone).nextPhoneNumber().innerCapture(/([\d\s-,\.]+)/,1).trim(),d=r.getSpan().innerCapture(n.address,1).innerAddress(),d.exists()||(d=r.getSpan().innerCapture(n.address,1)),a=r.getSpan().innerCapture(regExpFormatted(/\1.(.+)/,n.underName),1),u=r.getSpan().next(n.date),S=r.getSpan().withInterval(u.previousText("\n").getEnd(),u.nextText("\n").getStart()).allInnerDates(),S.length>0){var c,x;S=r.getSpan().withStart(S[0].getStart()).withEnd(S[S.length-1].getEnd()),c=(""+S).replace(/[^\d\sa-zA-z:]+/g," ").replace(/\s+/g," ").replace(/^(\d+)\s(\d+)\s/,"$1/$2/").trim(),x=c.lastIndexOf(" "),c=c.substr(0,x)+":"+c.substr(x+1),i=getFuzzyDate(r.getDetachedSpan(c))}return ASSERT(p,s,a,i)?[{"@context":"http://schema.org","@type":"http://schema.org/FoodEstablishmentReservation",partySize:p,reservationId:l,reservationStatus:"http://schema.org/ReservationCancelled",reservationFor:{"@type":"http://schema.org/FoodEstablishment",name:s,url:o,telephone:g,address:d},startTime:i,bookingAgent:{"@type":"http://schema.org/Organization",name:"Hot Pepper",url:"http://www.hotpepper.jp/"},underName:{"@type":"http://schema.org/Person",name:a},cancelReservationUrl:m,modifyReservationUrl:h}]:CONTINUE}}).call();