var Omni;!function(e){angular.module("omni",["ngResource","ngSanitize","ngAnimate","ngTouch","angular-cache","ngAria","duScroll","ui.bootstrap","ui.router","omni.core","omni.booker","omni.resortmap"])}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){function t(e){return e.moment}e.ngModule=angular.module("omni.core",[]);var o=function(){function e(e){angular.extend(e.defaults,{maxAge:9e5})}return e}();o.$inject=["CacheFactoryProvider"];var n=function(){function e(e,t){e.debugEnabled(t.DebugMode)}return e}();n.$inject=["$logProvider","appConfig"];var i=function(){function e(e){e.errorOnUnhandledRejections(!1)}return e}();i.$inject=["$qProvider"];var r=function(){function e(e,t){e.debugInfoEnabled(t.DebugMode),e.commentDirectivesEnabled(!1),e.cssClassDirectivesEnabled(!0)}return e}();r.$inject=["$compileProvider","appConfig"],t.$inject=["$window"],e.ngModule.config(i),e.ngModule.config(o),e.ngModule.config(n),e.ngModule.config(r),e.ngModule.factory("moment",t)}(t=e.Core||(e.Core={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t;!function(t){function o(){var e=new n,t=angular.element(document.querySelectorAll("input[name='ngDebug']"));return t&&t.length>0&&(e.DebugMode=!!t&&"True"===t.val()),e}var n=function(){function e(){this.DebugMode=!1}return e}();e.ngModule.constant("appConfig",o())}(t=e.Constants||(e.Constants={}))}(t=e.Core||(e.Core={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(){function e(e,t){this.$http=e,this.$log=t}return e.prototype.GetProfile=function(){var e=this,t={jsonpCallbackParam:"callback"};return this.$http.jsonp("/profile/profile/myaccount",t).then(function(e){return e.data.Data})["catch"](function(t){e.$log.debug(t)})},e}();t.$inject=["$http","$log"],e.ngModule.service("omni.core.profileservice",t)}(t=e.Core||(e.Core={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule=angular.module("omni.booker",[])}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("omniBookerBookHeader",{bindings:{propertyDetail:"="},templateUrl:"omni-booker-book-header.html",controller:(t=function(){function e(e,t,o){this.$log=e,this.bookerConfig=t,this.bookingService=o,this.opaqueBackground=this.bookerConfig.IsBookerOpaque}return e.prototype.CloseBooker=function(){this.bookingService.CloseBooker()},e}(),t.$inject=["$log","bookerConfig","omni.bookingservice"],t)});var t}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("omniBookerExplore",{bindings:{propertyDetail:"<"},controller:(t=function(){function e(e,t,o,n){this.bookingApiService=e,this.$window=t,this.bookingService=o,this.bookerConfig=n,this.showSpinner=!1,this.showExploreList=!1,this.showPropertyLink=this.bookerConfig.IsBrandPage()}return e.prototype.$onChanges=function(){this.propertyDetail&&this.getExploreData()},e.prototype.exploreProperty=function(e){this.$window.location.href=e},e.prototype.getExploreData=function(){var e=this;this.showExploreList=!1,this.showSpinner=!0,this.exploreData=void 0,this.propertyDetail.HotelId&&this.propertyDetail.HotelId.length>0&&this.bookingApiService.GetExploreData(this.propertyDetail.HotelId).then(function(t){e.exploreData=t,e.showExploreList=e.exploreData.length>1})["finally"](function(){e.showSpinner=!1})},e}(),t.$inject=["omni.bookingapiservice","$window","omni.bookingservice","bookerConfig"],t),templateUrl:"omni-booker-explore.html"});var t}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("omniBookerFindHeader",{bindings:{propertyDetail:"="},templateUrl:"omni-booker-find-header.html",controller:(t=function(){function e(e,t,o,n,i,r){var a=this;this.omniBookingService=e,this.omPropertyFilter=t,this.bookerConfig=o,this.$scope=n,this.$rootScope=i,this.$timeout=r,this.getLocalBookingData=function(){return a.findDataPromise?a.findDataPromise:(a.findDataPromise=a.omniBookingService.GetFindData(a.bookerConfig.IncludeGha),a.findDataPromise.then(function(e){a.propertyData=e}),a.findDataPromise)},this.opaqueBackground=this.bookerConfig.IsBookerOpaque,this.$scope.$on("bookerStateUpdate",function(){a.onBookerStateUpdate()})}return e.prototype.$onInit=function(){this.searchInput="",this.updateWhereGoingDisplay(),this.getLocalBookingData()},e.prototype.clearFind=function(){this.selectedProperty&&(this.selectedProperty.selected=!1,this.selectedProperty=void 0),this.selectedCategory=void 0,this.searchInput="",this.propertyDetail.HotelId="",this.propertyDetail.PropertyName="",this.showResults=!1,this.searchResults=[],this.focusSearchInput(),this.updateWhereGoingDisplay()},e.prototype.clearSelected=function(){this.selectedProperty&&(this.selectedProperty.selected=!1,this.selectedProperty=void 0),this.selectedCategory=void 0,this.propertyDetail.HotelId="",this.propertyDetail.PropertyName="",this.propertyDetail.IsComingSoon=!1,this.propertyDetail.ComingSoonText="",this.propertyDetail.HotelLink="",this.propertyDetail.RedeemFreeNights=!1,this.propertyDetail.IsVillas=!1,this.updateWhereGoingDisplay()},e.prototype.focusResult=function(e,t){var o=t+1,n=document.querySelectorAll(".result-category-list[data-category-name='"+e.category+"'] li:nth-child("+o+") a")[0];n.focus()},e.prototype.resultFocused=function(e){this.selectedProperty&&(this.selectedProperty.selected=!1),this.selectedCategory=e.category,this.selectedProperty=e,this.selectedProperty.selected=!0},e.prototype.selectResult=function(e){return e.IsGha?void this.clearFind():(this.selectedProperty&&(this.selectedProperty.selected=!1),this.selectedCategory=e.category,this.selectedProperty=e,this.selectedProperty.selected=!0,this.propertyDetail.HotelId=this.selectedProperty.ItemIdGuid,this.propertyDetail.PropertyName=this.selectedProperty.ResultLabel,this.propertyDetail.IsComingSoon=this.selectedProperty.IsComingSoonProperty,this.propertyDetail.ComingSoonText=this.selectedProperty.ComingSoonText,this.propertyDetail.HotelLink=this.selectedProperty.HotelLink,this.propertyDetail.RedeemFreeNights=this.selectedProperty.RedeemFreeNights,this.propertyDetail.IsVillas=this.selectedProperty.IsVillas,this.searchInput=this.propertyDetail.PropertyName,this.showResults=!1,void(this.searchResults=[]))},e.prototype.focusNextResult=function(){this.getSelectedCategory()||(this.selectedCategory=this.getFirstCategory().name);var e=this.getSelectedCategory(),t=e.results.indexOf(this.selectedProperty);e.results.length-1>t?this.focusResult(e.results[t+1],t+1):this.focusNextCategory()},e.prototype.focusPreviousResult=function(){this.getSelectedCategory()||(this.selectedCategory=this.getFirstCategory());var e=this.getSelectedCategory(),t=e.results.indexOf(this.selectedProperty);t>0?this.focusResult(e.results[t-1],t-1):this.focusPreviousCategory()},e.prototype.focusNextCategory=function(){if(this.getSelectedCategory()){for(var e=void 0,t=0,o=this.searchResults.length;t<o;t++)if(this.searchResults[t].name===this.selectedCategory){if(t==o-1)return;e=this.searchResults[t+1]}this.selectedCategory=e.name}else this.selectedCategory=this.getFirstCategory().name;this.focusResult(this.getSelectedCategory().results[0],0)},e.prototype.focusPreviousCategory=function(){if(this.getSelectedCategory()){for(var e=void 0,t=0,o=this.searchResults.length;t<o;t++)if(this.searchResults[t].name===this.selectedCategory){if(0==t)return;e=this.searchResults[t-1]}this.selectedCategory=e.name}else this.selectedCategory=this.getFirstCategory().name;var n=this.getSelectedCategory().results.length;this.focusResult(this.getSelectedCategory().results[n-1],n-1)},e.prototype.keyupInSearch=function(e){e.key.indexOf("Up")>=0?(this.focusSearchResults(),e.preventDefault()):e.key.indexOf("Down")>=0?(this.focusSearchResults(),e.preventDefault()):e.key.indexOf("Escape")>=0&&this.clearFind()},e.prototype.keyupInResults=function(e){if(e.key.indexOf("Up")>=0)this.focusPreviousResult(),e.preventDefault();else if(e.key.indexOf("Down")>=0)this.focusNextResult(),e.preventDefault();else if(e.key.indexOf("Enter")>=0){var t=this.getSelectedResult();void 0==t?this.showSelectionMessage=!0:(this.showSelectionMessage=!1,this.selectResult(t))}else e.key.indexOf("Escape")>=0&&this.clearFind()},e.prototype.keydown=function(e){(e.key.indexOf("Up")>=0||e.key.indexOf("Down")>=0)&&(e.preventDefault(),e.view.event.preventDefault())},e.prototype.filterAutocompleteData=function(){var e=this;return this.updateWhereGoingDisplay(),this.selectedProperty&&(this.selectedProperty.selected=!1,this.selectedProperty=void 0),this.searchInput.length<3?(this.searchResults=[],void(this.showResults=!1)):void this.getLocalBookingData().then(function(){e.showResults=!0,e.selectedProperty&&(e.selectedProperty.selected=!1),e.selectedCategory=void 0,e.selectedProperty=void 0,e.searchResults=e.omPropertyFilter(e.propertyData,e.searchInput);var t=e.searchResults.reduce(function(t,o){for(var n=void 0,i=0,r=t.length;i<r;i++)t[i].name===o.category&&(n=t[i]);return n?"City"===o.category?o.label.toLowerCase().indexOf(e.searchInput.toLowerCase())>=0&&o.ResultLabel.toLowerCase().indexOf(e.searchInput.toLowerCase())>=0&&n.results.push(o):n.results.push(o):"City"===o.category?o.label.toLowerCase().indexOf(e.searchInput.toLowerCase())>=0&&o.ResultLabel.toLowerCase().indexOf(e.searchInput.toLowerCase())>=0&&t.push({name:o.category,results:[o]}):t.push({name:o.category,results:[o]}),t},[]);t.forEach(function(e){e.results.sort(function(e,t){return e.IsGha&&!t.IsGha?1:0})}),e.searchResults=t})},e.prototype.getSelectedResult=function(){var e=void 0;if(this.getSelectedCategory())for(var t=this.getSelectedCategory(),o=0,n=t.results.length;o<n;o++)t.results[o].selected&&(e=t.results[o]);return e},e.prototype.getSelectedCategory=function(){for(var e=void 0,t=0,o=this.searchResults.length;t<o;t++)this.searchResults[t].name===this.selectedCategory&&(e=this.searchResults[t]);return e},e.prototype.getFirstCategory=function(){var e=void 0;return this.searchResults&&this.searchResults.length>0&&(e=this.searchResults[0]),e},e.prototype.updateWhereGoingDisplay=function(){0===this.searchInput.length?this.showWhereGoingLabel=!0:this.showWhereGoingLabel=!1},e.prototype.onBookerStateUpdate=function(){this.focusSearchInput()},e.prototype.focusSearchInput=function(){this.$timeout(function(){angular.element("#where-going").focus()},500)},e.prototype.focusSearchResults=function(){this.$timeout(function(){var e=document.querySelectorAll(".result-category-list:first-of-type li:first-of-type a")[0];e.focus()},75)},e}(),t.$inject=["omni.bookingapiservice","omPropertyFilterFilter","bookerConfig","$scope","$rootScope","$timeout"],t)});var t}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(e){var t=e.get("omni-booker-navigation.html");return t?"omni-booker-navigation.html":"omni/assets/booker/booker.defaultnav.html"};t.$inject=["$templateCache"],e.NgModule.component("omniBookerNavigation",{controller:(o=function(){function e(e,t,o,n,i){var r=this;this.$rootScope=e,this.$scope=t,this.$document=o,this.$window=n,this.bookingService=i,this.onBookerStateUpdate(),this.$scope.$on("bookerStateUpdate",function(){r.onBookerStateUpdate()})}return e.prototype.ToggleNavigation=function(){this.isBookerVisible()?this.bookingService.ToggleBooker():this.bookingService.OpenBooker()},e.prototype.isBookerVisible=function(){var e=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return this.$document.scrollTop()<e/2},e.prototype.scrollToTop=function(){var t=0,o=0,n=e.scrollDuration;this.$document.duScrollTo(t,o,n)},e.prototype.onBookerStateUpdate=function(){var e=this.bookingService.GetBookerState();this.ShowBooker=e.IsEnabled,this.Expanded=e.IsExpanded,this.BrandPage=e.IsBrandPage,this.Expanded&&this.scrollToTop()},e}(),o.scrollDuration=0,o.$inject=["$rootScope","$scope","$document","$window","omni.bookingservice"],o),templateUrl:t});var o}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(){function e(){}return e}();e.PropertyDetail=t;var o=function(){function e(){}return e}();e.TravelDates=o;var n=function(){function e(){this.RoomCount=0,this.Rooms=[],this.BedRoomCount=null,this.VillasView=null}return e}();e.RoomDetail=n;var i=function(){function e(){var t=this;this.ShowOccupancyAlert=function(){return t.AdultCount+t.ChildCount>=e.OccupancyAlertNumber},this.AdultCount=0,this.ChildCount=0,this.ChildAges=[]}return e}();i.OccupancyAlertNumber=5,e.Room=i;var r=function(){function e(){}return e}();e.RateCodes=r,e.NgModule.component("omniBooker",{bindings:{currentPropertyData:"@"},controller:(a=function(){function e(e,t,o,n,i,r,a,s){var l=this;this.$window=e,this.$document=t,this.moment=o,this.BookingApiService=n,this.BookingService=i,this.$log=r,this.$scope=a,this.$timeout=s,this.addMarginOnAlert(),e.addEventListener("resize",function(){l.addMarginOnAlert()}),t.bind("keydown",function(e){27===e.keyCode?(l.closeBookerEvent(),l.$scope.$apply()):9===e.keyCode&&(l.tabBookerEvent(e),l.$scope.$apply())})}return e.prototype.$onInit=function(){var e=this;this.PropertyDetailData=this.BookingService.GetPropertyDetail(),this.TravelDatesData=this.BookingService.GetTravelDates(),this.RoomDetailData=this.BookingService.GetRoomDetails(),this.RateCodesData=this.BookingService.GetRateCodes(),this.isArrivalOpen=!1,this.isDepartOpen=!1,this.BookingService.PutTravelDates(this.TravelDatesData),this.BookingService.PutRateCodes(this.RateCodesData);var t=JSON.parse(this.currentPropertyData);t?(this.findEnabled=!1,this.PropertyDetailData.HotelId=t.PropertyId,this.PropertyDetailData.PropertyName=t.PropertyName,this.PropertyDetailData.IsComingSoon=t.IsComingSoon,this.PropertyDetailData.ComingSoonText=t.ComingSoonText,this.PropertyDetailData.HotelLink=t.HotelLink,this.PropertyDetailData.RedeemFreeNights=t.RedeemFreeNights,this.PropertyDetailData.IsVillas=t.IsVillasProperty,this.focusArrivalDate()):this.findEnabled=!0,this.$scope.$watch(function(){return e.findEnabled},function(t){e.$log.debug("FindEnabled flipped"),t===!1&&e.focusArrivalDate()}),this.$log.debug("widget-data=",t),this.$log.debug("propertyData=",this.PropertyDetailData),this.$log.debug("travelData=",this.TravelDatesData),this.$log.debug("roomData=",this.RoomDetailData),this.$log.debug("rateData=",this.RateCodesData)},e.prototype.NavigateToHotel=function(){this.$window.location.href=this.PropertyDetailData.HotelLink},e.prototype.SubmitBooking=function(){var e=this;this.BookingApiService.GetBookingLink(this.PropertyDetailData,this.TravelDatesData,this.RoomDetailData,this.RateCodesData).then(function(t){e.$log.debug("setting booking url",t),e.$window.location.href=t})},e.prototype.CollapseCalendar=function(e){"SetArrival"===e&&(this.isDepartOpen=!1),"SetDeparture"===e&&(this.isArrivalOpen=!1)},e.prototype.focusArrivalDate=function(){this.$timeout(function(){var e=document.querySelectorAll(".calendar-arrival .om-bk-date-range")[0];e&&e.focus()},200)},e.prototype.focusDepartureDate=function(){this.$timeout(function(){var e=document.querySelectorAll(".calendar-departure .om-bk-date-range")[0];e&&e.focus()},200)},e.prototype.addMarginOnAlert=function(){if(angular.element(".security-alert").is(":visible")){var e="0px";screen.width>991?e="40px":screen.width<=991&&screen.width>=768?e="35px":screen.width<=767&&screen.width>=550?e="30px":screen.width<550&&(e="25px"),angular.element("omni-booker").css("margin-top",e)}},e.prototype.closeBookerEvent=function(){this.BookingService.CloseBooker()},e.prototype.tabBookerEvent=function(e){this.BookingService.TabBooker(e)},e}(),a.$inject=["$window","$document","moment","omni.bookingapiservice","omni.bookingservice","$log","$scope","$timeout"],a),templateUrl:"omni-booker.html"});var a}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("rateConfirmModal",{templateUrl:"rate-confirm-modal.html",bindings:{message:"@",close:"&",dismiss:"&"},controller:function(){var e=this;e.$onInit=function(){},e.ok=function(){e.close({$value:"confirm"})},e.cancel=function(){e.dismiss({$value:"cancel"})}}})}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(){function e(){}return e}();e.BedroomOption=t;var o=function(){function e(){}return e}();e.ViewOption=o,e.NgModule.component("omniBookerRoomDetails",{templateUrl:"omni-booker-room-details.html",bindings:{roomDetails:"=",propertyDetail:"="},controller:(n=function(){function t(e){this.$log=e,this.RoomCountOptions=[1,2,3],this.AdultCountOptions=[1,2,3,4],this.ChildCountOptions=[0,1,2,3,4],this.ChildAgeOptions=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],this.AdultVillasCountOptions=[1,2,3,4,5,6,7,8,9,10,11,12],this.BedroomCountOptions=[],this.VillasViewOptions=[];var t="bedroom (per Villa)";this.BedroomCountOptions.push({Count:1,Label:"1   "+t}),this.BedroomCountOptions.push({Count:2,Label:"2   "+t}),this.BedroomCountOptions.push({Count:3,Label:"3   "+t}),this.BedroomCountOptions.push({Count:4,Label:"4+ "+t}),this.VillasViewOptions.push({Value:"ocean",Label:"Ocean View"}),this.VillasViewOptions.push({Value:"nature",Label:"Nature View"})}return t.prototype.createDefaultRoom=function(){var t=new e.Room;return t.AdultCount=2,t.ChildCount=0,t},t.prototype.onRoomCountChanged=function(){var e=this.roomDetails.Rooms.length,t=this.roomDetails.RoomCount;if(e!==t){var o=Math.abs(e-t),n=e<t;if(n)for(var i=0;i<o;i++){var r=this.createDefaultRoom();this.roomDetails.Rooms.push(r)}else this.roomDetails.Rooms.splice(e-o,o);this.$log.debug("change hit",this.roomDetails)}},t.prototype.onChildCountChanged=function(e){var t=e.ChildAges.length,o=e.ChildCount;if(t!==o){var n=Math.abs(t-o),i=t<o;if(i)for(var r=0;r<n;r++)e.ChildAges.push(void 0);else e.ChildAges.splice(t-n,n);this.$log.debug("change hit",this.roomDetails)}},t}(),n.$inject=["$log"],n)});var n}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("signInModal",{templateUrl:"sign-in-modal",bindings:{message:"@",close:"&",dismiss:"&"},controller:(t=function(){function e(){var e=this;this.ok=function(){e.close({$value:"confirm"})},this.cancel=function(){e.dismiss({$value:"cancel"})}}return e.prototype.$onInit=function(){},e}(),t.$inject=[],t)});var t}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.NgModule.component("omniBookerSpecialRates",{bindings:{propertyDetail:"=",rateInformation:"="},controller:(t=function(){function e(e,t,o,n,i,r){var a=this;this.$log=e,this.$uibModal=t,this.$q=o,this.profileService=n,this.bookingService=i,this.bookerConfig=r,this.rateCodeInterpreter=function(e){if(!e)return a.rateInformation.RateCode;var t=a.rateInformation.RateCode;a.rateInformation.RateCode=e,a.openComponentModal().then(function(o){"ok"===o?(a.rateInformation.GroupCode="",a.rateInformation.PromoCode="",a.rateInformation.RateCode=e):a.rateInformation.RateCode=t})["finally"](function(){a.syncToService()})},this.groupCodeInterpreter=function(e){if("undefined"==typeof e)return a.rateInformation.GroupCode;if("group_code"===a.rateInformation.RateCode)return a.rateInformation.GroupCode=e,a.syncToService(),a.rateInformation.GroupCode;var t=a.rateInformation.GroupCode;a.openComponentModal().then(function(o){"ok"===o?(a.rateInformation.RateCode="group_code",a.rateInformation.PromoCode="",a.rateInformation.GroupCode=e):a.rateInformation.GroupCode=t})["finally"](function(){a.syncToService()})},this.promoCodeInterpreter=function(e){if("undefined"==typeof e)return a.rateInformation.PromoCode;if("promotional_code"===a.rateInformation.RateCode)return a.rateInformation.PromoCode=e,a.syncToService(),a.rateInformation.PromoCode;var t=a.rateInformation.PromoCode;a.openComponentModal().then(function(o){"ok"===o?(a.rateInformation.RateCode="promotional_code",a.rateInformation.GroupCode="",a.rateInformation.PromoCode=e):a.rateInformation.PromoCode=t})["finally"](function(){a.syncToService()})},this.freeNightsInterpreter=function(e){if("undefined"==typeof e)return a.rateInformation.IsRedeemingFreeNights;var t=a.rateInformation.IsRedeemingFreeNights;a.rateInformation.IsRedeemingFreeNights=e,a.getUserProfile().then(function(){a.isUserSignedIn?a.syncToService():a.openSignInModal().then(function(e){"ok"===e||(a.rateInformation.IsRedeemingFreeNights=t,a.syncToService())})})},this.openComponentModal=function(){if(a.modalInstanceDeferred)return a.modalInstanceDeferred;var e=a.$q.defer(),t=!1,o=!1;if(angular.isDefined(a.rateInformation.PromoCode)&&a.rateInformation.PromoCode.length>0&&(t=!0),angular.isDefined(a.rateInformation.GroupCode)&&a.rateInformation.GroupCode.length>0&&(o=!0),!t&&!o)return e.resolve("ok"),e.promise;var n=a.$uibModal.open({animation:!0,component:"rateConfirmModal",resolve:{}});return n.result.then(function(t){a.$log.debug("modal-component ok'ed at: "+new Date),e.resolve("ok")},function(){a.$log.debug("modal-component dismissed at: "+new Date),e.resolve("cancel")})["finally"](function(){a.modalInstanceDeferred=void 0}),a.modalInstanceDeferred=e.promise,a.modalInstanceDeferred},this.openSignInModal=function(){if(a.signInModalInstanceDeferred)return a.signInModalInstanceDeferred;var e=a.$q.defer(),t=a.$uibModal.open({animation:!0,component:"signInModal",ariaLabelledBy:"sign-in-modal-title",resolve:{}});return t.result.then(function(t){a.$log.debug("signin-component ok'ed at: "+new Date),e.resolve("ok")},function(){a.$log.debug("signin-component dismissed at: "+new Date),e.resolve("cancel")})["finally"](function(){a.signInModalInstanceDeferred=void 0}),a.signInModalInstanceDeferred=e.promise,a.signInModalInstanceDeferred},this.getUserProfile=function(){return a.profileDeferred?a.profileDeferred:(a.profileDeferred=a.profileService.GetProfile(),a.profileDeferred.then(function(e){a.isUserSignedIn="true"===e.IsUserLoggedIn,a.userFreeNights=parseInt(e.FreeNights,10)}),a.profileDeferred)},this.expandRates=!1,this.displayExpedia=this.bookerConfig.ShowExpediaLink}return e.prototype.$onInit=function(){this.$log.debug("rateInfo=",this.rateInformation)},e.prototype.syncToService=function(){this.bookingService.PutRateCodes(this.rateInformation)},e.prototype.onPromoCodeClick=function(){document.getElementById("promoCode").focus()},e.prototype.onGroupCodeClick=function(){document.getElementById("groupCode").focus()},e}(),t.$inject=["$log","$uibModal","$q","omni.core.profileservice","omni.bookingservice","bookerConfig"],t),templateUrl:"omni-booker-special-rates.html"});var t}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t;!function(e){e[e.SetArrival=0]="SetArrival",e[e.SetDeparture=1]="SetDeparture"}(t||(t={})),e.NgModule.component("omniBookerTravelDate",{bindings:{controlId:"@",travelDates:"=",calendarClass:"@",calendarMode:"@",calchange:"&",label:"@",isOpened:"="},controller:(o=function(){function e(e,t,o,n){this.$window=e,this.$log=t,this.moment=o,this.bookingService=n,this.isOpened=!1}return e.prototype.$onInit=function(){var e=this.calendarMode;this.state=t[e],this.state==t.SetArrival&&(this.travelDates.ArrivalDate=this.getDefaultStartDate()),this.state==t.SetDeparture&&(this.travelDates.DepartureDate=this.getDefaultEndDate())},e.prototype.toggleCalendar=function(){this.isOpened=!this.isOpened,this.isOpened&&this.syncCalendar(),this.calchange({mode:this.calendarMode})},e.prototype.getDefaultStartDate=function(){return this.travelDates.ArrivalDate?this.travelDates.ArrivalDate:this.moment.utc(this.bookingService.GetCurrentDate())},e.prototype.getDefaultEndDate=function(){return this.travelDates.DepartureDate?this.travelDates.DepartureDate:this.moment.utc(this.bookingService.GetCurrentDate()).add("days",1)},e.prototype.syncCalendar=function(){this.selected=this._removeTime(this.moment.utc()),this.$log.debug("syncing calendar=",this.state),this.state===t.SetDeparture&&this.travelDates.DepartureDate?this.selected=this._removeTime(this.moment.utc(this.travelDates.DepartureDate)):this.state===t.SetArrival&&this.travelDates.ArrivalDate&&(this.selected=this._removeTime(this.moment.utc(this.travelDates.ArrivalDate))),this.month=this.selected.clone();var e=this.selected.clone();e.date(1),this._removeTime(e.day(0)),this._buildMonth(e,this.month)},e.prototype.isSelected=function(e){var o=this.moment.utc(this.travelDates.ArrivalDate),n=this.moment.utc(this.travelDates.DepartureDate);return!(this.state!==t.SetArrival||!this.moment.utc(e).isSame(o))||!(this.state!==t.SetDeparture||!this.moment.utc(e).isSame(n))},e.prototype.select=function(e){this.selected=e.date,this.$log.debug("selected=",this.selected);var o=this.moment.utc().startOf("day");if(this.selected.isBefore(o))return void this.$log.debug("cannot set date in past");if(this.state===t.SetArrival&&(this.travelDates.ArrivalDate=this.selected,this.travelDates.DepartureDate&&(this.selected.isAfter(this.travelDates.DepartureDate)||this.selected.isSame(this.travelDates.DepartureDate))&&(this.travelDates.DepartureDate=this.moment.utc(this.travelDates.ArrivalDate).add("days",1),this.syncToService()),e.isCurrentMonth===!1&&e.date.isAfter(this.month)&&this.nextMonth()),this.state===t.SetDeparture){var n=this.moment.utc(this.travelDates.ArrivalDate);if(n.isAfter(this.selected))return void this.$log.debug("cannot set departure earlier than arrival");if(this.selected.isSame(n))return void this.$log.debug("cannot set same dates");this.travelDates.DepartureDate=this.selected,this.syncToService()}this.toggleCalendar()},e.prototype.previousMonth=function(){var e=this.month.clone().subtract("1","months"),t=e.endOf("month");if(!this.moment.utc(t).isBefore()){var o=this.month.clone();this._removeTime(o.month(o.month()-1).date(1)),this.month.month(this.month.month()-1),this._buildMonth(o,this.month)}},e.prototype.nextMonth=function(e){if(e&&9===e&&this.$window.document.getElementById("prevMonth"+this.state).focus(),e&&13===e||!e){var t=this.month.clone();this._removeTime(t.month(t.month()+1).date(1)),this.month.month(this.month.month()+1),this._buildMonth(t,this.month)}},e.prototype.setTravelDateLabelFormat=function(t){return this.moment.utc(t).format(e.ShortDateFormat)},e.prototype.syncToService=function(){this.bookingService.PutTravelDates(this.travelDates)},e.prototype._removeTime=function(e){return e.day(0).hour(0).minute(0).second(0).millisecond(0)},e.prototype._buildMonth=function(e,t){this.weeks=[];for(var o=!1,n=e.clone(),i=n.month(),r=0;!o;)this.weeks.push({days:this._buildWeek(n.clone(),t)}),n.add(1,"w"),o=r++>2&&i!==n.month(),i=n.month()},e.prototype._buildWeek=function(e,t){for(var o=[],n=0;n<7;n++)o.push({name:e.format("dd").substring(0,1),arialabel:e.format("MMMM Do YYYY"),number:e.date(),isCurrentMonth:e.month()===t.month(),isToday:e.isSame(this.moment.utc(this.bookingService.GetCurrentDate()),"day"),isPast:this.isIllegalSelectionDate(e),date:e}),e=e.clone(),e.add(1,"d");return o},e.prototype.isIllegalSelectionDate=function(e){return!!e.isBefore(this.moment.utc(this.bookingService.GetCurrentDate()),"day")},e}(),o.ShortDateFormat="MM/DD/YYYY",o.$inject=["$window","$log","moment","omni.bookingservice"],o),templateUrl:"omni-booker-travel-date.html"});var o}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t;!function(t){function o(){var e=new i,t=angular.element("[name='om-booking-showbookingwidget']");e.ShowBookingWidget=!!t&&"True"===t.val();var o=angular.element("[name='om-booking-isbookeropaque']");e.IsBookerOpaque=!!o&&"True"===o.val();var n=angular.element("[name='om-booking-isbookeralwaysopen']");e.IsBookerAlwaysOpen=!!n&&"True"===n.val();var r=angular.element("[name='om-booking-isbookerexpanded']");e.IsBookerExpanded=!!r&&"True"===r.val();var a=angular.element("[name='om-booking-pagetype']");e.PageType=a?a.val():"";var s=angular.element("[name='om-booking-showexpedialink']");e.ShowExpediaLink=!!s&&"True"===s.val();var l=angular.element("[name='om-booking-includegha']");e.IncludeGha=!!l&&"True"===l.val();var c,u=angular.element("[name='om-booking-currentdate']");return c=u?new Date(parseInt(u.val())):new Date,e.CurrentDate=this.moment.utc(c).toDate(),e}function n(){var e=new r,t=angular.element("input[name='dateConfig']");if(t&&t.length>0){var o=JSON.parse(t.val());e.MonthsLong=o.LongMonthList.split(","),e.MonthsShort=o.ShortMonthList.split(","),e.WeekdaysLong=o.LongWeekdayList.split(","),e.WeekdaysShort=o.ShortWeekdayList.split(",")}return e}var i=function(){function e(){this.ShowBookingWidget=!1,this.IsBookerAlwaysOpen=!1,this.IsBookerOpaque=!1,this.IsBookerExpanded=!1,this.PageType="",this.CurrentDate=new Date,this.ShowExpediaLink=!1,this.IncludeGha=!1}return e.prototype.IsBrandPage=function(){return"Brand"===this.PageType},e.prototype.IsResortPage=function(){return"Resort"===this.PageType},e.prototype.IsHotelPage=function(){return"Hotel"===this.PageType},e}();e.NgModule.constant("bookerConfig",o());var r=function(){function e(){this.MonthsLong=[],this.MonthsShort=[],this.WeekdaysLong=[],this.WeekdaysShort=[]}return e}();e.NgModule.constant("dateConfig",n())}(t=e.Constants||(e.Constants={}))}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){function t(){return function(e){return"City"===e&&(e="City / State"),e}}function o(e){return function(t,o,n,i,r,a){if(o&&(t=t.replace(new RegExp("("+o+")","gi"),'<span class="search-highlight">$1</span>'),"Hotel"===n)){var s=i.replace(new RegExp("("+o+")","gi"),'<span class="search-highlight" >$1</span>');a&&(t=t.concat('<span class="gha-line-break"></span>')),t=t.concat('<span class="search-highlight-small">'+s+", "+r+"</span>"),a&&(t=t.concat(' <span class="search-highlight-small gha-search-badge">(DISCOVERY Partner)</span>'))}return e.trustAsHtml(t)}}function n(){return function(e,t){e=e||[];for(var o=[],n=0,i=e.length;n<i;n++){var r=e[n];r.label.search(new RegExp(t,"i"))>=0&&o.push(r)}return o}}t.$inject=[],e.NgModule.filter("changeCategoryTitle",t),o.$inject=["$sce"],e.NgModule.filter("searchHighlight",o),n.$inject=[],e.NgModule.filter("omPropertyFilter",n)}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(){function e(){this.Country="-1",this.City="-1",this.Brand="-1",this.Hotel="-1"}return e}();e.GlobalBookerDetails=t;var o=function(){function e(){this.BookingStartDate="",this.BookingEndDate="",this.RoomQuantity="",this.Room1AdultQuantity="",this.Room1ChildQuantity="",this.Room1ChildAge1="",this.Room1ChildAge2="",this.Room1ChildAge3="",this.Room1ChildAge4="",this.Room2AdultQuantity="",this.Room2ChildQuantity="",this.Room2ChildAge1="",this.Room2ChildAge2="",this.Room2ChildAge3="",this.Room2ChildAge4="",this.Room3AdultQuantity="",this.Room3ChildQuantity="",this.Room3ChildAge1="",this.Room3ChildAge2="",this.Room3ChildAge3="",this.Room3ChildAge4="",this.AccountCode="",this.GroupCode="",this.AdaAccessible="",this.HotelId="",this.Rates="",this.TravelAgentNumber="",this.IsRedeemingFreeNights=!1,this.VillasBedRoomQuantity="",this.VillasView=""}return e}(),n=function(){function e(){this.StartDate="",this.EndDate="",this.Country="",this.City="",this.HotelBrand="",this.Hotel=""}return e}(),i=function(){function t(e,t,o,n){this.$http=e,this.$log=t,this.$q=o,this.moment=n}return t.prototype.GetBookingLink=function(e,t,o,n){var i=this,r=this.generateBookingDetailModel(e,t,o,n);return this.$http.post("/find/bookings/checkratesandavailability",r).then(function(e){return i.$log.debug("resolved checkrates=",e),e.data})["catch"](function(e){i.$log.debug("failed checkrates=",e)})},t.prototype.GetGhaLink=function(e,t){var o=this,n=this.generateGhaBookingDetailModel(e,t);return this.$http.post("/find/bookings/checkgharatesandavailablity",n).then(function(e){return o.$log.debug("resolved checkrates=",e),e.data})["catch"](function(e){o.$log.debug("failed checkrates=",e)})},t.prototype.GetFindData=function(t){var o=this;return void 0===t&&(t=!1),this.$http.get("/find/findandbook/autocomplete",{cache:!0,params:{includeGha:t
}}).then(function(t){o.$log.debug("resolved autocomplete=",t);var n=t.data.map(function(t){var o=new e.BookingDataResult;return o.category=t.category,o.City=t.City,o.label=t.label,o.State=t.State,o.ItemIdGuid=t.ItemIdGuid,o.ResultLabel=t.ResultLabel,o.SubCategory=t.SubCategory,o.IsComingSoonProperty=t.IsComingSoonProperty,o.ComingSoonText=t.ComingSoonText,o.HotelLink=t.HotelLink,o.RedeemFreeNights=t.RedeemFreeNights,o.HotelCode=t.HotelCode,o.IsVillas=t.IsVillasProperty,o.IsGha=t.IsGha,o});return n})["catch"](function(e){return o.$log.debug("failed autocomplete=",e),[]})},t.prototype.GetGlobalData=function(e,t,o,n){var i=this,r=e+"/"+t+"/"+o+"/"+n;return this.$http.get("/find/bookings/getgharesponsedata/"+r).then(function(e){return i.$log.debug("resolved GHA=",e),e.data})["catch"](function(e){return i.$log.debug("failed GHA=",e),e})},t.prototype.GetExploreData=function(e){var t=this;return this.$http.get("/find/findandbook/getexploreoptions/"+e,{cache:!0}).then(function(e){return t.$log.debug("resolved exploreOptions=",e),e.data})["catch"](function(e){return t.$log.debug("failed exploreOptions=",e),[]})},t.prototype.generateBookingDetailModel=function(e,t,n,i){function r(e){for(var t=[],o=0;o<4;o++){var n=e.ChildAges[o]?e.ChildAges[o].toString(10):"";t.push(n)}return t}var a=new o;if(a.HotelId=e.HotelId,t.ArrivalDate){var s=this.moment.utc(t.ArrivalDate).hour(0).minute(0).second(0).millisecond(0).format("MM-DD-YYYY");if(a.BookingStartDate=s,t.DepartureDate){var l=this.moment.utc(t.DepartureDate).hour(0).minute(0).second(0).millisecond(0).format("MM-DD-YYYY");a.BookingEndDate=l}}else{var s=this.moment.utc().hour(0).minute(0).second(0).millisecond(0).format("MM-DD-YYYY");a.BookingStartDate=s,a.BookingEndDate=""}a.TravelAgentNumber=i.TravelAgentNumber,a.AccountCode=i.PromoCode,a.IsRedeemingFreeNights=i.IsRedeemingFreeNights,a.GroupCode=i.GroupCode,a.Rates=i.RateCode,a.RoomQuantity=n.RoomCount.toString(10),a.AdaAccessible=n.Accessible?"true":"false",e.IsVillas&&(a.VillasBedRoomQuantity=n.BedRoomCount.Count.toString(10),a.VillasView=n.VillasView.Value);for(var c=0;c<n.Rooms.length;c++){var u=n.Rooms[c];switch(c){case 0:a.Room1AdultQuantity=u.AdultCount.toString(10),a.Room1ChildQuantity=u.ChildCount.toString(10);var h=r(u);a.Room1ChildAge1=h[0],a.Room1ChildAge2=h[1],a.Room1ChildAge3=h[2],a.Room1ChildAge4=h[3];break;case 1:a.Room2AdultQuantity=u.AdultCount.toString(10),a.Room2ChildQuantity=u.ChildCount.toString(10);var d=r(u);a.Room2ChildAge1=d[0],a.Room2ChildAge2=d[1],a.Room2ChildAge3=d[2],a.Room2ChildAge4=d[3];break;case 2:a.Room3AdultQuantity=u.AdultCount.toString(10),a.Room3ChildQuantity=u.ChildCount.toString(10);var p=r(u);a.Room3ChildAge1=p[0],a.Room3ChildAge2=p[1],a.Room3ChildAge3=p[2],a.Room3ChildAge4=p[3]}}return a},t.prototype.generateGhaBookingDetailModel=function(e,t){var o=new n;o.Country=e.Country,o.City=e.City,o.HotelBrand=e.Brand,o.Hotel=e.Hotel;var i=this.moment.utc(t.ArrivalDate).hour(0).minute(0).second(0).millisecond(0).format("MM-DD-YYYY"),r=this.moment.utc(t.DepartureDate).hour(0).minute(0).second(0).millisecond(0).format("MM-DD-YYYY");return o.StartDate=i,o.EndDate=r,o},t}();i.$inject=["$http","$log","$q","moment"],e.NgModule.service("omni.bookingapiservice",i)}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){var t=function(){function e(){this.City="",this.ItemIdGuid="",this.ResultLabel="",this.State="",this.SubCategory="",this.category="",this.label="",this.selected=!1,this.IsComingSoonProperty=!1,this.ComingSoonText="",this.HotelLink="",this.RedeemFreeNights=!0,this.HotelCode="",this.Region_City="",this.IsVillas=!1,this.IsGha=!1}return e}();e.BookingDataResult=t;var o=function(){function e(){}return e}();e.ExplorePropertyNavigation=o;var n=function(){function e(){}return e}();e.ExplorePropertyResult=n;var i=function(){function e(e){this.IsExpanded=!!e&&e.IsExpanded,this.IsEnabled=!!e&&e.IsEnabled,this.IsBrandPage=!!e&&e.IsBrandPage,this.IsPropertyPage=!!e&&e.IsPropertyPage,this.IsResortPage=!!e&&e.IsResortPage}return e}();e.BookerState=i;var r=function(){function t(e,t,o,n,i,r,a){this.$rootScope=e,this.$log=t,this.cacheFactory=o,this.moment=n,this.bookerConfig=i,this.dateConfig=r,this.$timeout=a,this.initBookerDateConfig(),this.initBookerState(),this.initPageState(),this.initBookerCache()}return t.prototype.GetCurrentDate=function(){return this.bookerConfig.CurrentDate},t.prototype.GetPropertyDetail=function(){var t=new e.PropertyDetail;return t.HotelId="",t},t.prototype.GetTravelDates=function(){var t=new e.TravelDates;t.ArrivalDate=this.moment.utc(this.bookerConfig.CurrentDate).hour(0).minute(0).second(0).millisecond(0),t.DepartureDate=this.moment.utc(this.bookerConfig.CurrentDate).add(1,"days").hour(0).minute(0).second(0).millisecond(0);var o=this.bookingCache.get("travelDates");return o&&(this.$log.debug("Using cached travel dates",o),t=o),t},t.prototype.PutTravelDates=function(e){this.bookingCache.put("travelDates",e)},t.prototype.GetRoomDetails=function(){var t=new e.RoomDetail;t.RoomCount=1,t.BedRoomCount=new e.BedroomOption,t.BedRoomCount.Count=0,t.VillasView=new e.ViewOption,t.VillasView.Value="";var o=new e.Room;return o.AdultCount=2,o.ChildCount=0,t.Rooms.push(o),t},t.prototype.GetRateCodes=function(){var t=new e.RateCodes;t.RateCode="rpc_NONE";var o=this.bookingCache.get("rateCodes");return o&&(this.$log.debug("Using cached rates",o),t=o),t},t.prototype.PutRateCodes=function(e){this.bookingCache.put("rateCodes",e)},t.prototype.GetGlobalDetail=function(){var t=new e.GlobalBookerDetails;t.Brand="-1",t.City="-1",t.Hotel="-1",t.Country="-1";var o=this.bookingCache.get("globalBookerDetails");return o&&this.$log.debug("Using cached global details",o),t},t.prototype.PutGlobalDetail=function(e){this.bookingCache.put("globalBookerDetails",e)},t.prototype.OpenBooker=function(){this.bookerConfig.ShowBookingWidget&&(this.bookerState.IsExpanded=!0,this.onUpdatedBookerState(),this.$timeout(function(){var e=angular.element("#closeButton");e.focus()},0),angular.element("#omni-booker #bookNowButton").attr("aria-expanded","true"),angular.element("#findAndBookLineItem").attr("aria-expanded","true"),angular.element("#bookNowLineItem").attr("aria-expanded","true"))},t.prototype.CloseBooker=function(){var e=this.CheckBookerFocus();this.bookerConfig.ShowBookingWidget&&e&&(this.bookerConfig.IsBookerAlwaysOpen||(this.bookerState.IsExpanded&&(this.bookerState.IsExpanded=!1,this.$timeout(function(){var e=angular.element("#omni-booker #bookNowButton");e.focus()},0),angular.element("#omni-booker #bookNowButton").attr("aria-expanded","false"),angular.element("#findAndBookLineItem").attr("aria-expanded","false"),angular.element("#bookNowLineItem").attr("aria-expanded","false")),this.onUpdatedBookerState()))},t.prototype.ToggleBooker=function(){this.bookerConfig.ShowBookingWidget&&(this.bookerConfig.IsBookerAlwaysOpen||(this.bookerState.IsExpanded=!this.bookerState.IsExpanded,this.bookerState.IsExpanded?(this.$timeout(function(){var e=angular.element("#closeButton");e.focus()},0),angular.element("#bookNowButton").attr("aria-expanded","true")):angular.element("#bookNowButton").attr("aria-expanded","false"),this.onUpdatedBookerState()))},t.prototype.TabBooker=function(e){var t=angular.element(".om-booking-container"),o=t.find(".bookerTabElement"),n=o.length,i=o[0],r=o[n-1];9===e.keyCode&&document.activeElement===r&&(e.preventDefault(),i.focus())},t.prototype.CheckBookerFocus=function(){var e=angular.element(document.activeElement),t=!1;return t=!(!e.hasClass("bookerTabElement")&&"where-going"!==e.attr("id")&&!e.is("body"))},t.prototype.GetBookerState=function(){return new i(this.bookerState)},t.prototype.initPageState=function(){this.$rootScope.isbrand=this.bookerConfig.IsBrandPage(),this.$rootScope.ishotel=this.bookerConfig.IsHotelPage(),this.$rootScope.isresort=this.bookerConfig.IsResortPage()},t.prototype.initBookerState=function(){this.bookerState=new i,this.bookerState.IsExpanded=this.bookerConfig.ShowBookingWidget&&(this.bookerConfig.IsBookerExpanded||this.bookerConfig.IsBookerAlwaysOpen),this.bookerState.IsEnabled=this.bookerConfig.ShowBookingWidget,this.bookerState.IsBrandPage=this.bookerConfig.IsBrandPage(),this.bookerState.IsPropertyPage=this.bookerConfig.IsHotelPage()||this.bookerConfig.IsResortPage(),this.bookerState.IsResortPage=this.bookerConfig.IsResortPage(),this.onUpdatedBookerState()},t.prototype.initBookerDateConfig=function(){this.dateConfig.MonthsLong.length>0&&this.dateConfig.MonthsShort.length>0&&this.dateConfig.WeekdaysLong.length>0&&this.dateConfig.WeekdaysShort.length>0&&(this.moment.defineLocale("en-foo",{parentLocale:"en"}),this.moment.updateLocale("en-foo",{months:this.dateConfig.MonthsLong,monthsShort:this.dateConfig.MonthsShort,weekdays:this.dateConfig.WeekdaysLong,weekdaysShort:this.dateConfig.WeekdaysShort}))},t.prototype.initBookerCache=function(){this.bookingCache=this.cacheFactory.get("bookingCache"),this.bookingCache||(this.bookingCache=this.cacheFactory("bookingCache",{storageMode:"sessionStorage"}))},t.prototype.onUpdatedBookerState=function(){this.$rootScope.IsBookerEnabled=this.bookerState.IsEnabled,this.$rootScope.IsBookerExpanded=this.bookerState.IsExpanded,this.$rootScope.$broadcast("bookerStateUpdate")},t}();r.$inject=["$rootScope","$log","CacheFactory","moment","bookerConfig","dateConfig","$timeout"],e.NgModule.service("omni.bookingservice",r)}(t=e.Booker||(e.Booker={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule=angular.module("omni.resortmap",["omniViews"])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.controller("MainController",["DataService","ResortProvider","$scope","$state","$stateParams",function(e,t,o,n,i){o.resort=null,e.get({},function(e){o.resort=e,o.isResort=e.is_resort,t.setResort(e),o.isResort?n.go("resort"):n.go("floor",{id:0})})}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.controller("ResortController",["$scope","$state","$stateParams","ResortProvider",function(e,t,o,n){e.showPopover=!1,e.popover={},e.resort=n.getResort(),e.zoomButton=!1,e.filterResortData=function(){angular.forEach(e.resort.location,function(e,t){e.posn=t+1,e.e=t})},e.closePopover=function(){e.$emit("closePopover")},e.changeState=function(e,o){t.go(e,{id:o})},e.filterResortData()}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.controller("RoomController",["ResortProvider","$scope","$state","$stateParams","$timeout",function(e,t,o,n,i){t.location=e.getLocation(n.id),t.showBackButton=!0,t.floor=t.location.floor[n.floorId],t.room=null,angular.forEach(t.floor.room,function(e,o){o==n.roomId&&(t.room=e)}),t.partialIndex=0,t.partials=t.room.partial,t.partial=t.partials[t.partialIndex],t.layouts=t.partial.layout,t.showPartialSelector=function(){return t.partials.length>1},t.roomVideoToggle=function(){"room.video"!==o.current.name?o.go("room.video"):o.go("room")}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.config(["$stateProvider","$urlRouterProvider","$locationProvider",function(e,t,o){e.state("resort",{templateUrl:"omni/assets/resortmap/views/resort.tpl.html",controller:"ResortController"}).state("location",{"abstract":!0,params:{id:""},resolve:{location:["ResortProvider","$stateParams",function(e,t){return e.getLocation(t.id)}]},templateUrl:"omni/assets/resortmap/views/location.tpl.html",controller:["$rootScope","$state","$scope","$stateParams","location",function(e,t,o,n,i){o.location=i,o.baseState="undefined"!==i.type&&"leisure"==i.type?"leisure":"floor",o.$parent.isResort?(o.showBackButton=!0,o.h1Class="withBackButton"):(o.showBackButton=!1,o.h1Class=""),o.backButton=function(){"floor"==o.baseState?e.activeTab="meeting":e.activeTab="leisure",t.go("resort")},o.videoToggle=function(){"video"!==t.current.name?t.go("video"):t.go(o.baseState)},o.showFloorRoomSelector=function(){return"floor.detail"===t.current.name}}]}).state("video",{parent:"location",views:{main:{templateUrl:"omni/assets/resortmap/views/video.tpl.html",controller:["$scope","$sce",function(e,t){e.video_url=null}]}}}).state("leisure",{parent:"location",views:{main:{templateUrl:"omni/assets/resortmap/views/slideshow.tpl.html",controller:["$scope","$stateParams",function(e,t){e.slides=e.location.gallery,e.showSlideNav=function(){return e.slides.length>1}}]}}}).state("meeting",{parent:"location",views:{main:{templateUrl:"omni/assets/resortmap/views/meeting.tpl.html"}}}).state("gallery",{parent:"meeting",views:{meetingMain:{templateUrl:"omni/assets/resortmap/views/slideshow.tpl.html",controller:["$scope",function(e){e.slides=e.location.gallery,e.showSlideNav=function(){return e.slides.length>1}}]}}}).state("floor",{parent:"meeting",params:{id:""},resolve:{location:["ResortProvider","$stateParams",function(e,t){return e.getLocation(t.id)}]},views:{meetingMain:{templateUrl:"omni/assets/resortmap/views/floor.tpl.html",controller:["$scope","$state","$stateParams","location",function(e,t,o,n){e.floors=n.floor,e.showBackButton=!0,n.floor.length>1?e.showFloorSelector=!0:e.showFloorSelector=!1,t.go("floor.detail",{id:o.id,floorId:0})}]}}}).state("floor.detail",{params:{id:"",floorId:""},parent:"floor",resolve:{location:["ResortProvider","$stateParams",function(e,t){return e.getLocation(t.id)}]},views:{floorContainer:{templateUrl:"omni/assets/resortmap/views/floorContainer.tpl.html",controller:["$scope","$state","$stateParams","$timeout","location",function(e,t,o,n,i){var r=o.floorId||0;e.showBackButton=!0,e.location=i,e.floor=i.floor[r],e.rooms=e.floor.room,e.showPopover=!1,e.popover=null,e.floorIndex=o.floorId,e.closePopover=function(){e.$emit("closePopover")}}]}}}).state("room",{params:{id:"",floorId:"",roomId:""},parent:"floor.detail",views:{"@":{templateUrl:"omni/assets/resortmap/views/room.tpl.html",controller:"RoomController"}}}).state("room.video",{parent:"room",views:{roomMain:{templateUrl:"omni/assets/resortmap/views/video.tpl.html",controller:["$scope",function(e){e.showBackButton=!0}]}}}),o.html5Mode({enabled:!1,requireBase:!1}),o.hashPrefix("")}]).run(["$rootScope","$state","$stateParams",function(e,t,o){e.$state=t,e.$stateParams=o}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("floorCanvas",["$rootScope","$stateParams","$state","Kinetic",function(e,t,o,n){function i(e,t,o,i){var r,a=10,s="Marker "+(i+1),l="shape"+i;return r=new n.Circle({x:e,y:t,radius:a,name:s,id:l,fill:"#d55628",stroke:"#b14822",strokeWidth:1})}function r(e,t,o,r){var a=e.x_coord/2*o,s=e.y_coord/2*r,l="default",c=new n.Group({id:"group"+t,index:t}),u=i(a,s,l,t);return c.add(u),c}function a(e,t,o,n){var i,r,a=jQuery("#mapContainer").width(),s=jQuery("#mapContainer").height(),l={};return o>s/2?(l.top=o-168,i="top"):(l.top=o+10,i="bottom"),t>a/2?(r="l",l.left=t-212):(r="r",l.left=t-20),jQuery("#popoverElement").css({top:l.top,left:l.left}),l.placement=i+" "+r,l.type="floor",l.title=e.title,l.area=e.area,l.capacity=e.capacity,l.l=e.length,l.w=e.width,null!=e.length&&0!=e.length&&null!=e.width&&0!=e.width?l.dimensions=e.length+"' x "+e.width+"'":l.dimensions="NA",l.ceiling=e.ceiling,l.el=n,l}return{restrict:"E",priority:1001,template:'<div id="floorMapCanvas" style="background: url(\'{{ floor_img }}\') no-repeat top left;background-size:contain;"></div>',replace:!0,link:function(o,i,s){var l=new Image;l.src=s.src,o.floor_img=s.src;var c=jQuery("#mainMapContainer"),u=.75*c.width();jQuery("#floorMapCanvas").width(u);var h=430*u/692;jQuery("#floorMapCanvas").height(h),jQuery("#mainMapContainer").height(h+2);var d=u/692,p=h/430,m={canvasId:i.attr("id"),stage:null,layer:null,points:null,popover:null,initialize:function(){m.points=o.floor.room,m.stage=new n.Stage({container:m.canvasId,width:u,height:h});new n.Image({x:0,y:0,image:l,width:u,height:h});m.layer=new n.Layer;for(var e=0;e<m.points.length;e++){var t=r(m.points[e],e,d,p);t.on("tap",function(e){var t=angular.isUndefined(e.target.parent)?e.target:e.target.parent.attrs.index;m.showPopover(t)}),t.on("click",function(e){var t=angular.isUndefined(e.target.parent)?e.target:e.target.parent.attrs.index;m.showPopover(t)}),m.layer.add(t)}m.stage.add(m.layer),m.stage.on("click",function(e){}),jQuery("#roomPopoverSelect").empty().append('<option value="-1">Select Room</option>'),angular.forEach(o.floor.room,function(e,t){var o='<option value="'+t+'">'+e.name+"</option>";jQuery("#roomPopoverSelect").append(o),o=""}),jQuery("#roomPopoverSelect").off(),jQuery("#roomPopoverSelect").on("change",function(e){var t=this.value;m.showPopover(t)})},showPopover:function(e,n){var i=o.location.floor[t.floorId];if(e==-1)return o.showPopover=!1,void o.$apply();var r="#group"+e,s=m.stage.find(r),l=s[0].children[0].attrs.x,c=s[0].children[0].attrs.y,u=null;u=i.room[e],o.showPopover=!1,o.popover=a(u,l,c,e),o.showPopover=!0,u=null,o.$apply()}};l.onload=function(){o.$apply(m.initialize()),e.$on("closePopover",function(){o.showPopover=!1})}}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("floorSelect",["$document","$state",function(e,t){return{restrict:"C",link:function(e,o,n){var i;o.on("change",function(e){i=e.target.value,t.go("floor.detail",{floorId:i})})}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){!function(t,o){e.ngModule.directive("resortMapCanvas",["$rootScope","$timeout","$window","$location","$state","Kinetic",function(e,t,n,i,r,a){function s(e,t){var o=document.createElement("canvas"),n=o.getContext("2d");return o.width=e.width*t,o.height=e.height*t,n.drawImage(e,0,0,e.width*t,e.height*t),l(n,o.width,o.height,.35),o}function l(e,t,o,n){for(var i,r=[0,-1,0,-1,5,-1,0,-1,0],a=Math.round(Math.sqrt(r.length)),s=.5*a|0,l=e.createImageData(t,o),c=l.data,u=e.getImageData(0,0,t,o).data,h=o;h--;)for(i=t;i--;){for(var d=h,p=i,m=4*(h*t+i),g=0,f=0,v=0,y=0,C=0;C<a;C++)for(var k=0;k<a;k++){var b=d+C-s,D=p+k-s;if(b>=0&&b<o&&D>=0&&D<t){var w=4*(b*t+D),I=r[C*a+k];g+=u[w]*I,f+=u[w+1]*I,v+=u[w+2]*I,y+=u[w+3]*I}}c[m]=g*n+u[m]*(1-n),c[m+1]=f*n+u[m+1]*(1-n),c[m+2]=v*n+u[m+2]*(1-n),c[m+3]=u[m+3]}e.putImageData(l,0,0)}function c(e,t,o,n){var i,r=10,s="Marker "+n,l="shape"+n;switch(o){case"top-left":var c=e,u=t-r,h=e-r,d=t,p=e-r,m=t-r,g="M"+c+","+u,f="A"+r+","+r+",0,1,1,"+h+","+d,v="L"+p+","+m+"Z",y=g+f+v;i=new a.Path({data:y});break;case"top-right":var c=e,u=t-r,h=e+r,d=t,p=e+r,m=t-r,g="M"+c+","+u,f="A"+r+","+r+",0,1,0,"+h+","+d,v="L"+p+","+m+"Z",y=g+f+v;i=new a.Path({data:y});break;case"bottom-left":var c=e-r,u=t,h=e,d=t+r,p=e-r,m=t+r,g="M"+c+","+u,f="A"+r+","+r+",0,1,1,"+h+","+d,v="L"+p+","+m+"Z",y=g+f+v;i=new a.Path({data:y});break;case"bottom-right":var c=e+r,u=t,h=e,d=t+r,p=e+r,m=t+r,g="M"+c+","+u,f="A"+r+","+r+",0,1,0,"+h+","+d,v="L"+p+","+m+"Z",y=g+f+v;i=new a.Path({data:y});break;default:i=new a.Circle({x:e,y:t,radius:r})}return i.name(s),i.id(l),i.fill("#F07230"),i.stroke("#b14822"),i.strokeWidth(1),i.opacity(1),i}function u(e,t,o){var n=new a.Text({x:e,y:t,text:o,fontSize:12,fontStyle:"italic",fontFamily:"Calibri",fill:"#ffffff",opacity:1});return n.offsetX(n.width()/2),n.offsetY(n.height()/2),n}function h(e,t,o,n){var i=e.x_coord/2*o,r=e.y_coord/2*n,s=e.marker_type,l=e.id,h=new a.Group({id:"group"+l,index:l}),d=c(i,r,s,l),p=u(i,r,e.posn);return h.add(d),h.add(p),h}function d(e,t,n,i){var r,a,s=o("#mapContainer").width(),l=o("#mapContainer").height(),c={};if(n>l/2){if("meeting"==e.type)var u=145;else var u=100;e.title.length>22&&(u+=20),c.top=n-u,r="top"}else c.top=n+20,r="bottom";return t>s/2?(a="l",c.left=t-211):(a="r",c.left=t-20),o("#popoverElement").css({top:c.top,left:c.left}),c.placement=r+" "+a,c.title=e.title,c.type=e.type,c.el=i,c}function p(e){var t=e.type;"leisure"==t?o("#tabs a:first").tab("show"):o("#tabs a:last").tab("show");var n=o(".locationList").find("[data-list-item='"+e.id+"']");n.addClass("active")}function m(e){var t="";return t+='<li class="listItem" data-list-item="'+e.id+'">',t+='<img src="'+e.thumbnail+'" class="locationThumb" />',t+='<span class="badge">'+e.posn+"</span>",t+="<h4>"+e.title+"</h4>",t+="</li>"}function g(e){var t="";t+='<ul id="tabs" class="nav nav-tabs nav-justified">',t+='<li class="active"><a class="tab-toggle" data-target="#leisure" data-toggle="tab">Leisure</a></li>',t+='<li><a class="tab-toggle" data-target="#meeting" data-toggle="tab">Meeting</a></li>',t+="</ul>",t+='<div class="tab-content">';var o="",n="";return angular.forEach(e,function(e,t){"leisure"==e.type?o+=m(e):n+=m(e)}),t+='<div class="tab-pane active" id="leisure">',t+='<ul class="locationList">'+o+"</ul>",t+="</div>",t+='<div class="tab-pane" id="meeting">',t+='<ul class="locationList">'+n+"</ul>",t+="</div>",t+="</div>"}function f(){var e=o(".tab-pane.active"),t=o(".tab-pane.active ul.locationList li.listItem.active"),n=e.scrollTop()+(t.position().top-e.position().top)-e.height()/2+t.height()/2;e.animate({scrollTop:n},500,"swing")}return{restrict:"EA",priority:1001,replace:!0,link:function(t,n,i){var r=n.find("#mapSidebar"),l=t.resort.location,c=g(l);r.html(c);var u=new RegExp("[\\?&]m=([^&#]*)"),m=u.exec(location.search);(null!==m&&1==m[1]||"meeting"==e.activeTab||"meetings"==o("#topNavLink").text().trim().toLowerCase())&&o("#tabs a:last").tab("show");var v=o("#mainMapContainer"),y=.75*v.width();o("#mapContainer").width(y);var C=430*y/692;o("#mapContainer").height(C),o("#mainMapContainer").height(C+1);var k=y/692,b=C/430,D={parentGroup:null,mapImages:null,canvasId:"mapCanvas",points:l,fromListClick:!1,stage:null,layer:null,popover:null,scale:1,activeItem:null,targetItem:null,initialize:function(e){D.stage=new a.Stage({container:D.canvasId,width:y,height:C}),D.layer=new a.Layer,D.parentGroup=new a.Group,D.mapImages=new a.Group;var n=new a.Image({x:0,y:0,image:e,width:Math.round(y),height:Math.round(C),listening:!0,name:"smallMap"});n.on("zoomIn",function(e){n.opacity(0),i.opacity(1)});var i=new a.Image({x:0,y:0,image:w,width:Math.round(y),height:Math.round(C),listening:!0,name:"largeMap"});i.on("zoomOut",function(e){i.opacity(0),n.opacity(1)}),D.mapImages.add(i),D.mapImages.add(n),D.parentGroup.add(D.mapImages);for(var r=0;r<D.points.length;r++){var s=h(D.points[r],r,k,b);s.on("tap",function(e){var n=angular.isUndefined(e.target.parent)?e.target:e.target.parent.attrs.index;o(".listItem").removeClass("active"),t.showPopover=!1,t.$apply(),D.playTween(n)}),s.on("click",function(e){var n=angular.isUndefined(e.target.parent)?e.target:e.target.parent.attrs.index;o(".listItem").removeClass("active"),t.showPopover=!1,t.$apply(),D.playTween(n)}),D.parentGroup.add(s)}D.layer.add(D.parentGroup),D.stage.add(D.layer)},apply:function(){try{t.$apply()}catch(e){}},playTween:function(e){var o="#group"+e,n=D.stage.find(o),i=n[0].children[1].attrs.x,r=n[0].children[1].attrs.y;t.showPopover=!1,1==D.scale?D.panZoom(e,i,r):2==D.scale&&t.activeItem!==e?D.pan(e,i,r):2==D.scale&&t.activeItem==e&&(D.scale=1,D.resetStage())},panZoom:function(e,t,n){var i={node:D.parentGroup,scaleX:2,scaleY:2,x:-t,y:-n,easing:a.Easings.EaseInOut,duration:.6,onFinish:function(){var i=o.grep(l,function(t){return t.id==e});D.popover=d(i[0],t,n,e),D.finishTween(2,e,!0)}},r=new a.Tween(i);r.tween.play()},pan:function(e,t,n){var i={node:D.parentGroup,x:-t,y:-n,easing:a.Easings.EaseInOut,duration:.6,onFinish:function(){var i=o.grep(l,function(t){return t.id==e});D.popover=d(i[0],t,n,e),D.finishTween(2,e,!0)}},r=new a.Tween(i);r.tween.play()},resetStage:function(){var e={node:D.parentGroup,x:0,y:0,scaleX:1,scaleY:1,easing:a.Easings.EaseInOut,duration:.6,onFinish:function(){D.finishTween(1,null,!1)}},t=new a.Tween(e);t.tween.play()},finishTween:function(e,n,i){if(2==e){t.zoomButton=!0;var r=D.stage.find(".smallMap");r.fire("zoomIn")}else{t.zoomButton=!1;var r=D.stage.find(".largeMap");r.fire("zoomOut")}if(D.scale=e,D.activeItem=n,t.popover=D.popover,t.showPopover=i,null!==n){var a=o.grep(l,function(e){return e.id==n});p(a[0]),f()}D.apply()}},w=new Image;w.src=t.resort.map_img;var I=new Image;I.src=w.src,I.onload=function(){var n,i;n=.75,i=2/3;var r=s(I,i);D.initialize(r),o(".listItem").on("click",function(e){if(o(this).hasClass("active"))o(this).toggleClass("active"),t.showPopover=!1,D.resetStage(),t.$apply();else{o(".listItem").removeClass("active"),t.showPopover=!1,t.$apply(),o(this).addClass("active"),f();var n=o(this).data("list-item");D.playTween(n)}}),e.$on("closePopover",function(){t.showPopover=!1,t.zoomButton=!1,o(".listItem").removeClass("active"),D.fromListClick=!1,D.resetStage()}),e.$on("resetStage",function(){t.showPopover=!1,D.fromListClick=!1,D.resetStage()})}}}}])}(window,window.$j)}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.filter("naFilter",function(){return function(e){return 0==e?"NA":e}}).filter("ftFilter",function(){return function(e){return isNaN(e)||0===e?e:e+"'"}})}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("partialSlideshow",["$document",function(e){return{restrict:"A",priority:1001,link:function(e,t,o){}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("mapPopover",[function(){return{restrict:"EAC",templateUrl:"omni/assets/resortmap/views/popover.tpl.html"}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("roomLayout",["$document",function(e){return{restrict:"EA",link:function(t,o,n){function i(e,t){if(t>5){var o,n;return o=2,n=t-3,e<=o?0:e>=n?n-2:e-2}}var r,a,s,l,c=t.partials,u=0;c[u];t._Index=0,r=e.find("#partialSelect"),a=e.find("#area"),s=e.find("#ceiling"),l=e.find("#capacity");var h=e.find("body"),d=h.width(),p=80;d>=1200?p=117:d<1200&&d>=992?p=92:d<992&&d>=768&&(p=83),r.on("change",function(e){u=e.target.value,t.layouts=c[u].layout,a.html(c[u].area),s.html(t.room.ceiling),l.html(c[u].capacity),t._Index=0,t.length=t.layouts.length,t.$digest()}),t.length=t.layouts.length,t.$watch("_Index",function(){var e=i(t._Index,t.length);jQuery("#layoutNav").animate({left:-(e*p)})}),t.isActive=function(e){return t._Index===e},t.showPrev=function(){angular.copy(t._Index);t._Index=t._Index>0?--t._Index:t.length-1},t.showNext=function(){angular.copy(t._Index);t._Index=t._Index<t.length-1?++t._Index:0},t.showPhoto=function(e){angular.copy(t._Index);t._Index=e},t.setWidth=function(e){return e>5}}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.factory("DataService",["$resource","$window",function(e,t){return e(t.endpointUrl)}]).factory("_",["$window",function(e){return e._}]).factory("Kinetic",["$window",function(e){return e.Kinetic}]).factory("ResortProvider",["_",function(e){var t,o,n,i,r={setResort:function(e){t=e},getResort:function(){return t},getLocation:function(e){return t.is_resort?angular.forEach(t.location,function(t,n){t.id==e&&(o=t)}):o=t.location[0],o},getFloor:function(e){return angular.forEach(o.floor,function(t,o){t.id==e&&(n=t)}),n},getRoom:function(e){return angular.forEach(n.room,function(t,o){t.id==e&&(i=t)}),i}};return r}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("sidebar",[function(){return{restrict:"C",link:function(e,t,o){var n=t.find(".body");n.height>290&&n.css({overflowY:"scroll"})}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("cycleSlideshow",["$state",function(e){return{restrict:"C",link:function(t,o,n){var i,r=t.slides,a=null;i="gallery"==e.current.name?"cycle-caption meeting":"cycle-caption",a+="<div class='"+i+"'></div>",r.length>1&&(a+="<div class='cycle-prev'></div>",a+="<div class='cycle-next'></div>"),angular.forEach(r,function(e,t){a+="<img src='"+e.img_url+"' data-cycle-title='"+e.caption+"' />"}),o.html(a),o.cycle({fx:"fade",timeout:5e3,captionTemplate:"{{cycleTitle}}",log:!1}),o.on("$destroy",function(){r=[]})}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));var Omni;!function(e){var t;!function(e){e.ngModule.directive("youtube",["$sce",function(e){return{restrict:"E",template:'<iframe width="692" height="390" src="{{ video_url }}" frameborder="0" allowfullscreen></iframe>',replace:!0,link:function(t,o,n){t.video_url=e.trustAsResourceUrl(t.location.video_url)}}}])}(t=e.ResortMap||(e.ResortMap={}))}(Omni||(Omni={}));
//# sourceMappingURL=omni-ng.js.map

