// Copyright 2014 Apple Inc.  All Rights Reserved.
new ReverseTemplateList([new ReverseTemplate("hostelworld.com-confirmation-en",function(e){return/^Confirmed booking from hostelworld\.com/.test(e.subject)},function(e){if(/^Confirmed booking from hostelworld\.com/.test(e.subject)){var t=Scanner.fromMessage(e);t.setLocale("en_US");var r,n,o,a,i,s,c,m,p,u,d,l,g;if(r=t.getSpan().innerCapture(/\bDear (.*),/,1),s=t.getSpan().innerCapture(/\bYour reference number is ([\d-]+)/,1),n=t.getSpan().nextText("booking information").nextTag("td2").tagContents(),l=n.innerPhoneNumber(),g=n.innerAddress(),p=n.withEnd(l.getStart()).innerCapture(/($<name>.*)\s($<address>[\s\S]+)/),d=p?p.$name:null,not(g)&&(g=p?p.$address.trim():null),c=t.getSpan().nextText("Room Details").nextDate(),m=c.nextDate(),o=t.getSpan().innerCapture(/\bTotal:\s+($<currency>[A-Z]+).*?($<total>[\d,.]+)/),a=o?o.$total:null,i=o?o.$currency:null,ASSERT(c,g))return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:r},totalPrice:a,priceCurrency:i,checkinTime:c,checkoutTime:m,reservationStatus:"http://schema.org/ReservationConfirmed",reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:d,url:u,telephone:l,address:g}}]}},"0/1/2/3/4/5/651/724/725","SG917cd9d4"),new ReverseTemplate("hostelworld.com-reminder-en",function(e){return/^Hostelworld\.com Pre-trip Reminder/.test(e.subject)},function(e){if(/^Hostelworld\.com Pre-trip Reminder/.test(e.subject)){var t=Scanner.fromMessage(e);t.setLocale("en_US");var r,n,o,a,i,s,c,m,p,u,d;if(r=t.getSpan().innerCapture(/\bHi (.*),/,1),n=t.getSpan().nextText("Your booking details").nextTag("table4").allInnerTagsFiltered("td4"),n.length>=6){i=n[0].innerCapture(/\bReservation Number: ([\d-]+)/,1),d=n[1].tagContents(),p=d,s=n[2].innerDate();var l=n[4].innerCapture(/\s($<currency>[A-Z]+).*?($<price>[\d,.]+)/),g=n[5].innerCapture(/\s($<currency>[A-Z]+).*?($<price>[\d,.]+)/);g&&(a=g.$currency,o=g.$price,valid(l,l.$price,o)&&(o=(parseFloat(""+o)+parseFloat(""+l.$price)).toFixed(2)))}if(ASSERT(s,d))return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:r},totalPrice:o,priceCurrency:a,checkinTime:s,checkoutTime:c,reservationStatus:"http://schema.org/ReservationConfirmed",reservationId:i,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:p,url:m,telephone:u,address:d}}]}},"0/1/2/3/4/5/651/724/726","SG41300bb4")]);