{"version":3,"sources":["wwwroot/phase2/js/site.js"],"names":["App","_AutoRefreshMinutes","_PopOverOptions","trigger","container","html","placement","selector","_CurrentlyShownPopover","_ShowLoadingTimeout","init","WatchEvents","SetupAutocomplete","SetupPopovers","window","setTimeout","AutoRefreshPage","$","click","HideSearchResults","keyup","SearchChanged","this","WatchSearchResultsForClick","LocationSelected","ChangeDate","SelectMultiDate","on","event","$hotspot","relatedTarget","OpenModal","SaveBooking","ShowNormalBookingDay","preventDefault","CancelBooking","ShowMultiDay","$ele","removeClass","addClass","FetchBookings","newMapId","data","location","searchTerm","val","ShowLoading","ajax","type","contentType","url","term","fail","result","alert","done","results","$drop","empty","length","append","each","index","spaceCode","email","mapId","name","slideDown","always","SearchSelected","doClearSearchField","hide","personName","text","trim","currentMapId","personMap","ShowNoDeskAssigned","ShowPersonDesk","autocompleteBS","debounceMS","minLength","maxResults","inputSource","document","getElementById","targetID","fetchURL","fetchMap","id","bootstrap","Popover","body","popId","noDeskName","HideAnyShowingPopover","show","_element","ChangePopoverText","spaceId","heading","$pop","outerHTML","remove","$newEle","popContent","attr","replace","hasClass","reservedBy","innerText","ShowAlreadyBooked","selectedDay","FetchBookingsForOneSpace","ele","toggleClass","dateValues","datesToDisplay","i","$date","push","join","Modal","date","bookings","b","$b","bookedByName","dates","bookedDates","alreadyBookedDate","errorText","bookerName","employeeId","bookingDates","mapDate","JSON","stringify","undefined","isOk","errorMessage","$result","oldSpaceCode","isShow","clearTimeout","_DelayedShowLoading"],"mappings":"AAAA,IAAIA,IAAM,CAETC,oBAAqB,EACrBC,gBAAiB,CAACC,QAAS,QAASC,UAAW,OAAQC,MAAM,EAAMC,UAAW,OAAQC,SAAU,gBAChGC,uBAAwB,KACxBC,oBAAqB,EAErBC,KAAM,WACLV,IAAIW,cACJX,IAAIY,oBACJZ,IAAIa,gBAEJC,OAAOC,YAAW,WAAaf,IAAIgB,oBAA+C,GAA1BhB,IAAIC,oBAA2B,MAOxFU,YAAa,WAEZM,EAAE,mB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G,YAAY,UAAUC,SAAS,aAC5DvC,IAAIkG,kBAAkB7C,EAAOyF,aAAc,iBAG5C1E,QAAO,WACPpE,IAAI8C,aAAY,OAIlBA,YAAa,SAASiG,GAErBjI,OAAOkI,aAAahJ,IAAIS,qBACpBsI,EAEH/I,IAAIS,oBAAsBK,OAAOC,YAAW,WAAaf,IAAIiJ,wBAAyB,KAEtFhI,EAAE,YAAYsB,SAAS,WAGzB0G,oBAAqB,WACpBhI,EAAE,YAAYqB,YAAY,WAG3BtB,gBAAiB,WAChBhB,IAAIwC,gBACJ1B,OAAOC,YAAW,WAAaf,IAAIgB,oBAA+C,GAA1BhB,IAAIC,oBAA2B,OAIzFD,IAAIU","file":"site.min.js","sourcesContent":["var App = {\r\n\t\r\n\t_AutoRefreshMinutes: 2,\r\n\t_PopOverOptions: {trigger: 'hover', container: 'body', html: true, placement: 'auto', selector: '.has-popover'},\r\n\t_CurrentlyShownPopover: null,\r\n\t_ShowLoadingTimeout: 0,\r\n\r\n\tinit: function () {\r\n\t\tApp.WatchEvents()\r\n\t\tApp.SetupAutocomplete()\r\n\t\tApp.SetupPopovers()\r\n\t\t\r\n\t\twindow.setTimeout(function() { App.AutoRefreshPage() }, App._AutoRefreshMinutes * 60 * 1000)\r\n\r\n\t\t// for dev, auto show\r\n\t\t//$('#BC-01').click() // reserve\r\n\t\t//$('#RC-05').click() // cancel\r\n\t},\r\n\r\n\tWatchEvents: function() {\r\n\r\n\t\t$('.reserve-button').click(function () {\r\n\t\t\tApp.HideSearchResults(true)\r\n\t\t})\r\n\t\t$('.search-button .close-icon').click(function () {\r\n\t\t\tApp.HideSearchResults(true)\r\n\r\n\t\t\t// the following only partially works. A timing thing probably, as calling it from console later works\r\n\t\t\t//$('.reserve-button').click() // -> webflow code to slide over\r\n\t\t})\r\n\r\n\t\t$('#search-name').keyup(function(){\r\n\t\t\tApp.SearchChanged($(this))\r\n\t\t})\r\n\t\tApp.WatchSearchResultsForClick()\r\n\r\n\t\t$('#location .dropdown-option').click(function(){\r\n\t\t\tApp.LocationSelected($(this))\r\n\t\t})\r\n\t\t$('.slider-container .dates .date').click(function(){\r\n\t\t\tApp.ChangeDate($(this))\r\n\t\t})\r\n\r\n\t\t$('#multiDayBooking .dates .date').click(function(){\r\n\t\t\tApp.SelectMultiDate(this)\r\n\t\t})\r\n\r\n\t\t$('#reserveModal').on('show.bs.modal', function (event) {\r\n\t\t\tvar $hotspot = $(event.relatedTarget) // hotspot that triggered the modal\r\n\t\t\t//var modal = $(this)\r\n\t\t\t//modal.find('.modal-body input').val(recipient)\r\n\t\t\tApp.OpenModal($hotspot)\r\n\t\t})\r\n\r\n\t\t$('#reserveButton').click(function(){\r\n\t\t\tApp.SaveBooking()\r\n\t\t})\r\n\t\t$('#continueButton').click(function(){\r\n\t\t\t// show the normal modal but with multiple dates shown\r\n\t\t\tApp.ShowNormalBookingDay()\r\n\t\t})\r\n\t\t\r\n\t\t$('#cancelLink').click(function(event) {\r\n\t\t\tevent.preventDefault()\r\n\t\t\tApp.CancelBooking()\r\n\t\t})\r\n\t\t$('#startMultiDayLink').click(function(event) {\r\n\t\t\tevent.preventDefault()\r\n\t\t\tApp.ShowMultiDay()\r\n\t\t})\r\n\t},\r\n\r\n\tChangeDate: function($ele) {\r\n\t\t// change highlighted date in control\r\n\t\t$('.slider-container .dates .button').removeClass('active')\r\n\t\t$ele.addClass('active') \r\n\r\n\t\tApp.FetchBookings()\r\n\t},\r\n\tLocationSelected: function($ele) {\r\n\t\tvar newMapId = $ele.data('mapid')\r\n\t\tvar oldMapId = $('#location-selected').data('mapid')\r\n\t\tif(newMapId === oldMapId) return; // they didn't change it\r\n\t\t// go to the new page\r\n\t\twindow.location = \"/map?map=\" + newMapId\r\n\t},\r\n\tSearchChanged: function($ele) {\r\n\t\tvar searchTerm = $ele.val()\r\n\t\t\r\n\t\tif(searchTerm === '') {\r\n\t\t\tApp.HideSearchResults(true)\r\n\t\t} else {\r\n\t\t\tApp.ShowLoading(true)\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype: 'GET',\r\n\t\t\t\tcontentType: \"application/json; charset=utf-8\", // default is form\r\n\t\t\t\turl: \"/api/emaillookup\",\r\n\t\t\t\tdata: { term: searchTerm }\r\n\t\t\t})\r\n\t\t\t.fail(function(result) {\r\n\t\t\t\talert('error getting people');\r\n\t\t\t})\r\n\t\t\t.done(function(results) {\r\n\t\t\t\tvar $drop = $('#search-dropdown')\r\n\t\t\t\t$drop.empty()\r\n\t\t\t\tif (results.length === 0) {\r\n\t\t\t\t\t$drop.append(`