// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var n=Scanner.fromMessage(e);n.setLocale(t);var a,s=n.getSpan().innerCapture(regExpFormatted(/\1\s(\d+)/,r.reservationIdPrefix),1),i=n.getSpan().nextText(r.orderDetailsHeader).parentTag("table3"),x=n.getSpan().withInterval(i.nextTag("td6").tagContents().getStart(),i.nextText("<").getStart()).trim();a=n.getSpan().withInterval(i.nextText(">").getEnd(),i.nextText(r.viewMapSuffix).getStart()).trim(),n.getSpan().nextText(r.address).exists()&&(a=n.getSpan().nextText(r.address).parentTag("td2").tagContents().innerCapture(regExpFormatted(/\1\n($<address1>.+)?\n($<address2>.+)?\n($<address3>.+)?\n($<address4>.+)?/,r.address)),a=a.$address1+" "+a.$address2+"  "+a.$address3+" "+a.$address4);var g,p=n.getSpan().innerCapture(regExpFormatted(/<\1(.*?)>/,r.phoneNumberPrefix),1),d=/[\D]{3}\.?\s(\d{1,2})\s([a-z]{3})\s(\d{4})\s(\d{1,2}:\d{2})/,c=function(e,r,n,a,s){return"es_ES"===t&&(n=n.replace(/^may$/,"mayo")),r+" "+n+" "+a+" "+s};if(n.getSpan().nextText(r.checkInPrefix).exists()){g=n.getDetachedSpan((""+n.getSpan().nextText(r.checkInPrefix).nextAnyTag("td").tagContents()).replace(d,c)).innerDate()}else g=n.getDetachedSpan((""+n.getSpan().nextText(r.checkInPrefix_2).parentAnyTag("td").tagContents()).replace(d,c)).innerDate();var o;o=n.getDetachedSpan((""+n.getSpan().nextText(r.checkOutPrefix).nextAnyTag("td").tagContents()).replace(d,c)).innerDate(),(""+o).length<=0&&(o=n.getDetachedSpan((""+n.getSpan().nextText(r.checkOutPrefix).parentAnyTag("td").tagContents()).replace(d,c)).innerDate());var u;u=n.getSpan().nextText(r.guestNamePrefix).exists()?n.getSpan().nextText(r.guestNamePrefix).parentTag("td5").tagContents().innerCapture(regExpFormatted(/\1: (.+)/,r.guestNamePrefix),1).trim():n.getSpan().nextText(r.guestNamePrefix_2).nextTag("td4").tagContents().trim();var f;f=n.getSpan().nextText(r.pricePrefix_2).exists()?n.getSpan().nextText(r.pricePrefix_2).parentTag("td4").tagContents().innerCapture(regExpFormatted(/\1 ($<currency>[^\d]+)?($<price>[\d\.,]+)($<currency_suffix>[^\d]+)?/,r.pricePrefix_2)):n.getSpan().nextText(r.pricePrefix).parentTag("td5").tagContents().innerCapture(regExpFormatted(/\1 ($<currency>[^\d]+)?($<price>[\d\.,]+)($<currency_suffix>[^\d]+)?/,r.pricePrefix));var m;m=f.$currency.exists()?f.$currency.trim():f.$currency_suffix.trim();var S=f.$price;if(ASSERT(u,s,g,o,a))return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:u},totalPrice:S,priceCurrency:m,checkinTime:g,checkoutTime:o,reservationStatus:"http://schema.org/ReservationConfirmed",reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:x,telephone:p,address:a}}]}}).call();