window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.webcore=window.eviivo.webcore?window.eviivo.webcore:{};window.eviivo.webcore.formatting=window.eviivo.webcore.formatting?window.eviivo.webcore.formatting:{};window.eviivo.webcore.formatting.datetime=function(){function u(n,i){return t(n,i,"long")}function f(n,i){return t(n,i,"short")}function e(t,i){return n(t,i,"long")}function o(t,i){return n(t,i,"medium")}function s(t,i){return n(t,i,"short")}function h(i,r){return n(i,r,"long")+" "+t(i,r,"short")}function c(i,r){return n(i,r,"long")+" "+t(i,r,"long")}function l(i,r){return t(i,r,"short")+" "+n(i,r,"long")}function a(i,r){return n(i,r,"medium")+" "+t(i,r,"short")}function v(i,r){return t(i,r,"short")+" "+n(i,r,"medium")}function y(i,r){return n(i,r,"short")+" "+t(i,r,"short")}function p(i,r){return t(i,r,"short")+" "+n(i,r,"short")}function w(t){return n(t,"iso8601","short")}function b(i){return n(i,"iso8601","short")+"T"+t(i,"iso8601","short")}function k(t){return n(t,"iso8601","long")}function d(i){return n(i,"iso8601","long")+"T"+t(i,"iso8601","long")}function g(n){return t(n,"iso8601","short")}function nt(n){return it(n.toLowerCase())}function tt(n,t){return rt(n.toLowerCase(),t)}function it(n){var t=window.eviivo.webcore.formatting.regionals[n];return t==null&&(t=window.eviivo.webcore.formatting.regionals["default"]),t.firstDayCalendarOffset}function rt(n,t){var i=window.eviivo.webcore.formatting.regionals[n];return i==null&&(i=window.eviivo.webcore.formatting.regionals["default"]),t==="long"?i.jQDateFormat.long:t==="short"?i.jQDateFormat.short:i.jQDateFormat.medium}function n(n,t,u){var e;if(n==null)return null;if(t==null||t=="")throw r+": please specify the 'culture' code parameter";if(t=t.toLowerCase(),n instanceof Date){e=window.eviivo.webcore.formatting.regionals[t];e==null&&(e=window.eviivo.webcore.formatting.regionals["default"]);var f=e.dateFormat[u].slice(0),s=n.getDate(),h=n.getDay(),c=new RegExp("([\\w\\d ]+[ \\.\\-/,])(d{1})([ \\.\\-/,]+)([\\w\\d \\.\\-/,]+)"),l=new RegExp("[^yYdDmM \\.\\-/,](d{1})([ \\.\\-/,]+)([yYdDmM \\.\\-/,]+)");c.test(f)?f=f.replace(c,"$1"+s+"$3$4"):l.test(f)&&(f=f.replace(l,s+"$2$3"));e.dayNames!=null&&(f=f.replace("dddd",e.dayNames.long[h]),f=f.replace("ddd",e.dayNames.medium[h]),f=f.replace("DD",e.dayNames.short[h]));f=f.replace("dd",i(s));var o=n.getMonth(),a=new RegExp("([\\w\\d ]+[ \\.\\-/,])(M{1})([ \\.\\-/,]+)([\\w\\d \\.\\-/,]+)"),v=new RegExp("[^yYdDmM \\.\\-/,](M{1})([ \\.\\-/,]+)([yYdDmM \\.\\-/,]+)");return a.test(f)?f=f.replace(a,"$1"+o+"$3$4"):v.test(f)&&(f=f.replace(v,o+"$2$3")),e.monthNames!=null&&(f=f.replace("MMMM",e.monthNames.long[o]),f=f.replace("MMM",e.monthNames.medium[o])),f=f.replace("MM",i(o+1)),f=f.replace("yyyy",n.getFullYear()),f.replace("yy",n.getFullYear().toString().substring(2))}return n.toLocaleString()}function t(n,t,u){var s,f,o,e,h;if(n==null)return null;if(t==null||t=="")throw r+": please specify the 'culture' code parameter";return t=t.toLowerCase(),n instanceof Date?(s=window.eviivo.webcore.formatting.regionals[t],s==null&&(s=window.eviivo.webcore.formatting.regionals["default"]),f=s.clockFormat[u].slice(0),o=s.clockFormat.mode,o==null&&(o=24),f.indexOf("tt")<0&&f.indexOf("t")>-1&&(f=f.replace("t",o==24?"hh:mm":"h:mm tt")),f.indexOf("tt")<0&&f.indexOf("T")>-1&&(f=f.replace("T",o==24?"hh:mm:ss":"h:mm:ss tt")),e=n.getHours(),o==12&&(h=e>=12?"PM":"AM",f=f.replace("tt",h),e=e%12,e=e?e:12),f=f.replace("hh:",i(e)+":"),f=f.replace("h:",e+":"),f=f.replace(":mm",":"+i(n.getMinutes())),f.replace(":ss",":"+i(n.getSeconds()))):n.toLocaleString()}function i(n){return n<10?"0"+n:n}var r="eviivo.webcore.formatting.datetime";return{evDisplayLongTime:u,evDisplayShortTime:f,evDisplayLongDate:e,evDisplayMediumDate:o,evDisplayShortDate:s,evDisplayLongDateTime:h,evDisplayExtraLongDateTime:c,evDisplayMediumDateTime:a,evDisplayShortDateTime:y,evDisplayLongTimeDate:l,evDisplayMediumTimeDate:v,evDisplayShortTimeDate:p,evStandard24HourTime:g,evStandardIso8601Date:w,evStandardIso8601DateTimeUtc:b,evStandardIso8601DateExtended:k,evStandardIso8601DateTimeUtcExtended:d,evStandardFirstDayCalendarOffset:nt,evGetDateDisplayFormat:tt}}();Date.prototype.evGetDateDisplayFormat=function(n,t){return eviivo.webcore.formatting.datetime.evGetDateDisplayFormat(n,t)};Date.prototype.evStandardFirstDayCalendarOffset=function(n){return eviivo.webcore.formatting.datetime.evStandardFirstDayCalendarOffset(n)};Date.prototype.evDisplayLongTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongTime(this,n)};Date.prototype.evDisplayShortTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortTime(this,n)};Date.prototype.evDisplayLongDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongDate(this,n)};Date.prototype.evDisplayMediumDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumDate(this,n)};Date.prototype.evDisplayShortDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortDate(this,n)};Date.prototype.evDisplayLongDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongDateTime(this,n)};Date.prototype.evDisplayExtraLongDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayExtraLongDateTime(this,n)};Date.prototype.evDisplayMediumDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumDateTime(this,n)};Date.prototype.evDisplayShortDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortDateTime(this,n)};Date.prototype.evDisplayLongTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongTimeDate(this,n)};Date.prototype.evDisplayMediumTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumTimeDate(this,n)};Date.prototype.evDisplayShortTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortTimeDate(this,n)};Date.prototype.evStandardIso8601Date=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601Date(this)};Date.prototype.evStandardIso8601DateTimeUtc=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateTimeUtc(this)};Date.prototype.evStandardIso8601DateExtended=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateExtended(this)};Date.prototype.evStandardIso8601DateTimeUtcExtended=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateTimeUtcExtended(this)};Date.prototype.evStandard24HourTime=function(){return eviivo.webcore.formatting.datetime.evStandard24HourTime(this)};window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.webcore.formatting=window.eviivo.webcore.formatting?window.eviivo.webcore.formatting:{};window.eviivo.webcore.formatting.regionals=window.eviivo.webcore.formatting.regionals?window.eviivo.webcore.formatting.regionals:{};window.eviivo.webcore.formatting.regionals.iso8601={monthNames:null,dayNames:null,dateFormat:{long:"yyyy-MM-dd",medium:null,short:"yyyyMMdd"},jQDateFormat:{long:"yy-mm-dd",medium:null,short:"yymmdd"},clockFormat:{mode:24,long:"hh:mm:ss",short:"hhmmss"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["default"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["en-gb"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["en-us"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd MMM d, yyyy",medium:"MMM d, yyyy",short:"M/d/yy"},jQDateFormat:{long:"D M d, yy",medium:"M d, yy",short:"m/d/y"},clockFormat:{mode:12,long:"T",short:"t"},firstDayCalendarOffset:0};window.eviivo.webcore.formatting.regionals["fr-fr"]={monthNames:{long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],medium:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],short:null},dayNames:{long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],medium:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],short:["di","lu","ma","me","je","ve","sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["it-it"]={monthNames:{long:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],medium:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],short:null},dayNames:{long:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],medium:["dom","lun","mar","mer","gio","ven","sab"],short:["do","lu","ma","me","gi","ve","sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["de-de"]={monthNames:{long:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],medium:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],short:null},dayNames:{long:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],medium:["So","Mo","Di","Mi","Do","Fr","Sa"],short:["So","Mo","Di","Mi","Do","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["pt-pt"]={monthNames:{long:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],medium:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],short:null},dayNames:{long:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],medium:["dom","seg","ter","qua","qui","sex","sáb"],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["pt-br"]={monthNames:{long:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],medium:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],short:null},dayNames:{long:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],medium:["dom","seg","ter","qua","qui","sex","sáb"],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["es-es"]={monthNames:{long:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],medium:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic."],short:null},dayNames:{long:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],medium:["do.","lu.","ma.","mi.","ju.","vi.","sá."],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo=window.eviivo||{};window.eviivo.customDropdown=function(n,t){function u(t,i){if(t===undefined||t===null)throw"You must pass an "+i;if(t instanceof HTMLElement)return n(t);if(t instanceof window.jQuery)if(t.length===0)throw i+" is a jQuery object, but contains no element";else if(t.length>1)throw i+" contains more than one element - you must only provide one";else return n(t.get(0));else throw i+" is neither an HTML Element, nor a jQuery object";}function f(t,r,u){var f,e,o;if(u=u||{},f={},u.show)if(e=typeof u.show,e==="string")if(i.hasOwnProperty(u.show))f.show=i[u.show].bind(r.get(0));else if(u.show==="fast")f.show=function(t){n(this).show("fast",t)}.bind(r.get(0));else if(u.show==="slow")f.show=function(t){n(this).show("slow",t)}.bind(r.get(0));else throw"options.show, when specified as a string, must be one of the recognised predefined effects";else if(e==="number")o=u.show,f.show=function(t){n(this).show(o,t)}.bind(r.get(0));else if(e==="function")if(u.show.length===1)f.show=u.show.bind(r.get(0));else throw"options.show, when specified as a function, must accept a single parameter, the completion function";else throw"options.show does not have a recognised value";else f.show=function(t){n(this).show("fast",t)}.bind(r.get(0));if(u.hide)if(e=typeof u.hide,e==="string")if(i.hasOwnProperty(u.hide))f.hide=i[u.hide].bind(r.get(0));else if(u.hide==="fast")f.hide=function(t){n(this).hide("fast",t)}.bind(r.get(0));else if(u.hide==="slow")f.hide=function(t){n(this).hide("slow",t)}.bind(r.get(0));else throw"options.hide, when specified as a string, must be one of the recognised predefined effects";else if(e==="number")o=u.hide,f.hide=function(t){n(this).hide(o,t)}.bind(r.get(0));else if(e==="function")if(u.hide.length===1)f.hide=u.hide.bind(r.get(0));else throw"options.hide, when specified as a function, must accept a single parameter, the completion function";else throw"options.hide does not have a recognised value";else f.hide=function(t){n(this).hide(0,t)}.bind(r.get(0));return Object.freeze(f)}var i=Object.freeze({fadeIn:function(t){n(this).fadeIn({complete:t})},fadeOut:function(t){n(this).fadeOut({complete:t})},slideUp:function(t){n(this).slideUp({complete:t})},slideDown:function(t){n(this).slideDown({complete:t})}}),r=n(document);return function(i,e,o){function a(){h()||(e.trigger("customDropdown.beforeShow"),o.show(function(){n(this).trigger("customDropdown.show")}))}function l(){h()&&(e.trigger("customDropdown.beforeHide"),o.hide(function(){c.removeClass("show");n(this).trigger("customDropdown.hide")}))}function v(){h()?l():a()}function y(){h()&&c.addClass("show")}function p(){h()&&c.removeClass("show")}function w(){h()&&c.toggleClass("show")}function h(){return s.assertNotDestroyed(),e.is(":visible")}var c,s;return i=u(i,"$activationElement"),e=u(e,"$dropdownElement"),c=n('<div class="loading-overlay"><\/div>').appendTo(e),o=f(i,e,o),s=function(){function i(){if(s===null)throw"This dropdown has been destroyed";}function r(){var n=t;t=null;n.forEach(function(n){n.$el.off(n.name,n.callback)})}function u(r,u,f){if(i(),!(r instanceof n))throw"$element must be a jQuery object";if(u===undefined||u===null||u===""||/^\W+$/.test(u))throw"eventName must be a valid event";if(typeof f!="function")throw"callback must be a function";t.push({$el:r,name:u,callback:f});r.on(u,f)}var t=[];return Object.freeze({assertNotDestroyed:i,destroy:r,attachEvent:u})}(),s.attachEvent(i,"click",v),s.attachEvent(r,"keydown",t.onKey(n.ui.keyCode.ESCAPE,l)),s.attachEvent(r,"click",t.outsideOf(i,e,l)),Object.freeze({show:a,hide:l,toggle:v,loading:Object.freeze({show:y,hide:p,toggle:w}),get isVisible(){return h()},destroy:s.destroy,get $dropdownElement(){return assertNotDestroyed(),n(e.get(0))},get $activationElement(){return assertNotDestroyed(),n(i.get(0))}})}}(window.jQuery,window.eviivo.utils.eventHelpers);window.eviivo=window.eviivo||{};window.eviivo.jQuery=window.eviivo.jQuery||{};window.eviivo.jQuery.textFade=function(n){n.fn.textFade=function(t,i){if(typeof t!="string")throw"newText must be a string";i=i||{};var r=function(){if(i.duration===undefined)return 100;var n=typeof i.duration;if(n==="string"){if(i.duration!=="fast"&&i.duration!=="slow")throw"Invalid value for options.duration";return i.duration}if(n==="number"){if(i.duration<0)throw"Invalid value for options.duration";return i.duration}throw"Invalid value for options.duration";}(),u=function(){if(i.beforeShow===undefined)return function(){};if(typeof i.beforeShow!="function")throw"options.beforeShow must be a function";return i.beforeShow}(),f=function(){if(i.complete===undefined)return function(){};if(typeof i.complete!="function")throw"options.complete must be a function";return i.complete}();this.each(function(){var i=n(this);i.animate({opacity:0},{duration:r,complete:function(){i.text(t);u.call(i.get(0));i.animate({opacity:1},{duration:r,complete:f})}})})}}(window.jQuery);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.utils=function(){function n(n){var t=i.exec(n);return t?new Date(parseInt(t[1]),parseInt(t[2])-1,parseInt(t[3])):undefined}function t(n){var t=n.getMonth()+1,i=o[t],r=n.getDate(),u=o[r];return n.getFullYear()+"-"+i+"-"+u}function s(n){return g.test(n)}function tt(n){return nt.test(n)}function it(n){if(!n||!Array.isArray(n))return!1;for(var t=0;t<n.length;t++)if(!s(n[t]))return!1;return!0}function h(n){return n?typeof n!="object"?!1:y(["adults","children"],Object.getOwnPropertyNames(n))?typeof n.adults!="number"?!1:typeof n.children!="number"?!1:!0:!1:!1}function rt(n){if(!n||!Array.isArray(n))return!1;for(var t=0;t<n.length;t++)if(!h(n[t]))return!1;return!0}function c(n){return n===undefined?!0:n===null?!0:typeof n!="string"?!0:ut.test(n)?!0:!1}function ft(i,r){var u=n(i);return u.setDate(u.getDate()+r),t(u)}function et(i,r){var u=n(i);return u.setMonth(u.getMonth()+r),t(u)}function ot(i){var r=n(i),u=new Date(r.getFullYear(),r.getMonth()+1,0);return t(u)}function st(t,r){var e,f,u;if(!i.test(t))throw"startDate is not in valid date format";if(!i.test(r))throw"endDate is not in valid date format";if(r<t)throw"endDate must be after startDate";for(e=n(r),f=0,u=n(t);!l(u,e);u.setDate(u.getDate()+1))f++;return f}function l(n,t){return n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()}function ht(i,r,u){var f=n(i),e=n(r),o;if(f===undefined)throw"startDate must be a valid date";if(e===undefined)throw"endDate must be a valid date";if(r<i)throw"endDate must not be before startDate";for(f;!l(f,e);f.setDate(f.getDate()+1))if(o=u(t(f)),o===!1)return;u(r)}function ct(){return t(new Date)}function r(n,t){if(!n||!Array.isArray(n))throw"arr must be an array";if(!t||typeof t!="function")throw"predicate must be a function";if(t.length!==1)throw"predicate must only take 1 argument";for(var i=0;i<n.length;i++)if(!t(n[i]))return!1;return!0}function a(n,t){if(!n||!Array.isArray(n))throw"arr must be an array";if(!t||typeof t!="function")throw"predicate must be a function";if(t.length!==1)throw"predicate must only take 1 argument";for(var i=0;i<n.length;i++)if(t(n[i]))return!0;return!1}function v(n,t){var r,i;if(!n||!Array.isArray(n))throw"arr must be an array";if(!t||typeof t!="function")throw"predicate must be a function";if(t.length!==1)throw"predicate must only take 1 argument";for(r=[],i=0;i<n.length;i++)t(n[i])&&r.push(n[i]);return r}function lt(n,t){var u,r,i;if(!n||!Array.isArray(n))throw"arr must be an array";if(!t||typeof t!="function")throw"predicate must be a function";if(t.length!==1)throw"predicate must only take 1 argument";for(r=!1,i=0;i<n.length;i++)if(t(n[i])){if(r)throw"More than one value in the array satisfies the predicate";u=n[i];r=!0}if(r===!1)throw"No value in the array satisfies the predicate";return u}function at(n,t){if(!n||!Array.isArray(n))throw"arr must be an array";if(!t||typeof t!="function")throw"predicate must be a function";if(t.length!==1)throw"predicate must only take 1 argument";for(var i=0;i<n.length;i++)if(t(n[i]))return n[i];return undefined}function vt(n,t){var i,u,e,r,f;if(!Array.isArray(n))throw"arr1 is not an array";if(!Array.isArray(t))throw"arr2 is not an array";for(n.length<=t.length?(i=n,u=t):(i=t,u=n),e=[],r=0;r<i.length;r++)for(f=0;f<u.length;f++)if(i[r]===u[f]){e.push(i[r]);break}return e}function y(n,t){var i,u,r;if(!Array.isArray(n))throw"arr1 is not an array";if(!Array.isArray(t))throw"arr2 is not an array";if(n.length!==t.length)return!1;for(i=0;i<n.length;i++){for(u=!1,r=0;r<t.length;r++)if(n[i]===t[r]){u=!0;break}if(!u)return!1}return!0}function yt(n,t){var u,i,f,r;if(!Array.isArray(n))throw"arr1 must be an array";if(!Array.isArray(t))throw"arr2 must be an array";for(u=[],i=0;i<n.length;i++){for(f=!1,r=0;r<t.length;r++)if(n[i]===t[r]){f=!0;break}f||u.push(n[i])}return u}function pt(n,t){var i,u,r;if(!Array.isArray(n))throw"testSet must be an array";if(!Array.isArray(t))throw"superSet must be an array";for(i=0;i<n.length;i++){for(u=!1,r=0;r<t.length;r++)if(n[i]===t[r]){u=!0;break}if(!u)return!1}return!0}function wt(n){var t;if(typeof n=="string"){for(t=1;t<arguments.length;t++)if(arguments[t]===n||arguments[t]&&arguments[t].test&&arguments[t].test(n))return!0}else for(t=1;t<arguments.length;t++)if(arguments[t]===n)return!0;return!1}function bt(n,t){var r,u,i;if(!n||!Array.isArray(n))throw"arr must be an array";if(typeof t=="function"){if(r=t,r.length!==1)throw"predicate must only take 1 argument";for(i=0;i<n.length;i++)if(r(n[i]))return i;return n.length}for(u=t,i=0;i<n.length;i++)if(n[i]===u)return i;return n.length}function kt(n){return function(t){return t>n?n:t}}function dt(n){return function(t){return t<n?n:t}}function gt(n,t,i){var r,u;if(!Array.isArray(n))throw"arr is not an array";if(typeof t!="number")throw"count is not a number";if(typeof i!="function"&&i.length!==1)throw"predicate must be a function accepting one argument";for(r=0,u=0;u<n.length;u++)if(i(n[u])&&(r++,r>t))return!1;return r===t}function ni(n,t,i){if(!(n instanceof jQuery))throw"$elems must be a jQuery object";if(typeof t!="number")throw"count is not a number";if(typeof i!="function"&&i.length!==1)throw"predicate must be a function accepting one argument";var r=0;return n.each(function(n,u){if(i(u)&&(r++,r>t))return!1}),r===t}function ti(n,t){var u,i,r;if(!Array.isArray(n))throw"arr is not an array";if(n.length===0)throw"arr has no items";for(u=t||function(n,t){return n>t?n:t},i=n[0],r=1;r<n.length;r++)i=u(i,n[r]);return i}function ii(n,t){var r,u,f,i,e;if(!Array.isArray(n))throw"arr must be an array";if(n.length===0)return 0;if(r=typeof t,r==="undefined"){if(!d("number")(n))throw"If strOrFunc is not defined, the array must only contain numbers";u=b}else if(r==="string"){for(i=0;i<n.length;i++)if(!n[i].hasOwnProperty(t))throw"Not all objects in the array have the property "+t;u=function(n){return n[t]}}else if(r==="function"&&t.length===1)u=t;else throw"strOrFunc must be undefined, a string or a function taking 1 parameter";for(f=0,i=0;i<n.length;i++){if(e=u(n[i]),typeof e!="number")throw"Result of transform of element `"+i+"` is not a number";f+=e}return f}function ri(n,t){var r,f,u,i;if(!Array.isArray(n))throw"arr must be an array";if(r=typeof t,r!=="string"&&r!=="function")throw"mapStrOrFunc must be a string or a function";for(f=r==="function"?t:function(n){return n[t]},u=new Array(n.length),i=0;i<u.length;i++)u[i]=f(n[i],i);return u}function ui(n,t){var f,i,r,u;if(!Array.isArray(n))throw"arr must be an array";if(typeof t!="function"&&t.length!==1)throw"func must be a function taking 1 argument";for(f=[],i=0;i<n.length;i++){if(r=t(n[i]),!Array.isArray(r))throw"func did not return an array to flatten";for(u=0;u<r.length;u++)f.push(r[u])}return f}function fi(n,t){var u,r,i;if(n===undefined||n===null||typeof n!="object")throw"obj must be an object";if(typeof t!="function"&&t.length!==1)throw"transform must be a function taking one parameter";for(u={},r=Object.getOwnPropertyNames(n),i=0;i<r.length;i++)u[r[i]]=t(n[r[i]]);return u}function ei(n,t){var r,i;if(typeof n!="number")throw"start must be a number";if(typeof t!="number")throw"end must be a number";if(n<t){for(r=new Array(t-n+1),i=0;n+i<=t;i++)r[i]=n+i;return r}if(n>t){for(r=new Array(n-t+1),i=0;n-i>=t;i++)r[i]=n-i;return r}return[n]}function oi(n){var i,t;if(!Array.isArray(n))throw"arr must be an array";for(i=new Array(n.length),t=0;t<n.length;t++){if(typeof n[t]!="number")throw"arr contains an element that is not a number";i[t]=n[t]}return i.sort(function(n,t){return n-t}),i}function p(n){var i,t,f,r;if(typeof n!="function")throw"func must be a function";if(u[n.length])return u[n.length](n);for(i=new Array(n.length),t=0;t<n.length;t++)i[t]="arg"+t;return f="return function("+i.join(", ")+") { return !func("+i.join(", ")+"); };",r=new Function("func",f),u[n.length]=r,r(n)}function f(n){var t,r,i,e,u;if(n===undefined||n===null||(t=typeof n,t==="boolean"||t==="number"||t==="string"||t==="function"))return n;if(n instanceof Date)return new Date(n.value);if(Array.isArray(n)){for(r=new Array(n.length),i=0;i<r.length;i++)r[i]=f(n[i]);return r}if(t==="object"){e={};for(u in n)n.hasOwnProperty(u)&&(e[u]=f(n[u]));return e}throw"Cannot clone this type of object";}function e(n){var t,r,i,f,u;if(n===undefined||n===null||(t=typeof n,t==="boolean"||t==="number"||t==="string"||t==="function"))return n;if(n instanceof Date)return new Date(n.value);if(Array.isArray(n)){for(r=new Array(n.length),i=0;i<r.length;i++)r[i]=e(n[i]);return Object.freeze(r)}if(t==="object"){f={};for(u in n)n.hasOwnProperty(u)&&(f[u]=e(n[u]));return Object.freeze(f)}throw"Cannot clone this type of object";}function si(n){var r,i,t;if(typeof n!="object"||Array.isArray(n))throw"Must be an object";r=function(n){return this[n]};i={};for(t in n)n.hasOwnProperty(t)&&(i[t]=w(r.bind(n,t)));return Object.freeze(Object.create(null,i))}function w(n){return typeof n=="function"?{configurable:!1,enumerable:!0,writeable:!1,get:n}:{configurable:!1,enumerable:!0,writeable:!1,value:n}}function hi(n){return{configurable:!1,enumerable:!0,writeable:!1,value:n}}function ci(n,t){var i=new RegExp("{("+Object.keys(t).join("|")+")}","g");return n.replace(i,function(n,i){return t[i]})}function li(n,t){if(n instanceof jQuery)return $.grep(n,function(n){return $(t).is(n)||$.contains(n,t)}).length>0;if(n.nodeType===1)return $(t).is(n)&&!$.contains(n,t);throw"elem must be a jQuery object or a DOM element";}function ai(n,t){if(typeof n!="number"&&(!Array.isArray(n)||r(n,function(n){return typeof n=="number"})))throw"keys must be a single number or an array of numbers";return function(i){Array.isArray(n)&&a(n,function(n){return n===i.which})?t.apply(this,arguments):typeof n=="number"&&n===i.which&&t.apply(this,arguments)}}function vi(){var i=arguments[arguments.length-1],t,n;if(typeof i!="function")throw"Last argument must be the event handler function to call";for(t=new Array(arguments.length-1),n=0;n<arguments.length-1;n++){if(!(arguments[n]instanceof jQuery)&&!(arguments[n].nodeType===1))throw"All provided elements must be a jQuery object or a DOM element";t[n]=arguments[n]}return function(n){r(t,function(t){return!li(t,n.target)})&&i.apply(this,arguments)}}function yi(n){var i,r,t;if(Object.getOwnPropertyDescriptors!==undefined)return Object.getOwnPropertyDescriptors(n);for(i=Object.getOwnPropertyNames(n),r={},t=0;t<i.length;t++)r[i[t]]=Object.getOwnPropertyDescriptor(n,i[t]);return r}function pi(n,t){return n===undefined||n===null?!1:n.indexOf(t)===0}function b(n){return n}function k(n,t){var u,i;if(!Array.isArray(t)||!r(t,function(n){return typeof n=="string"}))throw"strArr must be an array of strings";if(typeof n!="string")throw"prefix must be a string";for(u=new Array(t.length),i=0;i<t.length;i++)u[i]=n+t[i];return u}function wi(n){if(!(n instanceof jQuery))throw"$elem must be a jQuery object";if(n.length!==1)throw"$elem must represent a single element";var t=n.prop("tagName"),i=k(".",n.prop("class").split(/\s+/));return t+i.join("")}function bi(n,t){var i=$("<span><\/span>");return $.map(n.split(t),function(n){return i.text(n.trim()).html()}).join("<br />")}function d(n){return function(t){if(!Array.isArray(t))return!1;for(var i=0;i<t.length;i++)if(typeof t[i]!==n)return!1;return!0}}function ki(n){if(typeof n!="string")throw"str must be a string";return v(n.split(" "),p(c))}var i=/^(\d\d\d\d)-(0[0-9]|1[012])-([012][0-9]|3[01])$/,g=/^\d+$/,nt=/^\d+$/,o=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"],ut=/^\W*$/,u={};return Object.freeze({isValidRoomTypeId:s,isValidRatePlanId:tt,isValidRoomTypeIdArray:it,isValidOccupancyValue:h,isValidOccupanciesArray:rt,intRegex:/^[0-9]+$/,isUndefNullOrWhitespace:c,dateRegex:i,addDays:ft,addMonths:et,endOfMonth:ot,nightsBetween:st,forEachDayBetween:ht,today:ct,toDateString:t,parseDate:n,all:r,any:a,where:v,single:lt,firstOrDefault:at,intersect:vt,setEqual:y,setDifference:yt,isSubsetOf:pt,isOneOf:wt,countUntil:bt,clampAbove:kt,clampBelow:dt,hasCount:gt,$hasCount:ni,max:ti,sum:ii,map:ri,mapMany:ui,mapValues:fi,range:ei,numericSort:oi,not:p,deepClone:f,immutableDeepClone:e,readOnlyWrapper:si,readOnlyDescriptor:w,readOnlyValueDescriptor:hi,format:ci,onKey:ai,clickOutsideOf:vi,getOwnPropertyDescriptors:yi,startsWith:pi,identity:b,MAX_SAFE_INTEGER:9007199254740991,prefixAll:k,$elemSummary:wi,splitIntoHtmlLines:bi,isArrayOf:d,cssClassStringToArray:ki})}();window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.data=function(){var n=eviivo.availabilityCalendar.utils,t=Object.freeze({MaxLengthOfStay:n.MAX_SAFE_INTEGER,MinLengthOfStay:0,CanArrive:!1,CanDepart:!1,CanContinueStay:!1});return function(i,r){var u=function(){function t(t){if(typeof t!="function")throw"func must be a function";n.push(t)}function i(){for(var t=0;t<n.length;t++)n[t].call(null)}var n=[];return Object.freeze({attachListener:t,trigger:i})}(),f,e;return i=i||{},f=function(i,r,f){function c(i){var s,f,r,e,u,o,h,c;if(!i||typeof i!="object")return!1;s=Object.getOwnPropertyNames(t);for(f in i){if(!n.dateRegex.test(f)||(r=i[f],!r||typeof r!="object"))return!1;for(e in r){if(!n.isValidRoomTypeId(e)||(u=r[e],!u||typeof u!="object"))return!1;for(o in u){if(!n.isValidRatePlanId(o))return!1;h=u[o];for(c in h)if(s.indexOf(c)===-1)return!1}}}return!0}function h(i,r,f){var p,h,l,a,b,w,v,y;if(!n.dateRegex.test(i))throw"earliestDate is not a valid ISO8601 extended date format";if(!n.dateRegex.test(r))throw"furthestDate is not a valid ISO8601 extended date format";if(!c(f))throw"data is not in a valid form";p=Object.getOwnPropertyNames(t);for(h in f)for(l in f[h])for(a in f[h][l]){for(b=f[h][l][a],w={},v=0;v<p.length;v++)y=p[v],w[y]=b[y]||t[y];e[h]=e[h]||{};e[h][l]=e[h][l]||{};e[h][l][a]=e[h][l][a]||{};e[h][l][a]=Object.freeze(w)}i<s&&(s=i);r>o&&(o=r);u.trigger()}function l(){return Object.getOwnPropertyNames(e)}function a(t){if(!n.dateRegex.test(t))throw"Invalid date provided";if(t<s||t>o)throw"Date is beyond loaded data";var i=e[t];return i?Object.getOwnPropertyNames(i):[]}function v(t,i){var r,u;if(!n.dateRegex.test(t))throw"Invalid date provided";if(!n.isValidRoomTypeId(i))throw"Invalid room type provided";if(t<s||t>o)throw"Date is beyond loaded data";return(r=e[t],!r)?[]:(u=r[i],u?Object.getOwnPropertyNames(u):[])}function y(i,r,u){var f,h,c;if(!n.dateRegex.test(i))throw"Invalid date provided";if(!n.isValidRoomTypeId(r))throw"Invalid room type provided";if(!n.isValidRatePlanId(u))throw"Invalid rate plan provided";if(i<s||i>o)throw"Date is beyond loaded data";return(f=e[i],!f)?t:(h=f[r],!h)?t:(c=h[u],c||t)}function p(t){if(!n.dateRegex.test(t))throw"Invalid date provided";s=t;for(var i in e)i<s&&delete e[i];u.trigger()}function w(t){if(!n.dateRegex.test(t))throw"Invalid date provided";o=t;for(var i in e)i>o&&delete e[i];u.trigger()}var e={},o=n.toDateString(new Date(Number.MIN_VALUE)),s=n.toDateString(new Date(Number.MAX_VALUE));return i&&r&&f&&h(r,f,i),Object.freeze({insertAvailabilityData:h,get furthestDateLoaded(){return o},get earliestDateLoaded(){return s},getDates:l,getRoomTypes:a,getRatePlans:v,getAvailabilityInfo:y,forceEarliestDate:p,forceFurthestDate:w})}(i.initialData,i.initialEarliestDate,i.initialFurthestDate),r=r||{},e=function(i,r){function e(t){var u,r,i;if(!t||typeof t!="object")throw"Occupancy data must be an object";u=["RoomName","MaxTotalOccupancy","MaxAdultOccupancy","MaxChildOccupancy"];for(r in t){if(!n.isValidRoomTypeId(r))throw"`"+r+"` is not a valid room type id";if(i=t[r],!i||typeof i!="object")throw"Data for room type `"+r+"` of the occupancy data is not an object";if(Object.getOwnPropertyNames(i).length>u.length)throw"Data for room type `"+r+"` has too many properties";if(n.isUndefNullOrWhitespace(i.RoomName))throw"Data for room type `"+r+"` has an empty or missing room name";if(i.MaxTotalOccupancy&&typeof i.MaxTotalOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxTotalOccupancy";if(i.MaxAdultOccupancy&&typeof i.MaxAdultOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxAdultOccupancy";if(i.MaxChildOccupancy&&typeof i.MaxChildOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxChildOccupancy";}}function o(n){var r={},i,t;for(i in n)t=n[i],r[i]=Object.freeze({RoomName:t.RoomName,MaxTotalOccupancy:t.MaxTotalOccupancy||0,MaxAdultOccupancy:t.MaxAdultOccupancy||0,MaxChildOccupancy:t.MaxChildOccupancy||0});return Object.freeze(r)}function s(i){if(!n.isValidRoomTypeId(i))throw"Invalid room type id";var r=u[i];return r?r:t}function f(){return n.map(Object.getOwnPropertyNames(u),function(n){return parseInt(n)})}function h(){for(var t=f(),i={},n=0;n<t.length;n++)i[t[n]]=u[t[n]].RoomName;return i}var u;return typeof r=="undefined"&&(r=0),i&&(e(i),u=o(i)),Object.freeze({getRoomTypeIds:f,getRoomTypes:h,getOccupancyInfo:s,maxInventory:r})}(r.roomTypes,r.maxInventory),Object.freeze({availability:f,occupancy:e,attachListener:u.attachListener})}}();window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.prodData=function(n){function i(i){var u,e,r;if(!Array.isArray(i))return i;for(u={},e=0;e<i.length;e++){if(r=t.exec(i[e]),r===null)throw"Bad data returned";var f=r[1]+"-"+r[2]+"-"+r[3],o=r[4],s=r[5];u[f]=u[f]||{};u[f][o]=u[f][o]||{};u[f][o][s]=n.extend({},{CanArrive:r[6]==="1"?!0:!1,CanDepart:r[7]==="1"?!0:!1,CanContinueStay:r[8]==="1"?!0:!1,MinLengthOfStay:r[9]!==""?parseInt(r[9]):undefined,MaxLengthOfStay:r[10]!==""?parseInt(r[10]):undefined})}return u}var t=/^([0-9]{4})([0-9]{2})([0-9]{2})\/([0-9]+)\/([0-9]+)\/([01]|)\/([01]|)\/([01]|)\/([0-9]*)\/([0-9]*)$/;return Object.freeze({postProcessData:i})}(jQuery);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ajax=function(n,t,i){return function(r,u,f){function s(f,o,s,h){if(!t.dateRegex.test(f))throw"Invalid startDate";if(!t.dateRegex.test(o))throw"Invalid endDate";if(s&&typeof s!="function")throw"successFunc must be a function";if(h&&typeof h!="function")throw"errorFunc must be a function";e++;n.ajax({method:"GET",url:u,data:{start:f,end:o},dataType:"json",success:function(n){e--;try{r.availability.insertAvailabilityData(f,o,i.postProcessData(n))}catch(t){h&&h("data insertion failed",t);return}s&&s()},error:function(n,t,i){e--;h&&h(t,i)}})}var o=f||null,e=0;return Object.freeze({loadAvailabilityDataBetweenDates:s,get furthestDateAvailableFromServer(){return o},get dataLoadPending(){return e!==0}})}}(jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.prodData);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.stateValidation=function(n){return function(t){function r(n){if(n.length<=0||n.length>t.maxInventory)return!1;for(var i=0;i<n.length;i++)if(n[i].adult<1||n[i].child<0||!t.hasCompatibleRoomTypesForOccupancy(n[i]))return!1;return!0}function u(i){for(var f=t.maximumInventory,u=[],r=0;r<i.length;r++)if(!(i[r].adults<1)&&!(i[r].child<0)&&t.hasCompatibleRoomTypesForOccupancy(i[r])&&(u.push(n.immutableDeepClone(i[r])),u.length===f))break;return Object.freeze(u)}function f(i,r){return(r===undefined&&(r=t.roomTypeIds),r.length===0)?!1:t.isRoomSelectionAbleToSatisfyOccupancies(r,i)?n.isSubsetOf(r,t.getCompatibleRoomTypesForOccupancies(i))?!0:!1:!1}function e(n){return t.getCompatibleRoomTypesForOccupancies(n)}function i(i,r){try{var u=t.getArrivalStates(n.today(),r,i);return u[r]==="available"}catch(f){return!1}}function o(r,u,f){try{if(!i(r,u))return!1;var e=t.getDepartureStates(u,f,r);return n.isOneOf(e[f],"available","forcedDeparture/maxLos","forcedDeparture")}catch(o){return!1}}return Object.freeze({validateOccupancies:r,cleanOccupancies:u,validateRoomTypes:f,cleanRoomTypes:e,validateCheckInDate:i,validateCheckOutDate:o})}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.logic=function(n,t){return function(i){function u(t,i){var r,u;if(!Array.isArray(i))throw"cascadeValues must be an array";if(i.length<1)throw"cascadeValues must have at least one value";for(r=0;r<i.length-1;r++)if(n.any(t,function(n){return n===i[r]}))return i[r];if(u=i[i.length-1],n.all(t,function(n){return n===u}))return u;throw"There is an unrecognised value in the array that is not in cascade values";}function o(t,r,u){if(!n.dateRegex.test(t))throw"Invalid startDate provided";if(!n.dateRegex.test(r))throw"Invalid endDate provided";if(r<t)throw"endDate must be after startDate";if(u&&!n.isValidRoomTypeIdArray(u))throw"roomTypes must be an array of room type ids";if(t<i.availability.earliestDateLoaded)throw"Date provided is beyond the loaded data";if(r>i.availability.furthestDateLoaded)throw"Date provided is beyond the loaded data";var f={},e="firstDay";return n.forEachDayBetween(t,r,function(n){var t=s(n,u,e);f[n]=t;e=t}),f}function s(t,r,f){if(f==="unknown")return"unknown";r=r||i.availability.getRoomTypes(t);var o=n.mapMany(r,function(n){return i.availability.getRatePlans(t,n).map(function(i){return c(t,n,i)})}),e=u(o,["unknown","available","cannotArrive","cannotArrive/minLos","forcedDeparture","closed"]);return n.isOneOf(e,"forcedDeparture","cannotArrive","cannotArrive/minLos")&&n.isOneOf(f,"forcedDeparture","closed","afterClosed")?"afterClosed":e==="forcedDeparture"&&f==="firstDay"?"closed":e}function h(t,r,u){for(var e,f=n.addDays(t,1);f<i.availability.furthestDateLoaded;f=n.addDays(f,1)){if(e=i.availability.getAvailabilityInfo(f,r,u),e.CanDepart)return!0;if(!e.CanContinueStay)return!1}return!1}function c(t,r,u){var f=i.availability.getAvailabilityInfo(t,r,u),e,o;if(f.CanArrive&&f.MinLengthOfStay<=1)return h(t,r,u)?"available":"cannotArrive";if(f.CanArrive&&f.MinLengthOfStay>1){for(e=1;e<f.MinLengthOfStay;e++){if(n.addDays(t,e)>i.availability.furthestDateLoaded)return"unknown";if(o=i.availability.getAvailabilityInfo(n.addDays(t,e),r,u),!o.CanContinueStay)return"cannotArrive/minLos"}return"available"}return!f.CanDepart||f.CanArrive||f.CanContinueStay?f.CanDepart||f.CanArrive||f.CanContinueStay?"cannotArrive":"closed":"forcedDeparture"}function f(t,i,r){var f=e(t,i,r);return n.mapValues(f,function(t){return u(n.map(t,"departureStatus"),["available","cannotDepart/ctd","forcedDeparture/maxLos","cannotDepart/minLos","forcedDeparture","afterClosed","closed"])})}function e(t,r,u){if(r<=t)throw"calculateUpTo must be after arrivalDate";if(t>i.availability.furthestDateLoaded||r>i.availability.furthestDateLoaded)throw"arrivalDate or calculateUpTo are beyond the loaded data";if(u&&!n.isValidRoomTypeIdArray(u))throw"roomTypes must be an array of room type ids";var f={};return n.forEachDayBetween(n.addDays(t,1),r,function(n){f[n]=[]}),u=u||i.availability.getRoomTypes(t),u.forEach(function(n){i.availability.getRatePlans(t,n).forEach(function(i){var u=l(t,n,i,r);for(var e in u)f[e].push({roomType:n,ratePlan:i,departureStatus:u[e]})})}),f}function l(t,r,u,f){var e=i.availability.getAvailabilityInfo(t,r,u),c=e.MaxLengthOfStay,l=e.MinLengthOfStay,o={},s=1,h=!1;return n.forEachDayBetween(n.addDays(t,1),f,function(t){var e=i.availability.getAvailabilityInfo(t,r,u),f=a(e,s,h,l,c);n.isOneOf(f,"afterClosed","closed","forcedDeparture","forcedDeparture/maxLos")&&(h=!0);o[t]=f;s++}),o}function a(n,t,i,r,u){return i||t>u?"afterClosed":n.CanDepart||n.CanContinueStay?n.CanDepart&&!n.CanContinueStay?"forcedDeparture":t===u&&n.CanDepart?"forcedDeparture/maxLos":n.CanDepart?t<r?"cannotDepart/minLos":n.CanArrive||r!==0?"available":"closed":"cannotDepart/ctd":"closed"}function v(t,r){var u;if(!n.dateRegex.test(t))throw"Invalid startDate provided";if(r&&!n.isValidRoomTypeIdArray(r))throw"roomTypes must be an array of room type ids";if(t<i.availability.earliestDateLoaded||t>i.availability.furthestDateLoaded)throw"Date provided is beyond the loaded data";if(u=0,r=r||i.availability.getRoomTypes(t),r.forEach(function(n){i.availability.getRatePlans(t,n).forEach(function(r){var f=i.availability.getAvailabilityInfo(t,n,r).MinLengthOfStay;f>u&&(u=f)})}),u===0)return 0;var e=n.addDays(t,u),s=f(t,e,r),o=1;return n.forEachDayBetween(n.addDays(t,1),e,function(n){if(s[n]!=="cannotDepart/minLos")return!1;o++}),o}function y(t){if(!n.isValidOccupanciesArray(t))throw"Invalid occupancies list";return n.where(i.occupancy.getRoomTypeIds(),function(r){var u=i.occupancy.getOccupancyInfo(r);return n.any(t,function(n){return n.children<=u.MaxChildOccupancy&&n.adults<=u.MaxAdultOccupancy&&n.children+n.adults<=u.MaxTotalOccupancy})})}function p(t){if(!n.isValidOccupancyValue(t))throw"Invalid occupancy";return n.any(i.occupancy.getRoomTypeIds(),function(n){var r=i.occupancy.getOccupancyInfo(n);return t.children<=r.MaxChildOccupancy&&t.adults<=r.MaxAdultOccupancy&&t.children+t.adults<=r.MaxTotalOccupancy})}function w(){var t=n.map(i.occupancy.getRoomTypeIds(),i.occupancy.getOccupancyInfo);return Object.freeze({adults:n.max(n.map(t,function(n){return n.MaxAdultOccupancy})),children:n.max(n.map(t,function(n){return n.MaxChildOccupancy})),total:n.max(n.map(t,function(n){return n.MaxTotalOccupancy}))})}function b(t,r){if(t===undefined)return!0;var u=n.map(t,i.occupancy.getOccupancyInfo);return n.all(r,function(t){return n.any(u,function(n){return t.adults<=n.MaxAdultOccupancy&&t.children<=n.MaxChildOccupancy&&t.adults+t.children<=n.MaxTotalOccupancy})})}if(!i||typeof i!="object")throw"Invalid availabilityData provided";var r=null;return Object.freeze({getArrivalStates:o,getDepartureStatesByDateAndRatePlan:e,getDepartureStates:f,getMinLengthOfStay:v,get furthestDateLoaded(){return i.availability.furthestDateLoaded},getCompatibleRoomTypesForOccupancies:y,hasCompatibleRoomTypesForOccupancy:p,isRoomSelectionAbleToSatisfyOccupancies:b,get maximumInventory(){return i.occupancy.maxInventory},get roomTypes(){return i.occupancy.getRoomTypes()},get roomTypeIds(){return i.occupancy.getRoomTypeIds()},get maximumOccupancy(){return w()},attachListener:i.attachListener,get validator(){return r===null&&(r=t(this)),r}})}}(window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.stateValidation);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.logicCache=function(){var n=eviivo.availabilityCalendar.utils;return function(t,i){function r(r,u){var f=n.addDays(r,i),e;return f=n.clampAbove(t.furthestDateLoaded)(f),e=t.getArrivalStates(r,f,u),Object.freeze({get arrival(){return e},get dateCalculatedTo(){return f},tryEnsureWindow:function(n){n<=f||f<t.furthestDateLoaded&&(f=t.furthestDateLoaded,e=t.getArrivalStates(r,f,u))}})}function u(r,u,f){var e=n.addDays(u,i),o,s;return e=n.clampAbove(t.furthestDateLoaded)(e),o=t.getArrivalStates(r,e,f),s=t.getDepartureStates(u,e,f),Object.freeze({get arrival(){return o},get departure(){return s},get dateCalculatedTo(){return e},minLengthOfStay:t.getMinLengthOfStay(u,f),tryEnsureWindow:function(n){n<=e||e<t.furthestDateLoaded&&(e=t.furthestDateLoaded,o=t.getArrivalStates(r,e,f),s=t.getDepartureStates(u,e,f))}})}return Object.freeze({arrivalCache:r,arrivalDepartureCache:u})}}();window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.urlHandler=function(n,t){function f(u,f,s){var h={noofrooms:f.occupancy.length,ref:s},a,c,l,p;f.startDate!==null&&(h.startDate=f.startDate);f.endDate!==null&&(h.endDate=f.endDate);a=$("#pce");a.length>0&&(h.pce=a.val());c=$("#peid");c.length>0&&c.val()!=null&&c.val()!==""&&(h.peid=c.val());var w=$.extend({},h,e(f.occupancy),o(f.roomFilter)),v=t.getAllKeys(u),y={};for(l in v)Object.hasOwnProperty(v,l)&&!n.isOneOf(l,i,r,"startdate","enddate","noofrooms","nights","roomcount","pce","peid")&&(y[l]=v[l]);return p=Object.freeze($.extend({},y,w)),t.toString(p,!0)}function e(n){for(var i={},t=0;t<n.length;t++)i["adults"+(t+1)]=n[t].adults.toString(),i["children"+(t+1)]=n[t].children.toString();return i}function o(n){var i,t;if(n===undefined)return{};for(i={},t=0;t<n.length;t++)i["roomtype"+(t+1)]=n[t].toString();return i}function s(f){var e=t.getAllKeys(f),o=n.dateRegex.test(e.startdate)?e.startdate:null,s=o!==null&&n.dateRegex.test(e.enddate)?e.enddate:null,h;o!==null&&n.intRegex.test(e.nights)&&(h=parseInt(e.nights),s=n.addDays(o,h));var c=function(){if(n.intRegex.test(e.noofrooms))return parseInt(e.noofrooms);var t=$.grep(Object.getOwnPropertyNames(e),function(n){return i.test(n)||r.test(n)});return t.length===0?0:n.max($.map(t,function(n){var u=i.exec(n),t;if(u!==null)return parseInt(u[1]);if(t=r.exec(n),t!==null)return parseInt(t[1]);throw"Unknown algorithm state...";}))}(),l=function(){var i,t,r,u;if(c<1)return[{adults:2,children:0}];for(i=[],t=1;t<=c;t++)(r=n.intRegex.test(e["adults"+t])?parseInt(e["adults"+t]):0,u=n.intRegex.test(e["children"+t])?parseInt(e["children"+t]):0,r!==0||u!==0)&&i.push({adults:r,children:u});return i}(),a=function(){var i=$.grep(Object.getOwnPropertyNames(e),function(n){return u.test(n)}),r,t;if(i.length===0)return undefined;for(r=[],t=0;t<i.length;t++)n.intRegex.test(e[i[t]])&&r.push(parseInt(e[i[t]]));return r}();return Object.freeze({startDate:o,endDate:s,occupancy:l,roomFilter:a})}var i=/^adults([0-9]+)$/,r=/^children([0-9]+)$/,u=/^roomtype([0-9]+)$/;return Object.freeze({extractCriteriaFromUrl:s,generateNewUrlFromCriteria:f})}(eviivo.availabilityCalendar.utils,eviivo.utils.queryStringHelper);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.tooltipResourceParser=function(n){function i(i){if(n.isOneOf(i,undefined,null))return t;if(typeof i=="string"){var r=i.trim();return r===""?t:Object.freeze({text:r,forceShow:!1,pos:"top"})}if(typeof i=="object"){if(typeof i.text!="string"||i.text.trim()==="")throw"tooltip.text must be set and be a non-empty string";if(!n.isOneOf(i.forceShow,undefined,null,!0,!1))throw"tooltip.forceShow must be a boolean if set";if(!n.isOneOf(i.pos,undefined,null,"top","bottom"))throw"tooltip.pos must be 'top' or 'bottom' if set";return Object.freeze({text:i.text.trim(),forceShow:!!i.forceShow,pos:i.pos||"top"})}throw"tooltip has an unrecognized value";}var t=Object.freeze({text:undefined,forceShow:!1,pos:"top"});return function(n){var r={},t,u;for(t in n){u=n[t];try{r[t]=i(u)}catch(f){throw"Error parsing tooltip `"+t+"` - "+f;}}return Object.freeze(r)}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.calendarTooltips=function(n,t,i){var r=/^( *|ui-[a-z0-9-]+)$/i;return function(u){function f(i,u){if(!i.data("ui-tooltip")||u!==undefined){var e=i.attr("class")||"",o=t.where(e.split(" "),function(n){return!r.test(n)}),f=i.hasClass("tooltip-pos-bottom")?"bottom":"top";i.tooltip({content:function(){var i=u||n(this).attr("title")||"";return t.splitIntoHtmlLines(i,"|")},items:"[title]",position:{my:"center "+(f==="top"?"bottom-15":"top+15"),at:"center "+(f==="top"?"top+10":"bottom-10"),using:function(t,i){n(this).css(t);n("<div>").addClass("arrow").addClass(i.vertical).prependTo(this)}},show:!1,hide:!1,tooltipClass:o.join(" "),open:function(t,i){var r=n(i.tooltip),u=n(this),f=r.offset(),e=u.offset();u.append(r);r.css("left",f.left-e.left+"px").css("top",f.top-e.top+"px")}})}}function o(){s()}function s(){n("table.ui-datepicker-calendar td.tooltip-forceShow",u).each(function(t,i){var r=n(i);f(r);r.tooltip("open");var e=r.data("ui-tooltip").tooltips,o=Object.getOwnPropertyNames(e)[0],u=n("#"+o).clone(!1,!1);r.tooltip("destroy");u.attr("id",null);r.append(u)})}function e(i,r,u,e){var s,h;if(!(i instanceof n))throw"$cell must be a jQuery object";if(i.length===0)throw"$cell does not represent any elements";if(i.length>1)throw"$cell must only represent one element";if(!i.is("td")||i.parents("table.ui-datepicker-calendar").length===0)throw"$cell is not a cell in the datepicker calendar";if(t.isUndefNullOrWhitespace(r))throw"text must be defined";if(u=function(){if(u===undefined||u===null)return[];if(typeof u=="string")return t.cssClassStringToArray(u);if(Array.isArray(u)){if(!t.isArrayOf("string"))throw"cssClasses, if an array, must only contain strings";return t.mapMany(u,t.cssClassStringToArray)}throw"cssClasses must be a string or an array of strings";}(),e!==undefined&&(typeof e!="number"||e<=0))throw"duration must be a positive integer";e=e||6e3;i.data("tooltip-flash",!0);f(i,r);i.tooltip("open");var c=i.data("ui-tooltip").tooltips,l=Object.getOwnPropertyNames(c)[0],o=n("#"+l).clone(!1,!1);i.tooltip("destroy");o.attr("id",null).appendTo(i).css("display","none");s={"background-color":o.css("background-color"),color:o.css("color")};o.addClass(u.join(" "));h={"background-color":o.css("background-color"),color:o.css("color")};o.removeClass(u.join(" ")).css("display","");o.css(h).delay(e/6).animate(s,{duration:e*2.5/6,easing:"swing",complete:function(){o.animate({opacity:0},{duration:e*2.5/6,easing:"swing",complete:function(){o.remove();i.data("tooltip-flash",!1)}})}})}if(i)u.on("click","table.ui-datepicker-calendar td.not-clickable",undefined,function(t){var i=n(t.currentTarget);e(i,i.attr("title"),"tooltip-error",2500)});else{u.on("mouseover","table.ui-datepicker-calendar td",undefined,function(t){var i=n(t.target).parents("td");i.hasClass("tooltip-forceShow")||i.data("tooltip-flash")===!0||(f(i),i.tooltip("open"))});u.on("mouseover","table.ui-datepicker-calendar td div.ui-tooltip",undefined,function(t){var i=n(t.target),r;if(i.hasClass("arrow"))return t.stopPropagation(),!1;r=i.parents("td");r.hasClass("tooltip-forceShow")||r.data("tooltip-flash")===!0||i.parents("td").tooltip("close")});u.on("click","table.ui-datepicker-calendar td.not-clickable",undefined,function(t){var f=n(t.currentTarget),i=n("div.ui-tooltip",f),r,u;i.finish();r=i.css("background-color");i.addClass("tooltip-error");u=i.css("background-color");i.removeClass("tooltip-error");i.css("background-color",u).animate({"background-color":r},{duration:2500,easing:"swing",complete:function(){i.css("background-color","")}})})}return Object.freeze({updateUi:o,flashTooltip:e})}}(window.jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.utils.isMobile);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.calendar=function(n,t,i,r,u,f){var e=/^date-([0-9]{4}-[01][0-9]-[0123][0-9])$/;return function(o,s,h,c){function a(n){var i,u;if(!t.setEqual(c.stateNames,Object.getOwnPropertyNames(n)))throw"Tooltip resources state level does not match states in state machine";i={};for(u in n)i[u]=r(n[u]);return Object.freeze(i)}var l=a(o.resources.tooltips);return function(r,a){function tt(){b=!0;y++;r.datepicker("option",{maxDate:t.parseDate(it())});r.datepicker("setDate",null);r.data("datepicker").drawMonth=v.month-1;r.data("datepicker").drawYear=v.year;y--;r.datepicker("refresh")}function it(){return s.furthestDateLoaded===h.furthestDateAvailableFromServer?t.addDays(t.endOfMonth(s.furthestDateLoaded),1):s.furthestDateLoaded===t.endOfMonth(s.furthestDateLoaded)?t.addDays(s.furthestDateLoaded,1):s.furthestDateLoaded}function rt(n,i){if(typeof i!="object")throw"Invalid state returned from dateState";var f=function(){if(!t.isOneOf(i.clickable,!0,!1,undefined,null))throw"dateState.clickable has an unrecognized value";return!!i.clickable}(),u=Object.freeze(function(){if(typeof i.classes=="string")return t.cssClassStringToArray(i.classes);if(t.isArrayOf("string")(i.classes))return t.mapMany(i.classes,t.cssClassStringToArray);throw"dateState.classes has an unrecognized value";}()),r=Object.freeze(function(){if(i.tooltipFormat&&typeof i.tooltipFormat!="object")throw"dateState.tooltipFormat must be an object to be passed to utils.format";if(!t.isOneOf(i.forceShowOverride,!0,!1,undefined,null))throw"dateState.forceShowOverride has an unrecognized value";var r=t.prefixAll(".",u).join(""),n=t.deepClone(l[c.stateName][r]);return n.text=n.text&&i.tooltipFormat?t.format(n.text,i.tooltipFormat):n.text,n.forceShow=t.isOneOf(i.forceShowOverride,!0,!1)?i.forceShowOverride:n.forceShow,n}()),e=Object.freeze(function(u){return u.push("tooltip-pos-"+r.pos),u.push("date-"+t.toDateString(n)),r.forceShow&&u.push("tooltip-forceShow"),i.clickable||u.push("not-clickable"),u}(t.deepClone(u)));return Object.freeze({clickable:f,tooltip:r,classes:e})}function ut(n){if(n===undefined)return[];if(typeof n!="object")throw"result of onDateSelect must be undefined or an object";return Object.freeze(function(){function i(n){if(n===undefined||n===null||typeof n!="object")throw"flashTooltip element must be an object";var i=function(){if(t.isUndefNullOrWhitespace(n.text))throw"flashTooltip[].text must be a non-empty string";return n.text}(),r=Object.freeze(function(){if(n.classes===undefined||n.classes===null)return[];if(typeof n.classes=="string")return t.cssClassStringToArray(n.classes);if(Array.isArray(n.classes))return t.mapMany(n.classes,t.cssClassStringToArray);throw"flashTooltip[].classes must be a string or array";}()),u=function(){if(!t.dateRegex.test(n.date))throw"flashTooltip[].date must be a valid date string";return n.date}();return Object.freeze({action:"flashTooltip",text:i,classes:r,date:u})}return n.flashTooltip===undefined?[]:Array.isArray(n.flashTooltip)?t.map(n.flashTooltip,i):[i(n.flashTooltip)]}())}function ft(t){t.action==="flashTooltip"&&k.flashTooltip(n("td.date-"+t.date,r),t.text,t.classes)}function et(){var i,e,f,u;y===0&&b&&(k.updateUi(),n("td a.ui-state-highlight").removeClass("ui-state-highlight"),n("td a.ui-state-active").removeClass("ui-state-active"),i=ot(),e=t.toDateString(r.datepicker("option","maxDate")),i.lastDate>e&&(i.lastDate>h.furthestDateAvailableFromServer?(f=t.splitIntoHtmlLines(t.format(o.resources.limitOfData,{PhoneNumber:o.property.TelephoneNumber}),"|"),u=n('<div class="calendar-overlay calendar-overlay-limit-of-data"><div class="calendar-overlay-text"><p><\/p><\/div><\/div>'),u.find("div.calendar-overlay-text").find("p").html(f),i.$tableElem.after(u),u.append(i.$tableElem)):i.lastDate>s.furthestDateLoaded&&(f=t.splitIntoHtmlLines(t.format(o.resources.dataLoading,{})),u=n('<div class="calendar-overlay calendar-overlay-data-loading"><div class="calendar-overlay-text"><p><\/p><\/div><\/div>'),u.find("div.calendar-overlay-text").find("p").html(f),i.$tableElem.after(u),u.append(i.$tableElem))),p.length>0&&(p.forEach(ft),p=[]))}function ot(){var i;if(a.monthsToShow===1)return i=t.toDateString(new Date(v.year,v.month-1)),{month:v.month,year:v.year,lastDate:t.endOfMonth(i),$tableElem:n("table.ui-datepicker-calendar",r)};var e=t.toDateString(new Date(v.year,v.month-1)),u=t.addMonths(e,a.monthsToShow-1),f=t.parseDate(u);return{month:f.getMonth()+1,year:f.getFullYear(),lastDate:t.endOfMonth(u),$tableElem:n(".ui-datepicker-group-last table.ui-datepicker-calendar",r)}}function st(i){if(!(i instanceof n))throw"$cell must be a jQuery object";if(i.length!==1)throw"$cell must refer to one element";var r=t.cssClassStringToArray(i.prop("class")),u=t.single(r,function(n){return e.test(n)});return e.exec(u)[1]}function ht(){r.datepicker("destroy");r.empty().removeClass("calendar-displayed");w&&w.destroy()}var y=0,b=!1,p=[],v={month:a.month,year:a.year},k=i(r),d="en-gb",g,nt,w;o.resources.selectedCultureLanguageCode!=null&&(d=o.resources.selectedCultureLanguageCode);g=new Date;nt=g.evStandardFirstDayCalendarOffset(d);r.datepicker({numberOfMonths:a.monthsToShow,showButtonPanel:!1,showOtherMonths:!1,minDate:new Date,dateFormat:o.resources.dateDisplayFormat,altFormat:o.resources.dateDisplayFormat,firstDay:nt,onChangeMonthYear:function(n,i){var r,u,f;y===0&&(v={month:i,year:n},s.furthestDateLoaded===h.furthestDateAvailableFromServer||h.dataLoadPending||(r=t.toDateString(new Date(n,i-1)),u=t.endOfMonth(t.addMonths(r,o.preloadMonths)),u>s.furthestDateLoaded&&(f=t.endOfMonth(t.addMonths(s.furthestDateLoaded,o.preloadMonths)),h.loadAvailabilityDataBetweenDates(s.furthestDateLoaded,t.clampAbove(h.furthestDateAvailableFromServer)(f)))))},afterShow:et,beforeShowDay:function(n){var r=c.dateState(t.toDateString(n)),i=rt(n,r);return[i.clickable,i.classes.join(" "),i.tooltip.text]},onSelect:function(n,i){var r=new Date(i.selectedYear,i.selectedMonth,i.selectedDay),u=t.toDateString(r),f=c.onDateSelect(u),e=ut(f);Array.prototype.push.apply(p,e)}});w=f?u.attach(r[0]):null;r.on("mouseover","table.ui-datepicker-calendar td",undefined,function(i){var u=n(i.target).parents("td"),f;u.hasClass("not-clickable")||(u.hasClass("dep-available")||u.hasClass("dep-forcedDeparture"))&&(f=st(u),t.forEachDayBetween(t.addDays(c.selectedArrivalDate,1),f,function(t){var i=t===f?"hover-checkout":"hover-interim";n("td.date-"+t,r).addClass(i)}))}).on("mouseout","table.ui-datepicker-calendar td",undefined,function(){n("td",r).removeClass("hover-interim hover-checkout")});return Object.freeze({updateUi:tt,get drawState(){return{month:v.month,year:v.year,monthsToShow:r.datepicker("option","monthsToShow")}},destroy:ht})}}}(jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.ui.calendarTooltips,window.eviivo.availabilityCalendar.ui.tooltipResourceParser,window.FastClick,window.eviivo.utils.isMobile);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.responsiveCalendar=function(n,t,i){function r(i){var e,o,r,u,f,s,h;if(i.is(function(t,i){return n(i).data("months-to-show")===undefined}))throw"One or more calendar container elems does not have a data-months-to-show attribute";if(e=t.$hasCount(i,1,function(t){var i=n(t);return i.data("min-width")===undefined||i.data("min-width")===0}),!e)throw"There is either no, or more than one, calendar container elem that has either not specified min-width or has a min-width of 0. There must be one and only one.";if(o=t.$hasCount(i,1,function(t){var i=n(t);return i.data("max-width")===undefined}),!o)throw"There is either no, or more than one, calendar container elem that has not specified max-width. There must be one and only one.";if(r=[],i.each(function(i,u){for(var h,s=n(u),e=parseInt(s.data("min-width")||0),o=parseInt(s.data("max-width")||t.MAX_SAFE_INTEGER),f=0;f<r.length;f++)if(e>=r[f].min&&e<=r[f].max)throw"Element `"+t.$elemSummary(s)+"`'s min-width conflicts with element `"+t.$elemSummary(r[f].$elem)+"`'s range";else if(o>=r[f].min&&o<=r[f].max)throw"Element `"+t.$elemSummary(s)+"`'s max-width conflicts with element `"+t.$elemSummary(r[f].$elem)+"`'s range";h=function(){if(e!==0&&o!==t.MAX_SAFE_INTEGER)return"(min-width: "+e+"px) and (max-width: "+o+"px)";if(e!==0)return"(min-width: "+e+"px)";if(o!==t.MAX_SAFE_INTEGER)return"(max-width: "+o+"px)";throw"Algorithm error";}();r.push(Object.freeze({min:e,max:o,monthsToShow:s.data("months-to-show"),$elem:s,get isCurrentlyApplicable(){return Modernizr.mq(h)}}))}),r.sort(function(n,t){return n.min-t.min}),r[0].min!==0)throw"Algorithm error: First range does not have a min-width of 0";if(r[r.length-1].max!==t.MAX_SAFE_INTEGER)throw"Algorithm error: Last range does not have a max-width of MAX_SAFE_INTEGER";for(u=1;u<r.length;u++)if(f=r[u],f.min!==r[u-1].max+1){s=f.min<r[u-1].max?f.min:r[u-1].max;h=f.min<r[u-1].max?r[u-1].max:f.min;throw"There is gap in the calendar width ranges - all possible window widths must be accounted for. Gap is between "+s+" and "+h;}return Object.freeze(r)}return function(n,u,f,e,o){function a(){for(var i,n=null,t=0;t<c.length;t++)if(i=c[t],i.isCurrentlyApplicable){if(n!==null)throw"Algorithm error: More than one applicable element";n=i}if(n===null)throw"Algorithm error: No elem is applicable at the moment";return n}function v(){var n=a();n!==h&&y(n);s.updateUi()}function y(n){var r,i;console.log("Switching to :"+t.$elemSummary(n.$elem));f.selectedArrivalDate!==null?(i=t.parseDate(f.selectedArrivalDate),r={month:i.getMonth()+1,year:i.getFullYear()}):s!==null?r=s.drawState:(i=new Date,r={month:i.getMonth()+1,year:i.getFullYear()});s!==null&&s.destroy();s=null;h=null;h=n;r.monthsToShow=h.monthsToShow;s=l(h.$elem,r);h.$elem.addClass("calendar-displayed")}var l=i(u,e,o,f),c=r(n),h=null,s=null;return{updateUi:v}}}(jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.ui.calendar);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.states=window.eviivo.availabilityCalendar.ui.states||{};window.eviivo.availabilityCalendar.ui.states.arrival=function(n){return function(){return Object.freeze({dateState:function(t,i){var r=i.arrivalCache(n.today(),t.selectedRoomTypes);return function(t,i){r.tryEnsureWindow(i);var u=r.arrival[i];if(i<n.today())return{classes:"arr-past",clickable:!1};if(i>r.dateCalculatedTo)return{classes:"arr-unknown",clickable:!1};if(u)return{classes:n.prefixAll("arr-",u.split("/")),clickable:u==="available"};throw"UNKNOWN DATE STATE";}},onDateSelect:function(n,t){n.transitionState("departure",t,n.selectedOccupancies,n.selectedRoomTypes)},allowShowPrices:!1,allowClearDates:!1,transitionFunc:function(n,t){this.state.selectedArrivalDate=null;this.state.selectedDepartureDate=null;this.state.selectedOccupancies=n;this.state.selectedRoomTypes=t}})}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.states=window.eviivo.availabilityCalendar.ui.states||{};window.eviivo.availabilityCalendar.ui.states.departure=function(n){function i(t,i){return n.prefixAll(t+"-",i.split("/"))}function t(t,i,r){for(var u=n.addDays(i,1);t[u]!==undefined;u=n.addDays(u,1))if(r(t[u]))return u;throw new"No date with condition";}return function(r,u){return Object.freeze({dateState:function(r,u){var f=u.arrivalDepartureCache(n.today(),r.selectedArrivalDate,r.selectedRoomTypes),o=t(f.departure,r.selectedArrivalDate,function(t){return n.isOneOf(t,"available","forcedDeparture/maxLos","forcedDeparture")}),e=n.nightsBetween(r.selectedArrivalDate,o);return function(r,u){var o,h,s;if(f.tryEnsureWindow(u),o=f.departure[u],u<n.today())return{classes:"dep-past",clickable:!1};if(u>f.dateCalculatedTo)return{classes:["dep-unknown"],clickable:!1};if(u<r.selectedArrivalDate)return{classes:["dep-beforeCheckInDate"].concat(i("arr",f.arrival[u])),clickable:f.arrival[u]==="available"};if(u===r.selectedArrivalDate)return{classes:"dep-checkInDate",clickable:!0,tooltipFormat:{MinLengthOfStay:e},forceShowOverride:e>1};if(o==="cannotDepart/minLos")return h=t(f.departure,u,function(n){return n!=="cannotDepart/minLos"}),{classes:["dep-cannotDepart","dep-minLos"],clickable:n.isOneOf(f.departure[h],"available","forcedDeparture/maxLos","forcedDeparture"),tooltipFormat:{MinLengthOfStay:f.minLengthOfStay}};if(o==="afterClosed")return s=f.arrival[u],{classes:["dep-afterClosed"].concat(n.prefixAll("arr-",s.split("/"))),clickable:s==="available"};if(o)return{classes:n.prefixAll("dep-",o.split("/")),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture")};throw"UNKNOWN DATE STATE";}},onDateSelect:function(t,i){var e,f,o;if(i<=t.selectedArrivalDate){t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes);return}if(e=u.getMinLengthOfStay(t.selectedArrivalDate,t.selectedRoomTypes),f=n.addDays(t.selectedArrivalDate,e),i<=f)return(t.transitionState("selected",t.selectedArrivalDate,f,t.selectedOccupancies,t.selectedRoomTypes),i<f)?{flashTooltip:{date:f,text:n.format(r.resources.forcedMinLos,{LengthOfStay:e}),classes:"tooltip-error"}}:void 0;o=u.getDepartureStates(t.selectedArrivalDate,i,t.selectedRoomTypes)[i];o==="afterClosed"?t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes):t.transitionState("selected",t.selectedArrivalDate,i,t.selectedOccupancies,t.selectedRoomTypes)},allowShowPrices:!1,allowClearDates:!0,transitionFunc:function(n,t,i){this.state.selectedArrivalDate=n;this.state.selectedDepartureDate=null;this.state.selectedOccupancies=t;this.state.selectedRoomTypes=i}})}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.states=window.eviivo.availabilityCalendar.ui.states||{};window.eviivo.availabilityCalendar.ui.states.selected=function(n){function t(t,i){return n.prefixAll(t+"-",i.split("/"))}return function(i,r){return Object.freeze({dateState:function(i,r){var u=r.arrivalDepartureCache(n.today(),i.selectedArrivalDate,i.selectedRoomTypes),f=n.nightsBetween(i.selectedArrivalDate,i.selectedDepartureDate);return function(i,r){var h;u.tryEnsureWindow(r);var s=u.arrival[r],o=u.departure[r],e={LengthOfStay:f,MinLengthOfStay:u.minLengthOfStay};if(r<n.today())return{classes:["selected-past"],clickable:!1,tooltipFormat:e};if(r>u.dateCalculatedTo)return{classes:["selected-unknown"],clickable:!1,tooltipFormat:e};if(r<i.selectedArrivalDate)return{classes:["selected-beforeCheckInDate"].concat(t("arr",s)),clickable:s==="available",tooltipFormat:e};if(r===i.selectedArrivalDate)return{classes:f>1?"selected-checkInDate":["selected-checkInDate","selected-lastNight"],clickable:!0,tooltipFormat:e};if(i.selectedArrivalDate<r&&r<i.selectedDepartureDate)return h=n.addDays(r,1)===i.selectedDepartureDate?["selected-lastNight"]:[],{classes:["selected-interim"].concat(h),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture","cannotDepart/minLos"),tooltipFormat:e};if(r===i.selectedDepartureDate)return{classes:["selected-checkOutDate"].concat(t("dep",o)),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture"),tooltipFormat:e};if(r>i.selectedDepartureDate&&o!=="afterClosed")return{classes:["selected-afterCheckOutDate"].concat(t("dep",o)),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture"),tooltipFormat:e};if(r>i.selectedDepartureDate&&o==="afterClosed")return{classes:["selected-afterCheckOutDate","dep-afterClosed"].concat(t("arr",s)),clickable:s==="available",tooltipFormat:e};throw"INVALID DATE STATE";}},onDateSelect:function(t,i){var u,f,e;i<=t.selectedArrivalDate?t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes):i<t.selectedDepartureDate?(u=r.getMinLengthOfStay(t.selectedArrivalDate,t.selectedRoomTypes),f=n.addDays(t.selectedArrivalDate,u),t.transitionState("selected",t.selectedArrivalDate,n.clampBelow(f)(i),t.selectedOccupancies,t.selectedRoomTypes)):(e=r.getDepartureStates(t.selectedArrivalDate,i,t.selectedRoomTypes)[i],e==="afterClosed"?t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes):t.transitionState("selected",t.selectedArrivalDate,i,t.selectedOccupancies,t.selectedRoomTypes))},allowShowPrices:!0,allowClearDates:!0,transitionFunc:function(n,t,i,r){this.state.selectedArrivalDate=n;this.state.selectedDepartureDate=t;this.state.selectedOccupancies=i;this.state.selectedRoomTypes=r}})}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.states=window.eviivo.availabilityCalendar.ui.states||{};window.eviivo.availabilityCalendar.ui.states.searchDone=function(n){return n}(window.eviivo.availabilityCalendar.ui.states.selected);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.stateMachine=function(){function f(n){var i;for(var r in n)if(n.hasOwnProperty(r))for(i in n[r])if(n[r].hasOwnProperty(i)&&(!t[i]||typeof n[r][i]!==t[i]))throw"Invalid state definition in availability calendar state machine";for(i in t)if(t.hasOwnProperty(i))for(r in n)if(n.hasOwnProperty(r)&&(n[r][i]===undefined||typeof n[r][i]!==t[i]))throw"Invalid state definition in availability calendar state machine";}var n=eviivo.availabilityCalendar.utils,i=n.immutableDeepClone(eviivo.availabilityCalendar.ui.states),r=[],u,t;for(u in i)r.push(u);return t=Object.freeze({dateState:"function",onDateSelect:"function",allowShowPrices:"boolean",allowClearDates:"boolean",transitionFunc:"function"}),function(t,u){function w(t){var r,f,c,i;if(!t||!e[t]||!e[t].transitionFunc||typeof e[t].transitionFunc!="function")throw"Invalid state to transition to";if(r=e[t].transitionFunc,r.length!==arguments.length-1)throw"Incorrect number of arguments for transition function";for(f=new Array(arguments.length-1),i=1;i<arguments.length;i++)f[i-1]=arguments[i];var w=o,a=n.immutableDeepClone(l),v=!1;try{if(y++,o=t,s=null,h=null,r.apply({state:l,stateMachine:this},f),this.selectedOccupancies!==undefined&&u.validator.validateOccupancies(this.selectedOccupancies))if(this.selectedRoomTypes===undefined||u.validator.validateRoomTypes(this.selectedOccupancies,this.selectedRoomTypes))if(this.selectedArrivalDate===null||u.validator.validateCheckInDate(this.selectedRoomTypes,this.selectedArrivalDate)){if(this.selectedArrivalDate===null&&this.selectedDepartureDate!==null)throw"Departure date set with no arrival date by state transition function";else if(this.selectedDepartureDate!==null&&!u.validator.validateCheckOutDate(this.selectedRoomTypes,this.selectedArrivalDate,this.selectedDepartureDate))throw"Invalid departure date set by state transition function";}else throw"Invalid arrival date set by state transition function";else throw"Invalid set of room types set by state transition function";else throw"Invalid occupancies set by state transition function";v=!0}catch(b){o=w;for(c in a)l[c]=a[c];console.error("Error during state transition: "+b)}finally{y--}if(v&&y===0)for(i=0;i<p.length;i++)p[i]()}var e={},v,c;for(v in i)e[v]=i[v](t,u);f(e);var o=null,l=function(){var i=null,r=null,u=null,t=undefined;return Object.freeze({get selectedArrivalDate(){return i},set selectedArrivalDate(t){if(t===null||n.dateRegex.test(t)===!0)i=t;else throw"Invalid date format";},get selectedDepartureDate(){return r},set selectedDepartureDate(t){if(t===null||n.dateRegex.test(t)===!0)r=t;else throw"Invalid date format";},get selectedOccupancies(){return u},set selectedOccupancies(t){if(!n.isValidOccupanciesArray(t))throw"Invalid occupancies array";u=Object.freeze(n.deepClone(t))},get selectedRoomTypes(){return t},set selectedRoomTypes(i){if(i===undefined)t=undefined;else if(n.isValidRoomTypeIdArray(i))t=Object.freeze(n.deepClone(i));else throw"Invalid room type array";}})}(),y=0,p=[],s=null,h=null;var a=n.readOnlyWrapper(l),d={get state(){return a},get stateName(){return o},get stateNames(){return n.deepClone(r)},get allowShowPrices(){return e[o].allowShowPrices},get allowClearDates(){return e[o].allowClearDates},get onDateSelect(){return s||(s=e[o].onDateSelect.bind(null,this)),s},get dateState(){if(!h){var n=window.eviivo.availabilityCalendar.logicCache(u,100),t=e[o].dateState(a,n);h=function(n){return t(a,n)}}return h},transitionState:w,forceRefresh:function(){s=null;h=null},attachListener:function(n){if(typeof n!="function")throw"func must be a function";p.push(n)}},b=Object.create(a,n.getOwnPropertyDescriptors(d)),k=[];for(c=2;c<arguments.length;c++)k[c-2]=arguments[c];return w.apply(b,k),Object.freeze(b)}}();window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.occupancySelector=function(n,t,i){return function(r,u,f,e){function k(){o=null;c()}function d(){o=t.deepClone(u.selectedOccupancies);c()}function g(t){var r,e,i;if(t.stopPropagation(),h.is(t.target))if(r=parseInt(h.val()),e=f.maximumOccupancy.adults==1?1:2,r>o.length)for(i=o.length;i<r;i++)o.push({adults:e,children:0});else for(i=o.length;i>r;i--)o.pop();else{var u=n(t.target),s=u.data("room"),l=u.hasClass("cp-select-roomAdults")?"adults":"children";o[s-1][l]=parseInt(u.val())}c()}function nt(t){var i,r;(t.stopPropagation(),i=n(t.target),i.hasClass("disabled"))||(r=i.data("room")-1,o.splice(r,1),c())}function tt(){var t=o,n=f.getCompatibleRoomTypesForOccupancies(t),i,e;o=null;u.selectedDepartureDate!==null&&f.validator.validateCheckOutDate(n,u.selectedArrivalDate,u.selectedDepartureDate)?u.transitionState("selected",u.selectedArrivalDate,u.selectedDepartureDate,t,n):u.selectedArrivalDate!==null&&f.validator.validateCheckInDate(n,u.selectedArrivalDate)?(i=u.selectedDepartureDate!==null,u.transitionState("departure",u.selectedArrivalDate,t,n),i&&r.trigger("calendar:error:checkOutDateReset")):(e=u.selectedArrivalDate!==null,u.transitionState("arrival",t,n),e&&r.trigger("calendar:error:datesReset"))}function c(){var n=o||u.selectedOccupancies,i=!f.hasCompatibleRoomTypesForOccupancy({adults:0,children:1});s.toggleClass("no-children",i);s.toggleClass("single-inventory",f.maximumInventory<=1);r.toggleClass("error",t.any(n,t.not(f.hasCompatibleRoomTypesForOccupancy)));it(n);rt(n);ut(n,i);ft(n)}function it(n){var i=t.range(1,f.maximumInventory),r=t.map(i,function(n){var i="";return i=n>1?e.roomCountOptionPlural:e.roomCountOption,'<option value="'+n+'">'+t.format(i,{roomNum:n})+"<\/option>"}).join("");h.data("ui-selectmenu")&&h.selectmenu("destroy");h.html(r).val(n.length).selectmenu({appendTo:a})}function rt(n){var i=n.length===0||t.any(n,t.not(f.hasCompatibleRoomTypesForOccupancy));b.prop("disabled",i)}function ut(n,i){var r=f.maximumOccupancy,u=t.map(t.range(1,r.adults),function(n){return'<option value="'+n+'">'+t.format(e.adults,{NumAdults:n})+"<\/option>"}).join(""),o=t.map(t.range(0,r.children),function(n){return'<option value="'+n+'">'+t.format(e.children,{NumChildren:n})+"<\/option>"}).join(""),s=t.map(n,function(r,s){var h=w.clone();return h.toggleClass("error",!f.hasCompatibleRoomTypesForOccupancy(r)),h.find("span.room").text(t.format(e.roomTitle,{roomNum:s+1})),h.find("select.cp-select-roomAdults").html(u).data("room",s+1).val(r.adults).selectmenu({appendTo:a}),h.find("select.cp-select-roomChildren").html(o).data("room",s+1).val(r.children).prop("disabled",i).selectmenu({appendTo:a}),h.find("a.btn-clear-row").data("room",s+1).toggleClass("disabled",n.length===1).prop("disabled",n.length===1),h});y.empty().append(s)}function ft(n){var t=et(n),i=p.text();t!==i&&p.finish().textFade(t,{beforeShow:function(){s.toggle().toggle()}})}function et(n){var i="";return t.all(n,function(n){return n.children===0})?(i=n.length>1?e.summaryFormatNoChildrenPlural:e.summaryFormatNoChildren,t.format(i,{adults:t.sum(n,"adults"),rooms:n.length})):(i=n.length>1?e.summaryFormatPlural:e.summaryFormat,t.format(i,{adults:t.sum(n,"adults"),children:t.sum(n,"children"),rooms:n.length}))}var v=n("span.cp-inputValues",r),s=n("div.cp-tooltip",r).on("selectmenuchange",g).on("customDropdown.hide",k).on("customDropdown.beforeShow",d),l=i(v,s),y=n("div.column-outer",s).on("click","a.btn-clear-row",undefined,nt),w=n("div.column-inner",y).detach(),b=n("#cp-done",s).on("click",function(){l.loading.show();window.setTimeout(tt,Math.random()*1e3)}),ot=n(".close-btn",s).on("click",function(){l.hide()}),h=n("select.cp-select-numberOfRooms",s),p=n("span",v),a=n("div.ui-selectmenus",s),o=null;return u.attachListener(l.hide),Object.freeze({updateUi:c})}}(window.jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.customDropdown);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.roomFilter=function(n,t,i){return function(r,u,f,e){function g(n){var r=n.data("selectable"),t,i;r&&(t=n.data("room"),i=o.indexOf(t),i!==-1?o.splice(i,1):o.push(t),h())}function nt(){var n=o,t,i;o=null;u.selectedDepartureDate!==null&&f.validator.validateCheckOutDate(n,u.selectedArrivalDate,u.selectedDepartureDate)?u.transitionState("selected",u.selectedArrivalDate,u.selectedDepartureDate,u.selectedOccupancies,n):u.selectedArrivalDate!==null&&f.validator.validateCheckInDate(n,u.selectedArrivalDate)?(t=u.selectedDepartureDate!==null,u.transitionState("departure",u.selectedArrivalDate,u.selectedOccupancies,n),t&&r.trigger("calendar:error:checkOutDateReset")):(i=u.selectedArrivalDate!==null,u.transitionState("arrival",u.selectedOccupancies,n),i&&r.trigger("calendar:error:datesReset"))}function h(){var i=o||u.selectedRoomTypes||f.roomTypeIds,n=t.numericSort(f.getCompatibleRoomTypesForOccupancies(u.selectedOccupancies)),r=t.numericSort(t.setDifference(f.roomTypeIds,n));tt(i,n);it(i);ut(n);rt();ft(i,n,r)}function tt(n,t){var i=!f.isRoomSelectionAbleToSatisfyOccupancies(n,u.selectedOccupancies);p.prop("disabled",i).attr("title",i?e.selectionCannotSatisfyOccupancies:null);w.prop("disabled",n===undefined||n.length===t.length);b.prop("disabled",n!==undefined&&n.length===0)}function it(n){var r="",i;r=l>0?e.summaryFormatPlural:e.summaryFormat;i=t.format(r,{SelectedRooms:n.length,TotalRooms:l});v.text()!==i&&v.finish().textFade(i,{beforeShow:function(){s.toggle().toggle()}})}function rt(){var t=n("div.column-roomFilter");l>6&&t.addClass("is--scrollable")}function ut(n){var i="",r;i=n.length>1?e.requirementsSummaryPlural:e.requirementsSummary;r=t.format(i,{AvailableRooms:n.length});k.text(r)}function ft(t,i,r){function u(i,r){var u=d.clone().data("room",i).data("selectable",r),f="roomFilter-roomType-"+i;return n("label",u).attr("for",f),n("input.roomType",u).attr("id",f).prop("checked",t.indexOf(i)!==-1).prop("disabled",!r),n("span.roomName",u).text(e[i]),u}var e=f.roomTypes,o=n.map(i,function(n){return u(n,!0)}),s=n.map(r,function(n){return u(n,!1)});y.empty().append(o).append(s)}var o=null,a=n("span.cp-input",r),v=n("span.summary",a),s=n("div.cp-tooltip",r).on("customDropdown.beforeShow",function(){o=u.selectedRoomTypes!==undefined?t.deepClone(u.selectedRoomTypes):f.getCompatibleRoomTypesForOccupancies(u.selectedOccupancies);h()}).on("customDropdown.hide",function(){o=null;h()}),c=i(a,s),l=f.roomTypeIds.length;u.attachListener(c.hide);var p=n("#acFilter-roomType-apply",s).on("click",function(){c.loading.show();window.setTimeout(nt,Math.random()*1e3)}),et=n(".close-btn",s).on("click",function(){c.hide()}),w=n("#acFilter-roomType-selectAll",s).on("click",function(){o=f.getCompatibleRoomTypesForOccupancies(u.selectedOccupancies);h()}),b=n("#acFilter-roomType-clearAll",s).on("click",function(){o=[];h()}),k=n("p.requirementsSummary",s),y=n("ul.mod-customDropdown-list",s).on("click","li",undefined,function(t){t.stopPropagation();t.preventDefault();g(n(t.currentTarget))}),d=n("li",y).detach();return Object.freeze({updateUi:h})}}(window.jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.customDropdown);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.chrome=function(n,t,i){return function(r,u,f){function e(i,r,u,f){var o;u=u||7500;o=n("#"+c+f).remove();i.tooltip({content:function(){return t.splitIntoHtmlLines(r,"|")},items:"*",position:{my:"center bottom-15",at:"center top+10",using:function(t,i){n(this).css(t);n("<div>").addClass("arrow").addClass(i.vertical).prependTo(this)}},show:!1,hide:!1,open:function(t,i){var r=n(i.tooltip),u=n(this),f=r.offset(),e=u.offset();u.append(r);r.css("left",f.left-e.left+"px").css("top",f.top-e.top+"px")}});i.tooltip("open");var s=i.data("ui-tooltip").tooltips,h=Object.getOwnPropertyNames(s)[0],e=n("#"+h).clone(!1,!1).attr("id",c+f).addClass("tooltip-error").css("z-index",t.MAX_SAFE_INTEGER).appendTo(i);i.tooltip("destroy");e.delay(u/5).removeClass("tooltip-error",{duration:u*2/5,easing:"swing",complete:function(){e.animate({opacity:0},{duration:u*2/5,easing:"swing",complete:function(){e.remove()}})}})}function a(i){var u,f;if(i instanceof Date)u=i;else if(typeof i=="string"&&t.dateRegex.test(i))u=t.parseDate(i);else throw"Unknown date format";return f=r.resources.dateDisplayFormat,n.datepicker.formatDate(f,u)}function k(){h.prop("disabled",!f.allowShowPrices).toggleClass("disabled",!f.allowShowPrices);b.prop("disabled",!f.allowClearDates).toggleClass("disabled",!f.allowClearDates);p.text(f.selectedArrivalDate?a(f.selectedArrivalDate):"");w.text(f.selectedDepartureDate?a(f.selectedDepartureDate):"");f.selectedArrivalDate&&f.selectedDepartureDate?l.text(t.nightsBetween(f.selectedArrivalDate,f.selectedDepartureDate)):l.text("")}function d(){u.trigger("calendar:submit")}var v=n("span.startDateTooltip",u).on("click",function(){f.allowShowPrices||e(v,r.resources.selectDatesError,1500,"dates")}),y=n("span.endDateTooltip",u).on("click",function(){f.allowShowPrices||e(y,r.resources.selectDatesError,1500,"dates")}),o=n("#checkin-text",u).on("click",function(){f.allowShowPrices||e(o,r.resources.selectDatesError,1500,"dates")}),p=n("span.date-format",o),s=n("#checkout-text",u).on("click",function(){f.allowShowPrices||e(s,r.resources.selectDatesError,1500,"dates")}),w=n("span.date-format",s),b=n("#clear-dates",u).on("click",function(){u.trigger("calendar:reset")}),g=n(".cp-button-price-wrapper button.cp-button-text",u).on("click",function(){u.addClass("searchExpanded")}),l=n("#numberOfNights span",u),h=n("button.cp-button-price",u).on("click",function(){f.transitionState("searchDone",f.selectedArrivalDate,f.selectedDepartureDate,f.selectedOccupancies,f.selectedRoomTypes);u.trigger("calendar:submit");var t=n("<div class='cp--loading'><span class='circle'><\/span><\/div>"),i=n(".results-item-group").append(t)}),c;h.next(".button-overlay").on("click",function(){e(h,r.resources.selectDatesError,1500,"button-overlay")});u.on("calendar:error:checkOutDateReset",function(){e(s,r.resources.checkOutIncompatible,3e3,"dates")}).on("calendar:error:datesReset",function(){e(o,r.resources.checkInIncompatible,3e3,"dates")});return c="chrome-tooltip-"+i()+"-",Object.freeze({updateUi:k,triggerSearch:d})}}(jQuery,window.eviivo.availabilityCalendar.utils,eviivo.utils.uuid);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar?window.eviivo.availabilityCalendar:{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui?window.eviivo.availabilityCalendar.ui:{};window.eviivo.availabilityCalendar.ui.main=function(n,t,i,r,u,f,e,o){n(function(){n.datepicker._updateDatepicker_original=n.datepicker._updateDatepicker;n.datepicker._updateDatepicker=function(t){n.datepicker._updateDatepicker_original(t);var i=this._get(t,"afterShow");i&&i.apply(t.input?t.input[0]:null)}});var s=Object.freeze({roomsLimit:3,eviivoSearchBoxId:"#eviivo-availability-search",cultureLanguageCode:"en-GB",baseSearchUrl:"",preloadMonths:6});return function(h,c,l){function nt(){var n=eviivo.util.debounce({func:p,unique:"updateUi"})}function p(){y.removeClass("pre-ui-init");y.removeClass(a.stateNames.join(" ")).addClass(a.stateName);w.updateUi();d.updateUi();k.updateUi();g.updateUi()}function tt(){w.triggerSearch()}function it(){var t={startDate:a.selectedArrivalDate,endDate:a.selectedDepartureDate,occupancy:a.selectedOccupancies,roomFilter:a.selectedRoomTypes},i=o.generateNewUrlFromCriteria(window.location.search,t,n("#ref").val());window.location.assign(v.baseSearchUrl+i)}function b(n){if(typeof n!="function")throw"func must be a function";var i=t.parseDate(t.addDays(t.today(),1)),r=i.getTime()+500-(new Date).getTime();window.setTimeout(function(){n();b(n)},r)}function rt(n){var f=function(){if(h.validator.validateOccupancies(n.occupancy))return n.occupancy;var t=h.validator.cleanOccupancies(n.occupancy);return h.validator.validateOccupancies(t)?cleanOccupancies:Object.freeze([Object.freeze({adults:1,children:0})])}(),e=function(){if(h.validator.validateRoomTypes(f,n.roomFilter))return n.roomFilter;var t=h.validator.cleanRoomTypes(f,n.roomFilter);return h.validator.validateRoomTypes(f,t)?t:undefined}(),u=n.startDate&&n.startDate>=t.today()&&h.validator.validateCheckInDate(e,n.startDate)?n.startDate:null,o=n.endDate&&u!==null&&n.endDate>u&&h.validator.validateCheckOutDate(e,u,n.endDate)?n.endDate:null,r;try{if(u===null&&o===null)return i(v,h,"arrival",f,e);if(u!==null&&o===null)return i(v,h,"departure",u,f,e);if(u===null)throw"Logic broken - check out date cannot be not null with a null check in date";else return i(v,h,"searchDone",u,o,f,e)}catch(s){r=document.location.href.toLowerCase();r.indexOf("enablecalendar=true")>-1?r=r.replace("enablecalendar=true","enablecalendar=false"):(r=r.indexOf("?")>-1?r+"&":r+"?",r=r+"enablecalendar=false");document.location.href=r;window.Sentry.captureException(new Error("Availability calendar broken"));throw"Availability calendar broken - Details:"+s;}}var v=t.immutableDeepClone(n.extend({},s,l)),a=rt(o.extractCriteriaFromUrl(window.location.search)),y=n(v.eviivoSearchBoxId),k=r(n("div.column-occupancy",y),a,h,v.resources.occupancySelector),w=u(v,y,a),d=f(n("div.column-roomFilter",y),a,h,v.resources.roomFilter),g=e(n(".calendar-display",y),v,a,h,c);b(p);window.addEventListener("resize",nt);h.attachListener(a.forceRefresh);h.attachListener(p);a.attachListener(p);y.on("calendar:submit",it);y.on("calendar:reset",function(){a.transitionState("arrival",a.selectedOccupancies,a.selectedRoomTypes)});return Object.freeze({updateUi:p,triggerSearch:tt})}}(jQuery,window.eviivo.availabilityCalendar.utils,eviivo.availabilityCalendar.ui.stateMachine,eviivo.availabilityCalendar.ui.occupancySelector,eviivo.availabilityCalendar.ui.chrome,eviivo.availabilityCalendar.ui.roomFilter,eviivo.availabilityCalendar.ui.responsiveCalendar,eviivo.availabilityCalendar.ui.urlHandler)