r.bing.com Open in urlscan Pro
2a02:26f0:3500:1b::1724:a39f  Public Scan

URL: https://r.bing.com/rp/4gcMqwYKOQUcixkifAdc0ZVkSrc.br.js
Submission Tags: falconsandbox
Submission: On November 21 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(function(){var st;try{(function(){var n={L_CreateNewCollection:"New collection...",L_TemporaryCollectionTitle:"Temporary collection",L_AddFavorite:"Favorites",L_SetAsHome:"Home",L_SetAsWork:"Work",L_MoveToFavorites:"Favorites",L_MoveToHome:"Home address",L_MoveToWork:"Work address",L_MoveToNewDay:"Create a new day",L_MoveToDay:"Day {0}",L_SaveToItinerary:"To {0}",L_DirectionAction_Text:"Click the Map layers button on the right side of the map.",L_DirectionHdg_Text:"Preview turns on a route",L_Direction_Text:"See the turns on your route before you leave. Click the white circle under each turn.",L_SignInLink_Text:"Sign in",L_Dlg_Close:"Close",L_Add_To_Current_Route:"Add to this route",L_Directions_From:"Directions from here",L_Directions_To:"Directions to here",L_Directions_AddToRoute:"Add to route",L_Landmark_TaskBar_Aria_Label:"Search, get directions, set favorites",L_Landmark_PreviewBar_Aria_Label:"Bing maps preview, exit, feedback and tips",L_Home:"Home",L_Work:"Work",L_MyLocation:"My location",L_SignInRequired:"<link>Sign in<\/link> to add this place to your favorites.",L_SavedCollection:"Successfully added {0}.",SavedOnInfobox:"Saved",SaveOnSerp_HoverTip:"Save to My Places",L_SaveFailed:"There was a problem adding {1} to {0}. Try again.",L_SeeIt:"View it in<link>{0}<\/link>",L_SeeItWithChange:"View it in<link>{0}<\/link> or <changelink>{1}<\/changelink>",L_Change:"change",L_AddFavoriteFailed:"There was a problem saving this place as a Favorite. Try again.",L_AddFavoriteSucceeded:"{0} is now saved.",L_AddTemporaryCollectionTitle:"your temporary collection",L_SetHomeFailed:"There was a problem saving this place as your Home. Try again.",L_SetHomeSucceeded:"This place is now saved as your Home.",L_SetWorkFailed:"There was a problem saving this place as your Work. Try again.",L_SetWorkSucceeded:"This place is now saved as your Work.",L_EntityUpdateSucceeded:"This place has been updated.",L_SaveUpdateButton:"Save",L_UpdateNicknameMessage:"Add a nickname (optional)",L_Menu_Text:"Menu",L_FiltersBar_Less_Text:"Less",L_FiltersBar_More_Text:"More",L_Landmark_FiltersBar_Aria_Label:"Filters bar",L_EditFavorite_Text:"Edit",L_Favorite_Text:"Favorites",L_EditMapDone_Text:"Done",L_EditMap_Text:"Move or zoom map",L_AddFavoriteExists_Text:"The place you are trying to save already exists in your favorites.",L_AddTemporaryExists:"The place you are trying to save already exists in your temporary collection.",L_CalendarSync_Export:"Save",L_CalendarSync_Google:"Google Calendar",L_CalendarSync_Outlook:"Outlook Calendar",L_CalendarSync_Message:"Saved into {0}",L_CalendarSync_EventMessage_HTML:"<STRONG>{0}<\/STRONG><BR>...powered by <STRONG>Bing Maps<\/STRONG><BR><BR>View on Bing Maps here:<BR> ",L_CalendarSync_EventMessage:"{0}\\n...powered by Bing Maps\\n\\nView on Bing Maps here: ",L_CalendarSync_EventMessage_PlainText:"{0}\r\n...powered by Bing Maps\r\n\r\nView on Bing Maps here:",L_CalendarSync_OpenHouse_EventMessage_HTML:"<STRONG>Tour Open House at - {0}<\/STRONG><BR>Click the link for directions on Bing Maps:<BR> ",L_CalendarSync_OpenHouse_EventMessage:"Tour Open House at - {0}\\n\\nClick the link for directions on Bing Maps: ",L_CalendarSync_OpenHouse_EventMessage_PlainText:"Tour Open House at - {0}\r\n\r\nClick the link for directions on Bing Maps:",L_CalendarSync_OpenHouse_Subject:"Open House at ",L_CalendarSync_OutlookDesktop:"Download Calendar item",L_CalendarSync_EndTimeLink:"Add End Time",L_CalendarSync_StartTime:"Start Time: ",L_CalendarSync_EndTime:"End Time: ",L_CalendarSync_SelectDateTime:"Select date and time",L_CalendarSync_APIErrorMessage:"Sorry, there was an error accessing your calendar! Please log out, then try again.",L_CalendarSync_StartEndDateError:"End date/time must be after start date/time.",L_CalendarSync_LoginErrorMessage:"Sorry, there was an error logging in! Try again. (You can also try clearing your cache, or using a different browser.)",L_CalendarSync_ICS_Downloaded:"Calendar event file has been downloaded. Open to add to your calendar.",L_CalendarSync_TimeZoneDisclaimer:"All times are shown in the event's local time zone.",L_CalendarSync_AllDayEvent:"All day event",L_Nearby_Attractions:"Attractions",L_Nearby_Bars:"Bars",L_Nearby_Coffee:"Coffee",L_Nearby_Hotels:"Hotels",L_Nearby_Restaurants:"Restaurants",L_Nearby_Transit:"Transit",L_TooManyFavorites:"You have reached the maximum number of Favorites. To save this place as a favorite, delete an existing favorite and try again.",L_PhoneWatermark:"(000) 000-0000",L_EntityPreviouslySaved:"{0} has been previously added to your collection.",L_DirectionsPopOutAriaLabel:"Directions Dropdown Menu",L_CollectionsPopOutAriaLabel:"Collections Dropdown Menu",L_TravelPopOutAriaLabel:"Itineraries Dropdown Menu",L_DropdownMenuDescription:"Dropdown Menu",L_ShortMonthJanuary:"JAN",L_ShortMonthFebruary:"FEB",L_ShortMonthMarch:"MAR",L_ShortMonthApril:"APR",L_ShortMonthMay:"MAY",L_ShortMonthJune:"JUN",L_ShortMonthJuly:"JUL",L_ShortMonthAugust:"AUG",L_ShortMonthSeptember:"SEP",L_ShortMonthOctober:"OCT",L_ShortMonthNovember:"NOV",L_ShortMonthDecember:"DEC",L_CreateNewItinerary:"New itinerary...",InPrivateAutosuggestFooterText:"Your search history and site cookies aren't saved.",InPrivateAutosuggestFooterLink:"Learn more about InPrivate Search",SearchGhostText:"Search Bing Maps",MobileMyPlaces:"MY PLACES",MobileMyContributions:"MY CONTRIBUTIONS",MobileShowTraffic:"SHOW TRAFFIC",MobileMapStyleRoad:"Road",MobileMapStyleDark:"Dark",MobileMapStyleAerial:"Aerial",MobileFeedback:"FEEDBACK",MobileClose:"Close",InfoboxListAriaLabel:"Click for more details",MobileExploreNearYou:"EXPLORE NEAR YOU"};window.$MicrosoftMaps8.ResourceManager?window.$MicrosoftMaps8.ResourceManager.init("CommonControls",n):window.$MicrosoftMaps8.ResourcesObject=n})();var i=window.$MicrosoftMaps8,v=i.Internal,kt=v.TaskData,ae=i.Local=i.Local||{},lt=i.CloudGraphDataManager=i.CloudGraphDataManager||{},at=i.GlobalConfig.features.advertising,ve=i.Anchor,e=i.GlobalConfig.features.autosuggest,rt=v._BaseMapTemplateSelector,yr=v.BaseTask,ei=v.BaseTaskViewModel,ye=i.BitmapImageTemplate,h=kt.CollectionActions,o=i.GlobalConfig.features.collections,ut=i.GlobalConfig.features.calendar,pr=i.GlobalConfig.features.calendarSync,pe=v.CanvasDrawingContext,gi=v._Color,dt=v.Control,it=v.ControlTemplate,u=i.DataHandlerKeys,vi=v._Debug,we=i.DefaultTemplateSelector,be=i.GlobalConfig.features.directions,gt=kt.DirectionsMode,k=v._EntityHelper,y=v._EntryPoints,wr=v._FeatureNames,ke=v.GeolocationProvider,t=v._Gimme,s=i.GlobalConfig,f=i.GlobalDataEventHandler,l=v._Helper,de=i.ImageFromCssHelper,br=i.Infobox,ge=lt.Itinerary,no=lt.ItineraryConverter,to=lt.ItineraryDataManager,io=lt.ItineraryItem,p=v._JSEvent,nt=s.features.localSearch,vt=v.LocalSearchEntity,yt=v._LocalStorageCache,ro=v._LruCache,pt=s.features.mapDelay,w=i.ResourceManager.MapDelay,uo=v.MapInteractionBehavior,ni=v.MapHelper,wt=i.Location,g=i.MapTypeId,kr=i.MapView,dr=i.MapViewAnimator,b=i.MapQuadrant,oi=i.Module,fo=lt.MostRecentlyUsedList,eo=i.MoveableSimplePointPrimitive,ot=v._Network,ct=v._ObservableObject,gr=v._ObservableCollection,nr=v._OverlayEntity,oo=v._Overlay,nu=i.Point,so=v.Permalink,ti=i.PrimitiveOverlayHelper,ho=i.GlobalConfig.features.print,co=v.PrintContent,tu=kt.RecommendationEntity,r=i.ResourceManager.CommonControls,lo=v.ReverseGeocoder,ao=lt.SaveDropdownControl,si=i.SimplePointPrimitive,vo=i.GlobalConfig.features.sharing,iu=v._StreetsidePerfConstants,hi=i.GlobalConfig.features.streetside,yo=i.GlobalConfig.features.taskBar,tt=i.GlobalConfig.features.travel,d=v._TaskDataHandlerHelper,c=i.TaskTypes,ru=i.VectorMapLayer,po=i.VectorImageTemplate,uu=kt.Waypoint,fu=i.ZoomLevel,eu=v._MapAuthentication,wo=kt.TravelAttractionEntity,ou='<div class="bm_dropdownContainer">    <a class="{TemplateBinding DisplayDropdown Converter=dropdownOpenClass}" data-tag="dropdownButton" event:click="onDropdownButtonClick" event:mouseleave="mouseexitDropdown" event:mouseenter="mouseoverDropdown" role="button" aria-expanded="{TemplateBinding DisplayDropdown}" href="#">        <span class="{TemplateBinding ButtonIcon}"><\/span>        <span>            <TextBlock Text="{TemplateBinding ButtonName}" />        <\/span>        <span class="chevron"><\/span>    <\/a>    <div class="dropdownParent">        <div class="multiselectDropdown popOutTop" style:display="{TemplateBinding DisplayDropdown Converter=boolToDisplay}" event:mouseleave="mouseexitDropdown" event:mouseenter="mouseoverDropdown">            <div class="dropdownTitle" style:display="{TemplateBinding DropdownTitle Converter=boolToDisplay}">                <TextBlock Text="{TemplateBinding DropdownTitle}" />            <\/div>            <ItemsControl ItemsSource="{TemplateBinding ItemList}">                <ItemsControl.ItemTemplate>                    <DataTemplate>                        <div>                            <a class="multiselectItem" data-tag="multiselectItem" data-entityid="{Binding Name}" event:click="onItemClick" role="checkbox" aria-checked="{Binding Checked}" href="#">                                <span class="{Binding Checked Converter=itemCheckedClass}"><\/span>                                <span class="{Binding Icon}"><\/span>                                <span class="itemName">                                    <TextBlock Text="{Binding Name}" />                                <\/span>                            <\/a>                        <\/div>                    <\/DataTemplate>                <\/ItemsControl.ItemTemplate>            <\/ItemsControl>        <\/div>    <\/div><\/div>',su='<div class="{Binding cssClass}" id="{Binding id}" style:visibility="{Binding showSuggestionsPanel Converter=boolToVisibility}" style:width="{Binding width Converter=numberToPixelString}" data-tag="as_container">    <div class="b_cards asOuterContainer">        <div style:display="{Binding showNearBySearchText Converter=boolToDisplay}" >            <p class="nearBySearchText b_secondaryText">                <TextBlock text="{Binding nearBySearchText}" />            <\/p>        <\/div>        <ItemsControl ItemsSource="{Binding suggestions}" panelTagName="ul">            <ItemsControl.ItemTemplate>                <DataTemplate>\t                        <li data-q="{Binding searchText}" id="{Binding optionId}" event:mousedown="handleSuggestionClick" role="option" aria-selected="{Binding isSelected}" aria-label="{Binding ariaLabel}">                            <div class="{Binding isSelected Converter=boolToSelectedClassName}" data-tag="as_suggestion">                                <div class="as_suggestion_root_inside" data-tag="as_suggestion_root_inside">                                    <div class="{Binding suggestionImgClass}" data-tag="as_img">                                    <\/div>                                    <div class="as_lines_root" data-tag="as_lines_root">                                        <p class="line1" data-tag="as_suggestion_line">                                            <TextBlock Text="{Binding suggestionTextLine1}" />                                        <\/p>                                        <p class="line2" data-tag="as_suggestion_line">                                            <TextBlock Text="{Binding suggestionTextLine2}" />                                        <\/p>                                    <\/div>                               <\/div>                            <\/div>                        <\/li>                <\/DataTemplate>            <\/ItemsControl.ItemTemplate>        <\/ItemsControl>        <li class="as_bpr" role="option" style:display="{Binding showInPrivateLink Converter=boolToDisplay}">            <div class="as_bprtxt">                <div class="as_bprtxt_line1">                    <TextBlock Text="{Binding inPrivateText}" />                <\/div>                <a class="as_bprlink" data-tag="as_bprlink" href="#" event:mousedown="inPrivateLinkClick">                    <TextBlock Text="{Binding inPrivateLinkText}" />                <\/a>            <\/div>        <\/li>        <div style:display="{Binding showBingLogo Converter=boolToDisplay}" class="bingLogoContainer">            <span class="bingLogoLight"><\/span>        <\/div>    <\/div>    <div class="clear"><\/div> <\/div>>',tr='<div class="CalendarSync calendarIcon" event:keydown="onCalSyncKeyDown">\t<div class="calendarSelect" data-tag="calendarSyncSelect">\t\t<SelectControl ItemsSource="{Binding calendarTypes}" IgnorePopOutButtonText="{Binding hasPresetStartEndTime}" SelectedItem="{Binding calendarType Mode=TwoWay}" popOutId="calPopOut" event:dropdown="onDropdown" />\t<\/div>    <div style:display="{Binding showStartEndTimeLinks Converter=boolToDisplay}">        <div id="startCalendar" event:keydown="onStartKeyDown">            <div>                <span class="startTimeLabel" id="startTimeLabel">                    <TextBlock Text="{Binding resources.L_CalendarSync_StartTime Converter=addPrefixSpace}" />                <\/span>                <span class="startDateAndTime" >                    <a class="dateTimeSelector dropdownBtn" aria-labelledby="startTimeLabel" event:click="onStartTimeClick" href="#" role="button" aria-expanded="{Binding showStartCalendarSelector}">                        <TextBlock Text="{Binding startDateTime}" />                    <\/a>                <\/span>            <\/div>            <div style:display="{Binding showStartCalendarSelector Converter=boolToDisplay}">                <div class="calendarSyncStartDate" data-tag="calendarSyncDate"><\/div>                <div class="calendarTime">                    <TimeControl Time="{Binding startTime Mode=TwoWay}" Editing="{Binding startEditingTime Mode=TwoWay}" Disabled="{Binding timeControlDisabled}" taskId="{Binding startTaskId}" />                    <div class="allDayEventCheckbox">                        <CheckBox Checked="{Binding isAllDayEvent Mode=TwoWay}" Value="{Binding resources.L_CalendarSync_AllDayEvent}" Content="{Binding resources.L_CalendarSync_AllDayEvent}" />                    <\/div>                <\/div>            <\/div>        <\/div>        <div class="endTimeLink" style:display="{Binding showEndTimeLink Converter=boolToDisplay}">            <a event:click="onEndTimeLinkClick" href="#" role="button"><TextBlock Text="{Binding resources.L_CalendarSync_EndTimeLink}"/><\/a>        <\/div>        <div class="endCalendar" style:display="{Binding showEndCalendar Converter=boolToDisplay}">            <div>                <span class="endTimeLabel" id="endTimeLabel">                    <TextBlock Text="{Binding resources.L_CalendarSync_EndTime Converter=addPrefixSpace}" />                <\/span>                <span class="endDateAndTime">                    <a class="dateTimeSelector dropdownBtn" event:click="onEndTimeClick" event:keydown="onEndKeyDown" href="#" role="button" aria-labelledby="endTimeLabel" aria-expanded="{Binding showEndCalendarSelector}">                        <TextBlock Text="{Binding endDateTime}" />                    <\/a>                <\/span>            <\/div>            <div style:display="{Binding showEndCalendarSelector Converter=boolToDisplay}">                <div class="calendarSyncEndDate" data-tag="calendarSyncDate"><\/div>                <div class="calendarTime">                    <TimeControl Time="{Binding endTime Mode=TwoWay}" Editing="{Binding endEditingTime Mode=TwoWay}" Disabled="{Binding timeControlDisabled}" taskId="{Binding startTaskId}" />                    <div class="allDayEventCheckbox">                        <CheckBox Checked="{Binding isAllDayEvent Mode=TwoWay}" Value="{Binding resources.L_CalendarSync_AllDayEvent}" Content="{Binding resources.L_CalendarSync_AllDayEvent}" />                    <\/div>                <\/div>            <\/div>        <\/div>        <div class="calendarSyncExportButton" data-tag="calendarSyncExportButton">            <span class="cbtn b_highlighted">                <input type="submit" value="{Binding resources.L_CalendarSync_Export}" event:click="onExportClick"/>            <\/span>        <\/div>        <div class="calendarSyncTimeZoneDisclaimer" style:display="{Binding showTimeZoneDisclaimer Converter=boolToDisplay}">            <TextBlock Text="{Binding resources.L_CalendarSync_TimeZoneDisclaimer}" />        <\/div>    <\/div><\/div>',hu='<div class="dropdownTitleSelection">    <Dropdown ItemsSource="{Binding dropdownList}" event:onEntryClicked="onEntryClicked" Class="{Binding dropdownClass}">        <Dropdown.ItemTemplate>            <DataTemplate>                <div class="{Binding cssClass}">                    <CheckBox Content="{Binding name}" Checked="{Binding isSelected}" Value="" />                <\/div>            <\/DataTemplate>        <\/Dropdown.ItemTemplate>    <\/Dropdown><\/div>',cu='<div class="bm_filtersBar" data-tag="filtersBar" role="search" aria-label="{Binding resources.L_Landmark_FiltersBar_Aria_Label}">    <ItemsControl ItemsSource="{Binding _filtersViewModels}">        <ItemsControl.Template>            <DataTemplate>                <ul class="filters"><ItemsPresenter /><\/ul>            <\/DataTemplate>        <\/ItemsControl.Template>        <ItemsControl.ItemTemplate>            <DataTemplate>                <li class="filter" data-tag="filter">                    <a href="#" class="{Binding filterItem.cssClass}" data-instrumentation="{Binding filterItem.instrumentationData}" event:click="clickHandler" role="button"><TextBlock text="{Binding filterItem.displayName}" /><\/a>                    <div class="{Binding filterItem.cssClass}"><div class="routesPopOut"><\/div><\/div>                <\/li>            <\/DataTemplate>        <\/ItemsControl.ItemTemplate>    <\/ItemsControl>    <a href="#" class="expandFiltersButton" role="button"><\/a><\/div>',lu='<div class="bm_filtersStatusBar" data-tag="filtersStatusBar" aria-label="{Binding resources.L_Landmark_FiltersBar_Aria_Label}" style:display="{Binding isVisible Converter=boolToDisplay}">    <ItemsControl ItemsSource="{Binding selectedItems}">        <ItemsControl.Template>            <DataTemplate>                <ul class="filtersStatus"><ItemsPresenter /><\/ul>            <\/DataTemplate>        <\/ItemsControl.Template>        <ItemsControl.ItemTemplate>            <DataTemplate>                <li class="{Binding cssClass}" data-tag="filterStatus">                    <div><TextBlock Text="{Binding id Converter=itemToString}" /><\/div>                    <a href="#" class="{Binding id}" data-instrumentation="{Binding instrumentationData}" event:click="onDiscardFilterItemSelection" role="button"><\/a>                <\/li>            <\/DataTemplate>        <\/ItemsControl.ItemTemplate>    <\/ItemsControl><\/div>',yi='<div class="dropdownTitleList" data-tag="dropdownTitleList">    <a class="dropdownFocusDummy" tabindex="-1" title="{Binding resources.L_DropdownMenuDescription}"><\/a>    <Dropdown ItemsSource="{Binding dropdownList}" event:onEntryClicked="onEntryClicked" event:onEntryMouseover="onEntryMouseover" event:onEntryMouseout="onEntryMouseout" Class="{Binding dropdownClass}" AriaLabel="{Binding ariaLabel}">        <Dropdown.ItemTemplate>            <DataTemplate>                <div class="{Binding cssClass}" role="button">                    <div class="{Binding iconClass}"><\/div>                    <TextBlock Text="{Binding name}" />                <\/div>            <\/DataTemplate>        <\/Dropdown.ItemTemplate>    <\/Dropdown><\/div>',au='<PopOutButton PopOutContent="{Binding popOutContent}" PopOutTemplate="{Binding popOutTemplate}" IsDisplayed="{Binding isDisplayed Mode=TwoWay}" ButtonClass="{Binding buttonClass}"><\/PopOutButton>',vu='<div class="popupMessage" data-tag="popupMessage">    <PopOut Content="{Binding PopOut}">        <PopOut.ContentTemplate>            <DataTemplate>                <div class="messageContainer" event:click="onPopOutClick" tabindex="-1" role="dialog" aria-labelledby="saveMessage" event:keydown="onPopOutKeyPressed">                    <div class="saveMessage" id="saveMessage" data-tag="saveMessage">                        <TextBlock text="{Binding title}" />                        <PopUpMessageControl linkTitle="{Binding linkTitle}" showLink="{Binding showLink}" showChangeLink="{Binding showChangeLink}" event:popupLinkClicked="onPopOutLinkClick" event:popupChangeLinkClicked="onPopOutChangeLinkClick"/>                    <\/div>                    <div style:display="{Binding ShowAnnotate Converter=boolToDisplay}">                        <div class="annotateContainer" data-tag="AnnotateContainer" style:display="{Binding showFooter}">                            <div id="annotationLabel">                                <TextBlock text="{Binding updateNicknameMessage}" />                            <\/div>                            <div class="nameInputContainer">                                <input type="text" class="nameEditBox" data-tag="editItemTitleControl" maxlength="100" value="{Binding NickName Mode=TwoWay}" aria-labelledby="annotationLabel" />                                <a href="#" class="popoutSaveButton" data-tag="popoutSaveButton" event:click="onPopOutSaveLinkClick" event:touchend="onPopOutSaveLinkClick" role="button">                                    <TextBlock Text="{Binding saveButtonTitle}" />                                <\/a>                            <\/div>                        <\/div>                    <\/div>                <\/div>            <\/DataTemplate>        <\/PopOut.ContentTemplate>    <\/PopOut><\/div>',yu='<div class="dropdownTitleList" data-tag="dropdownTitleList">    <Dropdown ItemsSource="{Binding dropdownList}" event:onEntryClicked="onEntryClicked" Class="{Binding dropdownClass}">        <Dropdown.ItemTemplate>            <DataTemplate>                <div class="{Binding cssClass}">                    <div class="ratingStars"><div class="yellowStars"><\/div><div class="regularStars"><\/div><\/div>                    <div><TextBlock Text="{Binding name}" /><\/div>                <\/div>            <\/DataTemplate>        <\/Dropdown.ItemTemplate>    <\/Dropdown><\/div>',pu='<div class="signInPopup">    <PopOut Content="{Binding PopOut}">        <PopOut.ContentTemplate>            <DataTemplate>                <div>                    <SignInPopUpControl SignInMessage="{Binding title}" event:signInClicked="onPopOutLinkClick" event:signedIn="onSignedIn"/>                <\/div>            <\/DataTemplate>        <\/PopOut.ContentTemplate>    <\/PopOut><\/div>',wu='<div class="dropdownTitleList" data-tag="dropdownTitleList">    <Dropdown ItemsSource="{Binding dropdownList}" event:onEntryClicked="onEntryClicked" event:onEntryMouseover="onEntryMouseover" event:onEntryMouseout="onEntryMouseout" Class="{Binding dropdownClass}">        <Dropdown.ItemTemplate>            <DataTemplate>                <div class="{Binding cssClass}">                    <div class="{Binding iconClass}">                    <\/div>                    <div class="listItemText">                        <TextBlock Text="{Binding name}" />                    <\/div>                    <div class="arrow"><\/div>                <\/div>            <\/DataTemplate>        <\/Dropdown.ItemTemplate>    <\/Dropdown><\/div>',bu='<div id="settingsWrapper" class="MicrosoftMap collapsed b_cards">    <div class="b_divdef">        <div class="contentRoot mapSetting">            <div class="moduleRoot b_divdef">                <p class="moduleTitle">MAP STYLES<\/p>                <div class="legendTable">                    <table role="presentation">                        <tbody>                            <tr>                                <td>                                    <div class="tableRow">                                        <div class="tableCell"><a class="roadStyle" event:click="onRoadMapStyleClick"><\/a><\/div>                                        <div class="tableCell"><div><TextBlock Text="{Binding resources.MobileMapStyleRoad}" /><\/div><\/div>                                    <\/div>                                <\/td>                                <td>                                    <div class="tableRow">                                        <div class="tableCell"><a class="darkStyle" event:click="onDarkRoadMapStyleClick"><\/a><\/div>                                        <div class="tableCell"><div><TextBlock Text="{Binding resources.MobileMapStyleDark}" /><\/div><\/div>                                    <\/div>                                <\/td>                                <td>                                    <div class="tableRow">                                        <div class="tableCell"><a class="aerialStyle" event:click="onAerialMapStyleClick"><\/a><\/div>                                        <div class="tableCell"><div><TextBlock Text="{Binding resources.MobileMapStyleAerial}" /><\/div><\/div>                                    <\/div>                                <\/td>                            <\/tr>                        <\/tbody>                    <\/table>                <\/div>            <\/div>        <\/div>        <div class="mobileSettingContainer mapSetting" event:click="onTrafficClick">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <input id="mapStyleToggle" type="checkbox" class="labelToggle_Input" checked="{Binding trafficOn Mode=TwoWay}" />                    <label class="labelToggle_label">                        <TextBlock Text="{Binding resources.MobileShowTraffic}" />                    <\/label>                <\/div>            <\/div>        <\/div>        <div class="mobileSettingContainer pageSetting">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <a class="mobileSetting" href="/maps/myplaces/">                        <TextBlock Text="{Binding resources.MobileMyPlaces}" />                    <\/a>                <\/div>            <\/div>        <\/div>        <div class="mobileSettingContainer pageSetting">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <a class="mobileSetting" href="/maps/mycontributions/">                        <TextBlock Text="{Binding resources.MobileMyContributions}" />                    <\/a>                <\/div>            <\/div>        <\/div>        <div id="exploreNearYouSettings" class="mobileSettingContainer pageSetting hidden"              event:click="onExploreNearYouClick">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <label class="mobileSetting">                        <TextBlock Text="{Binding resources.MobileExploreNearYou}" />                    <\/label>                <\/div>            <\/div>        <\/div>        <div class="mobileSettingContainer pageSetting" event:click="onFeedbackClick">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <label class="mobileSetting">                        <TextBlock Text="{Binding resources.MobileFeedback}" />                    <\/label>                <\/div>            <\/div>        <\/div>        <div class="mobileSettingContainer">            <div class="labelToggle_Container labelStyle">                <div class="labelStyleSwitch">                    <a class="mobileSetting doneLabel" event:click="onDoneClick">                        <TextBlock Text="{Binding resources.MobileClose}" />                    <\/a>                <\/div>            <\/div>        <\/div>    <\/div><\/div>',ku='<div class="{Binding primitive.mapTypeClass}" data-tag="transientLensRoot">    <div id="transientLens" event:click="clickHandler" event:touchend="clickHandler" event:keydown="keydownHandler" data-tag="transientLens" style="visibility:hidden;">        <div class="transientLensImg"><\/div>        <div class="transientLensActions" role="menu">                        <ItemsControl ItemsSource="{Binding primitive.entity.actions}" panelTagName="ul">                <ItemsControl.ItemTemplate>                    <DataTemplate>                        <li role="none">                            <a href="#" class="{Binding cssClass}" event:click="handler" event:touchend="handler" event:keydown="handler" event:mouseover="mouseoverHandler" event:mouseout="mouseoutHandler" data-instrumentation="{Binding instData}" data-tag="{Binding cssClass}" role="menuitem">                                <div class="icon" ><\/div>                                <div class="actionText">                                    <TextBlock Text="{Binding text}" />                                <\/div>                                <div class="{Binding secTextClass}" style:display="{Binding showSecText Converter=boolToDisplay}"  event:click="secTextLinkHandler" event:touchend="clickHandler" data-tag="{Binding secTextClass}">                                    <TextBlock Text="{Binding secText}"/>                                <\/div>                                <div class="arrow" style:display="{Binding showArrow Converter=boolToDisplay}"><\/div>                            <\/a>                            <div class="transientLensSeparator" style:display="{Binding showSeparator Converter=boolToDisplay}"><\/div>                        <\/li>                    <\/DataTemplate>                <\/ItemsControl.ItemTemplate>            <\/ItemsControl>        <\/div>        <div class="directionsPopOut" data-tag="directionsPopOut">        <\/div>        <div class="travelPopOut" data-tag="travelPopOut">        <\/div>        <div class="collectionsPopOut" data-tag="collectionsPopOut">        <\/div>        <div class="nearbyPopOut" data-tag="nearbyPopOut">        <\/div>    <\/div><\/div>',a=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),ci;(function(n){n[n.TST=1]="TST";n[n.LI=2]="LI";n[n.PD=4]="PD";n[n.HO=5]="HO";n[n.PL=6]="PL";n[n.EV=9]="EV";n[n.LS=10]="LS";n[n.DE=11]="DE";n[n.LG=12]="LG";n[n.LC=13]="LC"})(ci||(ci={})),function(n){n[n.Q=1]="Q";n[n.R=2]="R";n[n.N=3]="N";n[n.C=4]="C";n[n.E=5]="E";n[n.V=6]="V"}(st||(st={}));var ii=function(){function n(){}return n.logEvent=function(t,i,r){r.SC=t;var e={logData:{feature:n.featureName,action:st[i],data:r},impressionGuid:s.dynamicProperties.mapsIG};f.invokeHandler(u.instrumentationDataHandlerKey,e)},n.featureName="ADS",n}(),pi=function(){function n(){}return n.isEnabled=function(){return!!(at&&at.isEnabled)},n.setShownAds=function(i,r,u,f){var y=0,o,c,e,p,s,w,k,l,b,h,a,v;if(r)for(c=r.length-1;c>=0;c--){if(e=t(r[c]).select(".mta_ad"),e&&e.length)for(p=e.length,y+=p,s=0;s<p;s++){for(w=e[s].getElementsByTagName("A"),k=function(){var t=w[l];t&&n.updateAdLink(t,u,function(){return n.logAdClick(t,a,!1,f)})},l=0;l<w.length;l++)k();e[s].addEventListener("click",function(t){return n.listItemClickHandler(t,a,u,f)});at&&at.extraLogging&&(b=t(e[s]),h=b.select(".ad_dse"),h&&h.length&&(o=(o||"")+"M"),h=b.select(".imgExt"),h&&h.length&&(o=(o||"")+"I"))}n.bindWhyThisAdHandler(t(r[c]))}y>0&&(a=n.getTracingTag(i),v={C:y},o&&(v.D=o,f&&(v.Q=f)),ii.logEvent(a,st.R,v))},n.bindWhyThisAdHandler=function(n){if(at&&at.enableWhyThisAd){var t=n.select("a[ce]");t.length>0&&t.for_each(function(n){if(n){var t=n.getAttribute("ce");t==="adcc"&&(n.setAttribute("ce",""),n.setAttribute("href","#"),n.addEventListener("click",function(t){var i,r,u;t&&(r=n.firstElementChild,u=r&&r.getAttribute("data-id"),(u||((i=t.target)===null||i===void 0?void 0:i.tagName)!=="A")&&t.preventDefault(),t.stopPropagation());typeof ads_choice!="undefined"&&ads_choice(n)}))}})}},n.updateAdLink=function(t,i,r){if(t){var u=t.getAttribute("h")||t.getAttribute("data-h");u&&(t.removeAttribute("h"),t.removeAttribute("data-h"),t.setAttribute("h1",u),t.addEventListener("click",function(){n.callGLink(t,i);r&&r()}));t.target||(t.target="_blank")}},n.callGLink=function(n,t){var r=n.getAttribute("h1"),u,i;if(r){u=_G.IG;try{_G.IG=t;i="&"+r+"&url="+encodeURIComponent(n.href);_w.si_sbwu&&_w.si_sbwu(i)||_w.si_T&&_w.si_T(i)}finally{_G.IG=u}}},n.getTracingTag=function(n){return n?ci[n]:""},n.logAdClick=function(n,t,i,r){var u=n.getAttribute("data-log"),f;u&&(i&&(u=u.replace("T","S")),f={L:u},r&&(f.D=r),ii.logEvent(t,st.C,f))},n.listItemClickHandler=function(t,i,r,u){function e(t){var e=t.getElementsByTagName("a"),f;e&&e.length>0&&(f=e[0],n.logAdClick(f,i,!0,u),n.callGLink(f,r),_w.open(f.href,"_blank"))}for(var f=t.target;f;){if(f.tagName==="A")return!0;if(f.className.indexOf("ad_sc")!==-1)break;if(f.getAttribute("role")==="button"||f.className.indexOf("infobubble_item")!==-1||f.className.indexOf("qv_noclick")!==-1)return!1;f=f.parentNode}return f?(e(f),t.stopPropagation(),!1):!1},n.logQueryEvent=function(n){ii.logEvent("WF",st.Q,{D:n})},n.logAdsShown=function(n){ii.logEvent("WF",st.V,{D:n})},n.logError=function(n,t){var i=typeof n=="string"?n:n&&n.message;ii.logEvent(t||"",st.E,{EX:i||""})},n}(),du=function(){function n(){}return n.setShownAds=function(t,i,r,u,f){var e,s,o;if(r&&r.length){if(e=r.select(i),e&&e.length)for(n.logEvent(t,u,"CI.TnAAdsShown",f),s=function(i){var o=e[i].getElementsByTagName("A"),r=o&&o[0];r&&pi.updateAdLink(r,u,function(){return n.logEvent(t,u,"CI.TnAAdsClick",f,r.href)})},o=0;o<e.length;o++)s(o);pi.bindWhyThisAdHandler(r)}},n.logEvent=function(t,i,r,e,o){var s={SC:t},h;o&&(s.adsUrl=o);e&&(s.CAT=e);h={logData:{feature:n.featureName,action:r,data:s},impressionGuid:i};f.invokeHandler(u.instrumentationDataHandlerKey,h)},n.featureName="TnAAds",n}(),li=function(n){function t(t,i,r,u,f){var e=this,o={};return e=n.call(this,o)||this,e.suggestion=t,o.defineProperty("isSelected",null,null,{defaultValue:!1}),e._formatSuggestion(e.suggestion),e._applyImageClass(t),e.setSimpleSearchText(),e._itemSelectionEvent=i,e._itemClickEvent=r,e._instrumentationHelper=u,e.optionId=f,e}return a(t,n),t.prototype.setSimpleSearchText=function(){var n=this._formattingRule&&this._formattingRule["b:groupSeparator"]||", ";if(this.suggestion.type==="Favorite"){var t=this.suggestion,i=t.name,r=t.address&&t.address.streetAddress;this._searchText=i===r||!r?i:i+n+r}else this._searchText=this.suggestionTextLine2?e.searchTextFormat?e.searchTextFormat.replace("{line1}",this.suggestionTextLine1).replace("{line2}",this.suggestionTextLine2).replace("{separator}",n):this.suggestionTextLine1+n+this.suggestionTextLine2:this.suggestionTextLine1;this.suggestion&&(this.suggestion.searchText=this._searchText)},t.prototype.handleSuggestionClick=function(n){n.currentTarget&&(this._itemClickEvent&&this._itemClickEvent.invoke(this.suggestion),this._instrumentationHelper&&this._instrumentationHelper.instrumentSearchEvent(this._searchText,1,this.suggestion))},t.prototype.select=function(){this._itemSelectionEvent&&this._itemSelectionEvent.invoke(this.suggestion)},t.prototype.dispose=function(){l._disposeEvents(this);this.suggestion=null;n.prototype.dispose.call(this)},t.prototype._formatSuggestion=function(n){var i=this.suggestion.formattingRule,t=n;if(n.type==="Favorite"){this.suggestionTextLine1=t.subType==="Home"?r.L_Home:t.subType==="Work"?r.L_Work:t.alternateName?t.alternateName:t.name;this.suggestionTextLine2=t.address&&t.address.streetAddress;this.suggestion.formatedAddress=t.address&&t.address.streetAddress;this.suggestion.title=t.name;return}t.name&&(this.suggestionTextLine1=t.name,n.title=t.name);t.query&&(this.suggestionTextLine1=t.query);i?(this._formattingRule=i,this.suggestion.address?this._applyFormattingRule(this.suggestion.address):this._applyFormattingRule(n.root)):(this.suggestionTextLine1=n.title,this.suggestionTextLine2=n.formatedAddress);this.setAriaLabel();this.suggestion.formatedLine1=this.suggestionTextLine1;this.suggestion.formatedLine2=this.suggestionTextLine2},t.prototype.setAriaLabel=function(){var t,n;this.ariaLabel=this.suggestionTextLine1;this.suggestionTextLine2&&(this.ariaLabel+=", "+this.suggestionTextLine2);t=this.suggestion.suggestionRank;t!==null&&t!==undefined&&(n=w.ASIndexText,n=n?n.replace("{0}",(t+1).toString()):"",this.ariaLabel+=", "+n)},t.prototype._applyFormattingRule=function(n){var t=0,i=this._formattingRule["b:fieldGroups"]||this._formattingRule.fieldGroups,r,u,f,e;if(!this.suggestionTextLine1&&i)for(;t<i.length;t++)if(r=this._getFormattedGroupString(n,i[t]),r){this.suggestionTextLine1=r;this.suggestion.title=r;++t;break}if(u=[],i)for(;t<i.length;t++)f=this._getFormattedGroupString(n,i[t]),f&&u.push(f);e=this._formattingRule["b:groupSeparator"]||this._formattingRule.groupSeparator||", ";this.suggestionTextLine2=u.join(e);this.suggestion.formatedAddress=this.suggestionTextLine2},t.prototype._applyImageClass=function(n){var i=e.showXSRColors&&(s.isMapsAnswer||s.isMapsVertical||e.isMobileShellAutosuggest),u=!e.showXSRIcons&&s.isMapsVertical;this.suggestionImgClass=n.type==="s:BusinessEntityType"&&n.subType==="BusinessCategory"||n.type==="SearchAction"?i?"as_img maps_searchsvg":"as_img maps_search":n.type==="s:LocalBusiness"&&n.subType?i?"as_img maps_businesssvg":u?"as_img maps_address":"as_img maps_business":n.type&&(n.type.indexOf("Place")>=0||n.type.indexOf("PostalAddress")>=0)?i?"as_img maps_addresssvg":"as_img maps_address":n.title===r.L_Work||n.subType==="Work"?i?"as_img maps_worksvg":"as_img maps_work":n.title===r.L_Home||n.subType==="Home"?i?"as_img maps_homesvg":"as_img maps_home":n.type==="Favorite"?i?"as_img maps_favsvg":"as_img maps_favorite":n.type==="History"||n.type===t.HistorySuggestionType?"as_img maps_history":n.title===r.L_MyLocation?"as_img maps_mylocation":n.entityId&&n.entityId.indexOf("local_geoid")<0?i?"as_img maps_businesssvg":u?"as_img maps_address":"as_img maps_business":i?"as_img maps_searchsvg":"as_img maps_search"},t.prototype._getFormattedGroupString=function(n,t){for(var e,f=[],i,u=t.fields,r=0;r<u.length;r++)i=this._getPrimaryField(n,u[r]),i||(i=this._getAlternateField(n,u[r])),i&&f.push(i);return e=t.fieldSeparator||" ",f.join(e)},t.prototype._getPrimaryField=function(n,t){var i;return n&&t&&(i=n[t.name]),i},t.prototype._getAlternateField=function(n,t){var r,u,f,i;if(n&&t&&(u=t.alternateField,u))for(f=u.split(","),i=0;i<f.length;i++)if(r=n[f[i]],r)break;return r},t.HistorySuggestionType="history",t}(ct),ft=function(){function n(){}return n.autosuggestFeature="MapsAutoSuggest",n.actionSearchEvent="Search Event",n.searchEventSuggestionSelectSuggestionClick="Suggestion Select:Suggestion Click",n.searchEventSuggestionSelectEnterPress="Suggestion Select:Enter Press",n.searchEventSuggestionSelectSearchButtonClick="Suggestion Select:Search Button Click",n.searchEventEnterPress="Enter Press",n.searchEventSuggestionShown="Suggestions Shown",n.searchEventSearchButtonClick="Search Button Click",n.AppNameSpace="App",n.AppName="web",n.UIFieldName="UI",n.UIType="sbx",n.LocalTime="LTime",n.suggestionSourceServer="S",n.sdkEntryPoint="SDK",n.mapsEntryPoint="Maps",n}(),gu=function(){function n(n){this._resetConversationId();this._refreshCid=!1;this._entryPoint=n?ft.sdkEntryPoint:ft.mapsEntryPoint}return n.prototype.setRequestAndSuggestions=function(n,t){this._request=n;this._suggestions=t},n.prototype.setResponseModel=function(n){this._responseModel=n},n.prototype.createDirectionsInstrumentationData=function(n,t,i){var r,u;for(this._directionsInstrumentationData={},this._directionsInstrumentationData.cmdir=n,this._directionsInstrumentationData.contextId=i,r=0;r<t.length;r++)u="from",r===1?u="to":r>=2&&(u="to"+r),t[r].address&&(this._directionsInstrumentationData["cq"+u]=t[r].address),t[r].eid&&(this._directionsInstrumentationData["ce"+u]=t[r].eid),t[r].type&&(this._directionsInstrumentationData["cc"+u]=t[r].type),t[r].stype&&(this._directionsInstrumentationData["cg"+u]=t[r].stype)},n.prototype.resetLastShownSuggestionsTime=function(){this._lastShownSuggestionsTimeStamp=new Date},n.prototype.setSearchStartTimeStamp=function(){this._searchStartTimeStamp||(this._searchStartTimeStamp=new Date)},n.prototype.dismissSearchStartTimeStamp=function(){this._searchStartTimeStamp&&(this._lastConverationDuration=Date.now()-this._searchStartTimeStamp.getTime(),this._searchStartTimeStamp=null)},n.prototype.instrumentSearchEvent=function(n,t,i){var r,o,h,e;if(this._request){if((t===1||t===3)&&this.instrumentSelectionEvent(i),r={},this._responseModel&&(r.Md=this._responseModel),r.App=ft.AppName,r.LTime=this._getFormattedDate(new Date,"{yyyy}{mm}{dd}{hh}{nn}"),r.FN=ft.autosuggestFeature,r.EP=this._entryPoint,r.UL=this._request.userLocation,r.Bx=this._request.localMapView,r.M=s.dynamicProperties.market,r.L=s.dynamicProperties.uiLanguage,r.Q=n,r.NS=this._suggestions.length,r.NR=this._suggestions.length,r.S=this._getEventNameFromType(t),r.Cid=this._conversationId,i&&(r.Clk=i.suggestionRank),this._refreshCid&&(this._resetConversationId(),this._refreshCid=!1),t!==4&&(this._refreshCid=!0,this.dismissSearchStartTimeStamp(),r.E=this._lastConverationDuration),this._directionsInstrumentationData&&(r.Direction=this._directionsInstrumentationData),this._suggestions&&i&&t!==4)o=[],o.push(this._getSuggestionItemInstrumentationData(this._suggestions[i.suggestionRank])),r.Sg=o;else if(this._suggestions&&t===4){for(h=[],e=0;e<this._suggestions.length;e++)h.push(this._getSuggestionItemInstrumentationData(this._suggestions[e]));r.Sg=h}f.invokeHandler(u.instrumentationDataHandlerKey,{logData:r})}},n.prototype.instrumentLoadCompeleteEvent=function(n){ot.downloadGeneric(n,ri.autosuggestCallerId,null)},n.prototype.instrumentSelectionEvent=function(n){if(n.instrumentationInfo){var t=n.instrumentationInfo.pingUrlBase;t+=n.readLinkPingSuffix;ot.downloadGeneric(t,ri.autosuggestCallerId,null)}},n.prototype.getConversationId=function(){return this._conversationId},n.prototype._resetConversationId=function(){this._conversationId=l._generateRandomKey()},n.prototype._getFormattedDate=function(n,t){var o=n.getFullYear().toString(),i=n.getMonth()+1,r=n.getDate(),u=n.getHours(),f=n.getMinutes(),e=n.getSeconds();return t.replace("{yyyy}",o).replace("{mm}",i<10?"0"+i.toString():i.toString()).replace("{dd}",r<10?"0"+r.toString():r.toString()).replace("{hh}",u<10?"0"+u.toString():u.toString()).replace("{nn}",f<10?"0"+f.toString():f.toString()).replace("{ss}",e<10?"0"+e.toString():e.toString())},n.prototype._getEventNameFromType=function(n){switch(n){case 1:return ft.searchEventSuggestionSelectSuggestionClick;case 2:return ft.searchEventEnterPress;case 3:return ft.searchEventSuggestionSelectEnterPress;case 4:return ft.searchEventSuggestionShown;case 6:return ft.searchEventSearchButtonClick;case 5:return ft.searchEventSuggestionSelectSearchButtonClick}},n.prototype._getSuggestionItemInstrumentationData=function(n){var t={};return n&&(t.S=ft.suggestionSourceServer,t.Eid=n.suggestionTextLine1+"~"+n.suggestionTextLine2+"~"+(n.suggestion.entityId||n.suggestion.geoId||""),t.C=n.suggestion.type,t.G=n.suggestion.subType),t},n}(),ri=function(){function n(n){this._suggestionTypes=n||"";this._parseLocationFromAS=!0}return n.prototype.addExtraASParams=function(n){return n},n.prototype.setInstrumentationHelper=function(n){this.instrumentationHelper=n},n.prototype.getDefaultSuggestions=function(){return[]},n.prototype.getSuggestions=function(t,i){var r=this,u,f,o,s;if(!t.disableThisRequest){if((!t.searchText||t.searchText.trim()==="")&&!this._useFavoriteSuggestions){this._currentRequestCallbackId="";u=this.getDefaultSuggestions();f=this.getHistorySuggestions();u=this._combineSuggestions(f,u);this._updateSuggestionsRank(u);o={suggestions:u};i(o);return}s=this._constructASRequestUrl(t);this._currentRequestCallbackId=Date.now().toString()+t.searchText;eu.instance.authenticateClientAndRetrieveSessionId(function(){r._currentNetworkRequestId=ot.downloadJson(s,n.autosuggestCallerId,function(n,u){var o;if(u===r._currentRequestCallbackId){var f=r._parseSuggestionsV6(n),s=r.getHistorySuggestions(t.searchText),h=!t.searchText||t.searchText.trim()===""?r.getDefaultSuggestions():[];f.suggestions=r._combineSuggestions(f.suggestions,s);f.suggestions=r._combineSuggestions(f.suggestions,h);r._updateSuggestionsRank(f.suggestions);i(f,e.enableQueryCompletion?n.queryCompletion:null,e.enableQueryCompletion?n.instrumentation:null);n.instrumentation&&r.instrumentationHelper&&(o=n.instrumentation.pageLoadPingUrl,r.instrumentationHelper.instrumentLoadCompeleteEvent(o))}},function(){},r._currentRequestCallbackId,!0,null,!1,null)})}},n.prototype.getHistorySuggestions=function(){return[]},n.prototype.getMaxResults=function(){return e.autoSuggestMaxResults},n.prototype._constructASRequestUrl=function(n){var t=e.autoSuggestServiceUrlFormat,l=encodeURIComponent(n.searchText),i=s.dynamicProperties,f=e.autoSuggestServiceHostUrlFormat.replace("{BingHostName}",i.bingRequestDomain),o=window.location.search.substr(1),h=o.indexOf("asep"),c,r,u;if(h>=0){t=t.replace("?","&");var a=o.substr(h),v=a.split("&"),y=v[0].split("=");f=decodeURIComponent(y[1])}return c=n.maxResults?n.maxResults:this.getMaxResults(),t=t.replace("{host_url}",f).replace("{local_map_view}",n.localMapView||"").replace("{user_location}",n.userLocation||"").replace("{max_results}",c.toString()).replace("{app}",n.applicationName||"webv8").replace("{query}",l).replace("{ig}",i.impressionGuid).replace("{conversation_id}",this.instrumentationHelper&&this.instrumentationHelper.getConversationId()).replace("{appid}",n.applicationId||e.autosuggestAppid||i.appId).replace("{market}",n.market||i.market).replace("{lang}",i.uiLanguage).replace("{suggestionTypes}",n.suggestionTypes||this._suggestionTypes),t=this.addExtraASParams(t,n),t=t.replace("{histcnt}",""),t=t.replace("{favcnt}",""),n.countryCode&&n.countryCode.length===2&&(t+="&constraints=country:"+n.countryCode),r=!n.disableFavorites,u=e.autosuggestHistory&&!n.disableHistory,(r||u)&&(t+="&ptypes=",t+=r?"favorite":"history",t+=r&&u?",history":""),t+="&clientid="+i.clientId,e.abbrSuggestions&&(t+="&abbrtext=1"),e.enableQueryCompletion&&(t+="&features=qcon"),t},n.prototype._combineSuggestions=function(n,t){var u=[],f,i,o,r;if(t&&t.length)for(u=t,f=!1,i=0;i<n.length;i++){var l=n[i].root,e=n[i].address,s=e&&e.streetAddress,h=e&&e.addressLocality,c=n[i].name;for(o=0;o<t.length;o++)if(r=t[o],s&&r.formatedAddress&&r.formatedAddress.indexOf(s)>-1&&(h&&r.formatedAddress.indexOf(h)>-1||c&&r.title&&r.title.indexOf(c)>-1)){f=!0;break}if(f){f=!1;continue}else u.push(n[i])}else u=n;return u},n.prototype._updateSuggestionsRank=function(n){for(var t=0;t<n.length;t++)n[t].suggestionRank=t},n.prototype.buildSuggestion=function(n,t,i,r,u){var f={},s,o,h,c,l;return f.root=n,f.type=n._type,f.readLink=n.readLink,f.readLinkPingSuffix=n.readLinkPingSuffix,f.instrumentationInfo=i,f.suggestionRank=t,f.formattingRuleId=n.formattingRuleId,f.formattingRule=r,f.entityId=e.enableQueryCompletion&&u?null:n.id,f.name=n.name,f.query=n.query,s=n.categories,f.primaryCategoryPath=s&&s.length&&s[0],f.entityId&&f.entityId.indexOf("local_geoid")===0&&(f.geoId=f.entityId,f.entityId=""),o=n.entityPresentationInfo,o&&o.entitySubTypeHints&&o.entitySubTypeHints.length&&(f.subType=o.entitySubTypeHints[0]),h=n.geo,h&&this._parseLocationFromAS&&(c=h.latitude,l=h.longitude,c&&l&&(f.location=new wt(c,l))),n.address?f.address=n.address:n.location&&n.location.length?f.address=n.location[0].address:f.type==="PostalAddress"&&(f.address=n),f.type=="Favorite"&&(f.alternateName=n.alternateName,f.subType=n.subType,this._processFavoriteItemId(n,f)),f},n.prototype._parseSuggestionsV6=function(n){var t={},e=[],o,s,u,i,f,r,h;if(n)for(o=n.instrumentation,t.formattingRules=this._createFormattingRulesV6(n.formattingRules),s=this._getDefaultFormattingRuleV6(t.formattingRules),this.instrumentationHelper&&this.instrumentationHelper.setResponseModel(n.model),u=n.value,i=0;i<u.length;i++){f={};try{r=u[i];h=r.formattingRuleId&&t.formattingRules[r.formattingRuleId]||s;f=this.buildSuggestion(r,i,o,h);e.push(f)}catch(c){}}return t.suggestions=e,t},n.prototype._createFormattingRulesV6=function(n){var r={},t,i;if(n)for(t=0;t<n.length;t++)i=JSON.parse(n[t]),r[i.identifier]=i;return r},n.prototype._getDefaultFormattingRuleV6=function(n){var t=n&&n.Default||null,i,r;for(i in n)if(t||(t=n[i]),r=s.dynamicProperties.market.toLowerCase(),r.indexOf(i.toLowerCase())>-1){t=n[i];break}return t},n.prototype._processFavoriteItemId=function(n,t){var i=n.bingId;i&&(i.indexOf("local_ypid:")===0||i.indexOf("sid")===0||i.indexOf("local_vdpid")===0)&&(t.entityId=i);t.bingId=i},n.autosuggestCallerId="autosug",n}(),nf=function(n){function i(t,i,u,f,e,o){var h=this,c={};return h=n.call(this,c)||this,c.defineProperty("showNearBySearchText"),c.defineProperty("showSuggestionsPanel",function(n,t){h._onVisibleChanged(n,t)},null,{defaultValue:!1}),c.defineProperty("showBingLogo",null,null,{defaultValue:!l._hasBingHeaders()}),c.defineProperty("width",null,null,{defaultValue:0}),c.defineProperty("cssClass"),c.defineProperty("id"),c.defineProperty("ariaOwns"),c.defineProperty("showInPrivateLink"),s.isInPrivateMode&&(s.isMapsVertical||s.isMapsAnswer)&&h.setShowInPrivateLink(!0),h._displayWaterMarkText=u,h._controlTemplateFactory=i,h._autosuggestDataModel=t,h.templateId=su,h._suggestions=[],h._currentQueryCompletion=null,h._currentSuggestion=null,h._mapTemplateSelectorReadyEvent=new p,h.taskName=f||l._generateRandomKey(),h._visibilityChangedEvent=e,h._selectionChangedEvent=o,h.inPrivateText=r.InPrivateAutosuggestFooterText,h.inPrivateLinkText=r.InPrivateAutosuggestFooterLink,h}return a(i,n),i.prototype.setMap=function(n){var t=this;this._map=n;this._map&&this._map.getTemplateSelector().then(function(n){t._mapTemplateSelector=n;t._mapTemplateSelectorReadyEvent.invoke()})},i.prototype.setAsTextBox=function(n){this._asTextBox=n},i.prototype.setRefreshSuggestionEvent=function(n){this._updateSuggestions=n},i.prototype.setItemSelectionEventHandler=function(n){this._itemSelectionEvent=n},i.prototype.setItemClickEventHandler=function(n){this._itemClickEvent=n},i.prototype.updateSuggestions=function(n,t){var i=this;this.selectedItemIndex=-1;this._selectionChangedEvent&&this._selectionChangedEvent.invoke("");this._request=n;this.setSuggestions([]);this._instrumentationHelper&&this._instrumentationHelper.setSearchStartTimeStamp();this._autosuggestDataModel.getSuggestions(n,function(r,u,f){i._onSuggestionsCallBack(n,t,r,i._isSearchContainer(t)?u:null,f)})},i.prototype.boolToVisibility=function(n){return n?"visible":"hidden"},i.prototype.boolToSelectedClassName=function(n){return n?"suggestLink selected":"suggestLink"},i.prototype.boolToDisplay=function(n){return n?"inline":"none"},i.prototype.numberToPixelString=function(n){return n?n.toString()+"px":""},i.prototype.stopAutosuggestion=function(){this.removeWidth();this.setShowSuggestionsPanel(!1);this._instrumentationHelper.dismissSearchStartTimeStamp();this._hideCompletedQuery()},i.prototype.selectNextItem=function(){var n=this._suggestions.length;if(n!==0)return(this.selectedItemIndex>=0&&this._suggestions[this.selectedItemIndex].setIsSelected(!1),this.selectedItemIndex++,this.selectedItemIndex>=n)?(this.selectedItemIndex=-1,!1):(this._suggestions[this.selectedItemIndex].setIsSelected(!0),this._suggestions[this.selectedItemIndex].select(),this._selectionChangedEvent&&this._selectionChangedEvent.invoke(this._suggestions[this.selectedItemIndex].optionId),this._hideCompletedQuery(),!0)},i.prototype.selectPreviousItem=function(){var n=this._suggestions.length;if(n!==0){if(this.selectedItemIndex>=0&&this._suggestions[this.selectedItemIndex].setIsSelected(!1),this.selectedItemIndex===-1)this.selectedItemIndex=n-1;else if(this.selectedItemIndex--,this.selectedItemIndex<0)return this.selectedItemIndex=-1,!1;return this._suggestions[this.selectedItemIndex].setIsSelected(!0),this._suggestions[this.selectedItemIndex].select(),this._selectionChangedEvent&&this._selectionChangedEvent.invoke(this._suggestions[this.selectedItemIndex].optionId),this._hideCompletedQuery(),!0}},i.prototype.completeCurrentQuery=function(){if(this._currentQueryCompletion){var i=t("#maps_sb"),n=this._autosuggestDataModel.buildSuggestion(this._currentQueryCompletion.completionEntity,-1,this._currentQueryCompletion.instrumentation,this._currentQueryCompletion.completionEntity.formattingRuleId,this._currentQueryCompletion.completionType!=="Query"),r=this._currentQueryCompletion.prefix+this._currentQueryCompletion.suffix;n.query=n.name=n.title=r;i.length>0&&(i[0].value=r);this._currentSuggestion=new li(n,this._itemSelectionEvent,this._itemClickEvent,this._instrumentationHelper,this.taskName+"-as-qc");this.selectedItemIndex>=0&&(this._suggestions[this.selectedItemIndex].setIsSelected(!1),this.selectedItemIndex=-1);this._currentSuggestion.setIsSelected(!0);this._hideCompletedQuery();this._currentQueryCompletion.instrumentation&&this._currentQueryCompletion.readLinkPingSuffix&&this._instrumentationHelper.instrumentSelectionEvent({instrumentationInfo:this._currentQueryCompletion.instrumentation,readLinkPingSuffix:this._currentQueryCompletion.readLinkPingSuffix});this._updateSuggestions&&this._updateSuggestions.invoke()}},i.prototype.hideQueryCompletion=function(){this._hideCompletedQuery()},i.prototype.getCurrentSuggestion=function(){return this._currentSuggestion},i.prototype.clearCurrentQueryCompletionState=function(){this._currentQueryCompletion=null;this._currentSuggestion=null;this._hideCompletedQuery()},i.prototype.isExpectedNextChar=function(n){var i=t("#maps_sb");if(i&&i.length>0){var r=i[0].value,u=r&&n?r+n.key:"",f=this._currentQueryCompletion?this._currentQueryCompletion.prefix+this._currentQueryCompletion.suffix:"";return u&&f.indexOf(u)===0}return!1},i.prototype.hasCompletionQuery=function(){return this._currentQueryCompletion!==null},i.prototype.completePredictedQuery=function(){return this._currentQueryCompletion?this._currentQueryCompletion.prefix+this._currentQueryCompletion.suffix:null},i.prototype.logAutosuggestClientInst=function(n,t,i,r){var e={},o;t&&(e.keyPress=t);i&&(e.seedQuery=i);r&&(e.query=r);o={logData:{feature:"ASSC",action:n,data:e}};f.invokeHandler(u.instrumentationDataHandlerKey,o)},i.prototype.removeWidth=function(){var n=t(".as_container_search"),i;n&&(i=n.get_attr("style"),i.indexOf("width")>-1&&i.indexOf("visibility")===-1&&(n.remove_attr("style"),n.set_attr("style","visibility: hidden")))},i.prototype.inPrivateLinkClick=function(n){n.stopPropagation();window.location.href=e.inPrivateLink},i.prototype._setWidth=function(){var r=t(".as_container_search"),n;if(r.length&&this._asTextBox.id&&this._asTextBox.id.indexOf("maps_sb")>-1){if(n=r[0].parentElement,n&&n.id.indexOf("maps_sb_container")>-1&&n.querySelector(":focus")){var f=n.parentElement,a=Number(f.clientWidth),v=t(f).select(".searchbox").get_style("borderWidth"),i=parseInt(v);i=isNaN(i)?0:i;var o=t(".bm_overflowCountContainer")[0],u=o?Number(o.clientWidth):0,h=a-u+i*2,y=u,c={width:h+"px"};c[l._isRtl()?"margin-right":"margin-left"]=y+"px";r.set_style(c);e.enableQueryCompletion&&this._adjustQueryCompletionWidth(h,u);e.showXSRColors&&(s.isMapsVertical||e.isMobileShellAutosuggest)||this._adjustIconCentering()}}else this.removeWidth()},i.prototype._hideCompletedQuery=function(){e.enableQueryCompletion&&t(".bm_completionBox").add_class("bm_completionBoxHidden")},i.prototype._showCompletedQuery=function(){e.enableQueryCompletion&&t(".bm_completionBox").remove_class("bm_completionBoxHidden")},i.prototype._adjustQueryCompletionWidth=function(n,i){if(e.enableQueryCompletion){var u=i?i:0,r=t(".bm_completionBox");r.length>0&&r.set_style({width:n+"px","padding-left":u+"px"})}},i.prototype._showQueryCompletionSuggestion=function(n,i){if(n&&n.suffix){var r=t("#maps_sb"),e=t(".bm_overflowCountContainer"),o=t(".bm_completionBox"),u=o.length>0&&o[0],f=n.prefix+n.suffix;u&&u.value!==f&&(u.value=f);this._currentQueryCompletion=n;this._currentQueryCompletion.instrumentation=i;this._showCompletedQuery();r.add_class("bm_as_queryComp");r.length>0&&this._adjustQueryCompletionWidth(r[0].clientWidth,e.length>0?e[0].clientWidth:0);this.logAutosuggestClientInst("QCSHOW",null,n.prefix,f)}},i.prototype._isSearchContainer=function(n){return n&&n.length>0&&(n[0].id==="maps_sb_container"||n[0].id==="sb_as_container")},i.prototype._updateQueryCompletion=function(n,t,i,r){n&&i&&this._isSearchContainer(t)&&(n.lastKeyDown&&n.lastKeyDown.keyCode===8?this._hideCompletedQuery():this._showQueryCompletionSuggestion(i,r))},i.prototype._onSuggestionsCallBack=function(n,i,r,u,f){var a=n.searchText,v=r.suggestions,h,c,l,o,y;if((document.activeElement===this._asTextBox||!this._asTextBox)&&a===this._request.searchText)if(v.length>0){for(h=[],c=0;c<v.length;c++)h.push(new li(v[c],this._itemSelectionEvent,this._itemClickEvent,this._instrumentationHelper,this.taskName+"-as-"+c));this._instrumentationHelper&&this._instrumentationHelper.resetLastShownSuggestionsTime();this.setSuggestions(h);l=t("#sb_as_container");l&&l.length>0&&(o=w&&w.ASContainerCountText,o=o?o.replace("{0}",h.length.toString()):"",l.set_attr("aria-label",o),y=h.length>0?o:null,this._setScreenReaderText(y));this._instrumentationHelper&&this._instrumentationHelper.instrumentSearchEvent(a,4,this.getSelectedSuggestion());this._applyAutoSuggestControlTemplateBinding(i,a);e.enableQueryCompletion&&this._updateQueryCompletion(n,i,u,f);e.showXSRIcons&&this._updateCategoryIconsAfterSelectorReady(i);this.removeWidth();this._setWidth();e.showXSRColors&&(s.isMapsVertical||e.isMobileShellAutosuggest)||this._adjustIconCentering()}else this.removeWidth(),this.setShowSuggestionsPanel(!1)},i.prototype._updateCategoryIconsAfterSelectorReady=function(n){var t=this;!this._mapTemplateSelector&&this._map?this._mapTemplateSelectorReadyEvent.addOne(function(){t._updateCategoryIcons(n)}):this._mapTemplateSelector&&this._updateCategoryIcons(n)},i.prototype._updateCategoryIcons=function(n){for(var f,r,e,u=this.getSuggestions(),o=n.select("[data-tag=as_img]"),i=0;i<u.length;i++)f=u[i].suggestion.primaryCategoryPath,f&&(r=rt.extractCategoryId(f,!1),r&&(u[i].categoryId=r,e=t(o[i]),this._updateCategoryIconAfterDownload(r,e)))},i.prototype._updateCategoryIconAfterDownload=function(n,t){var r=e.showXSRColors&&(s.isMapsVertical||e.isMobileShellAutosuggest),i=null;r||(i=e.isMobileDarkTheme?gi.white:gi.black);this._mapTemplateSelector.getCategoryIconTemplate(function(n){var i=n&&n.icon;i&&(t.clear(),t.remove_class("maps_search maps_business maps_address maps_skiarea maps_airport maps_searchsvg maps_businesssvg maps_addresssvg"),t.append(i.renderIcon()))},n,i,30,30)},i.prototype._onVisibleChanged=function(n,i){if(t.Browser.is_ie&&n!==i&&(this.nearBySearchText=this._asTextBox&&this._displayWaterMarkText?this._asTextBox.getAttribute("placeholder"):""),this.setShowNearBySearchText(this.nearBySearchText&&this.nearBySearchText!==""),this.removeWidth(),this._visibilityChangedEvent&&this._visibilityChangedEvent.invoke(i),!i){this._screenReaderText=null;var r=document.getElementById("as_screenreader");r&&(clearTimeout(this._screenReaderTimeout),r.textContent="")}},i.prototype._applyAutoSuggestControlTemplateBinding=function(n,i){var f={templateText:this.templateId,staticResources:this},u,r;this._controlTemplate&&this._controlTemplate.dispose();this._controlTemplate=this._controlTemplateFactory(f);u=this._controlTemplate.applyDataTemplate(this);r=t(".as_container",n[0]);r&&r.removeFromParent();i===this._request.searchText&&(n.append(u),this.setShowSuggestionsPanel(!0))},i.prototype.setSuggestions=function(n){this._suggestions=n;this._instrumentationHelper&&this._instrumentationHelper.setRequestAndSuggestions(this._request,n)},i.prototype.setInstrumentationHelper=function(n){n&&(this._instrumentationHelper=n,this._autosuggestDataModel.setInstrumentationHelper(this._instrumentationHelper))},i.prototype.getSuggestions=function(){return this._suggestions},i.prototype.getSelectedSuggestion=function(){return this.selectedItemIndex>=0?this._suggestions[this.selectedItemIndex].suggestion:null},i.prototype.getFirstSuggestion=function(){return this._suggestions.length>0?this._suggestions[0].suggestion:null},i.prototype.dispose=function(){this._map=null;l._disposeEvents(this);l._clearDisposables(this._suggestions);n.prototype.dispose.call(this)},i.prototype._adjustIconCentering=function(){for(var n,u,f,r=t(".as_suggestion_root_inside"),i=0;i<r.length;i++)n=r[i],n&&(u=n.clientHeight,f=n.getElementsByClassName("as_img")[0],t(f).set_style({height:u}))},i.prototype._setScreenReaderText=function(n){var t=this;this._screenReaderTimeout&&clearTimeout(this._screenReaderTimeout);this._screenReaderTimeout=setTimeout(function(){var i=document.getElementById("as_screenreader");i&&t._screenReaderText!==n&&(t._screenReaderText=n,i.textContent="",i.textContent=n)},1e3)},i}(ct),ir=function(){function n(n,i,r,u,f,o){var h=this,s=i[0],c;this._map=f;this._searchBoxContainer=n;this._instrumentationHelper=new gu(o);this._autosuggestViewModel=u;this._autosuggestViewModel.setAsTextBox(s);this._autosuggestViewModel.setInstrumentationHelper(this._instrumentationHelper);this._autosuggestViewModel.setCssClass(r+" as_container");this._compositionEnds=!1;this._lastKeyDown=-1;r.indexOf("search")>-1&&(c="",i&&i.length&&(c="_"+i[0].id),this._autosuggestViewModel.setId("as_containerSearch"+c));this._autosuggestViewModel.setMap(f);this.asTextBox=i;t(s).set_attr("autocorrect","off").set_attr("autocapitalize","off");this.attachEvents();e.enableQueryCompletion&&(this._onUpdateSuggestions=new p,this._onUpdateSuggestions.add(function(){h.refreshAutosuggest()}),this._autosuggestViewModel.setRefreshSuggestionEvent(this._onUpdateSuggestions));e.waitForCompositionEnd&&(s.addEventListener("compositionend",function(){h._compositionEnds=!0}),s.addEventListener("compositionstart",function(){h._compositionEnds=!1}))}return n.prototype.stopAutosuggest=function(n){n===void 0&&(n=!0);this._removeGlobalEventHandlers();this._onAutosuggest&&this._onAutosuggest.invoke(!1);this._onFocusEvent&&this._onFocusEvent.invoke(!1);this._autosuggestViewModel.stopAutosuggestion();n&&this.asTextBox[0].blur()},n.prototype.removeEventHandlers=function(){this._onKeyDownHandler&&this.asTextBox.remove_event("keydown",this._onKeyDownHandler);this._onKeyDownHandler=null;this._onFocusHandler&&this.asTextBox.remove_event("focus",this._onFocusHandler);this._onFocusHandler=null;this._onClickHandler&&this.asTextBox.remove_event("click",this._onClickHandler);this._onClickHandler=null;this._onTextboxBlurHandler&&this.asTextBox.remove_event("blur",this._onTextboxBlurHandler);this._onTextboxBlurHandler=null;this._onInputChangeHandler&&this.asTextBox.remove_event("input",this._onInputChangeHandler);this._onInputChangeHandler=null},n.prototype.setItemSelectionEventHandler=function(n){this._autosuggestViewModel.setItemSelectionEventHandler(n)},n.prototype.setItemClickEventHandler=function(n){this._autosuggestViewModel.setItemClickEventHandler(n)},n.prototype.setSuggestionRequestHandler=function(n){this._suggestionRequestHandler=n},n.prototype.setFocusEventHandler=function(n){this._onFocusEvent=n},n.prototype.setClickEventHandler=function(n){this._onClickEvent=n},n.prototype.setAutosuggestKeydownHandler=function(n){this._onAutosuggestKeydown=n},n.prototype.setOnAutosuggestHandler=function(n){this._onAutosuggest=n},n.prototype.setAutosuggestBlurHandler=function(n){this._onAutosuggestBlur=n},n.prototype.instrumentSearchButtonClickEvent=function(){var n=this._autosuggestViewModel.getSelectedSuggestion(),t=6;n&&(t=5);this._instrumentationHelper&&this._instrumentationHelper.instrumentSearchEvent(this._getSearchTerm(),t,n)},n.prototype.refreshAutosuggest=function(){e.isEnabled&&this._updateSuggestions()},n.prototype.getConversationId=function(){return this._instrumentationHelper&&this._instrumentationHelper.getConversationId()},n.prototype.attachEvents=function(){var n=this;this._onKeyDownHandler||(this._onKeyDownHandler=function(t){return n._onKeyDown(t)},this.asTextBox.add_event("keydown",this._onKeyDownHandler));this._onFocusHandler||(this._onFocusHandler=function(){return n.onFocus()},this.asTextBox.add_event("focus",this._onFocusHandler));this._onClickHandler||(this._onClickHandler=function(){return n._onClick()},this.asTextBox.add_event("click",this._onClickHandler));this._onTextboxBlurHandler||(this._onTextboxBlurHandler=function(){return n._onBlur()},this.asTextBox.add_event("blur",this._onTextboxBlurHandler));this._onInputChangeHandler||(this._onInputChangeHandler=function(){return n._startAutosuggest()},this.asTextBox.add_event("input",this._onInputChangeHandler))},n.prototype._attachGlobalEvents=function(){var n=this;this._onWindowsBlurHandler||(this._onWindowsBlurHandler=function(t){t.target&&t.target.tagName!=="INPUT"&&document.activeElement&&document.activeElement.tagName!=="INPUT"&&!n._searchBoxContainer.has(t.target)&&n._onBlur()},t(window).add_event("blur,mousewheel,mousedown,touchmove",this._onWindowsBlurHandler));!this._onMapObjectBlurHandler&&this._map&&(this._onMapObjectBlurHandler=function(){return n._onBlur()},this._map.mapTapped&&this._map.mapTapped.add(this._onMapObjectBlurHandler),this._map.mapPanStarted&&this._map.mapPanStarted.add(this._onMapObjectBlurHandler))},n.prototype._removeGlobalEventHandlers=function(){this._onWindowsBlurHandler&&t(window).remove_event("blur,mousewheel,mousedown,touchmove",this._onWindowsBlurHandler);this._onWindowsBlurHandler=null;this._onMapObjectBlurHandler&&this._map&&(this._map.mapTapped&&this._map.mapTapped.remove(this._onMapObjectBlurHandler),this._map.mapPanStarted&&this._map.mapPanStarted.remove(this._onMapObjectBlurHandler),this._onMapObjectBlurHandler=null)},n.prototype._isMapsMainSearchbox=function(n){return n&&n.length>0&&n[0].id&&n[0].id==="maps_sb"},n.prototype.onFocus=function(){this._attachGlobalEvents();s.isMobile||s.enableDarkMode||e.enableQueryCompletion&&(!e.enableQueryCompletion||this._isMapsMainSearchbox(this.asTextBox))||this.asTextBox.set_style({"background-color":"#fff"});this._onAutosuggest&&this._onAutosuggest.invoke(!0);this._onFocusEvent&&this._onFocusEvent.invoke(!0)},n.prototype._onClick=function(){this._onClickEvent&&this._onClickEvent.invoke()},n.prototype._onBlur=function(){s.isMapsVertical&&this.asTextBox.set_style({"background-color":"transparent"});this.stopAutosuggest();this._onAutosuggestBlur&&this._onAutosuggestBlur.invoke()},n.prototype._onKeyDown=function(n){var i=n,t=i.keyCode||i.which,f,o,r,s,h,u;this._lastKey=i;f=(t===38||t===40)&&this._lastKeyDown===229&&!this._compositionEnds;o=e.waitForCompositionEnd&&t===229&&i.code==="Enter";t===38?(n.preventDefault(),e.waitForCompositionEnd&&f?this.imeCheckForJapanese():this._autosuggestViewModel.selectPreviousItem()):t===40?(n.preventDefault(),e.waitForCompositionEnd&&f?this.imeCheckForJapanese():this._autosuggestViewModel.selectNextItem()):t===27?(n.preventDefault(),this._autosuggestViewModel.stopAutosuggestion()):t===13||o?(r=this._autosuggestViewModel.getSelectedSuggestion(),o&&r===null||(e.enableQueryCompletion&&!r&&(s=this._autosuggestViewModel.getCurrentSuggestion(),s&&(r=s.suggestion),this._autosuggestViewModel.logAutosuggestClientInst("SCQSS",t,this._getSearchTerm())),h=2,r&&(h=3),this._instrumentationHelper&&this._instrumentationHelper.instrumentSearchEvent(this._getSearchTerm(),h,r))):e.enableQueryCompletion&&(u=this._getSearchTerm(),t===35||t===39?(this._autosuggestViewModel.completeCurrentQuery(),this._autosuggestViewModel.logAutosuggestClientInst("CMPL",t,u,this._getSearchTerm())):t===46?(this._autosuggestViewModel.hideQueryCompletion(),this._autosuggestViewModel.logAutosuggestClientInst("HID",t,u)):t===9?e.enableQueryCompletion&&this._autosuggestViewModel.hasCompletionQuery()&&this._getSearchTerm()!==this._autosuggestViewModel.completePredictedQuery()?(n.preventDefault(),this._autosuggestViewModel.completeCurrentQuery(),this._autosuggestViewModel.logAutosuggestClientInst("CMPL",t,u,this._getSearchTerm())):this._autosuggestViewModel.logAutosuggestClientInst("TB",t,u):e.enableQueryCompletion&&!this._autosuggestViewModel.isExpectedNextChar(i)&&this._autosuggestViewModel.clearCurrentQueryCompletionState());this._lastKeyDown=t;this._onAutosuggestKeydown&&this._onAutosuggestKeydown.invoke(i)},n.prototype._startAutosuggest=function(){var n=this,t=function(){n.refreshAutosuggest()};Microsoft.Maps.setTimeout(t,0)},n.prototype._updateSuggestions=function(){var n={searchText:this._getSearchTerm(),userLocation:this._getUserLocation(),localMapView:this._getMapViewPort()};e.enableQueryCompletion&&(n.lastKeyDown=this._lastKey);this._suggestionRequestHandler&&this._suggestionRequestHandler.invoke(n);this._autosuggestViewModel.updateSuggestions(n,this._searchBoxContainer)},n.prototype._getMapViewPort=function(){if(this._map){var n=ni.getMapBounds(this._map),t=[n.getNorth(),n.getWest(),n.getSouth(),n.getEast()];return t.join(",")}return""},n.prototype._getUserLocation=function(){var n=s.dynamicProperties.location||s.dynamicProperties.reverseIPLocation;return n?n+",100":""},n.prototype._getSearchTerm=function(){return this.asTextBox[0].value},n.prototype.imeCheckForJapanese=function(){var n,t;this.asTextBox&&this.asTextBox.length>0&&this._isMapsMainSearchbox(this.asTextBox)&&(n=this.asTextBox[0],n.blur(),n.focus(),t=n.value,setTimeout(function(){document.querySelector("#maps_sb").value=t},50))},n}(),rr=function(){function n(){}return n.saveWaypoint=function(t){var u=t.getAddress(),i,r;if(u&&n._saveHistoryEnabled()){if(n.getWaypoints(),n.historyWaypoints.length)for(i=0;i<n.historyWaypoints.length;i++)if(r=n.historyWaypoints[i],r.getAddress().toLowerCase()===u.toLowerCase()&&r.getTitle().toLowerCase()===t.getTitle().toLowerCase()){n.historyWaypoints.splice(i,1);break}n.historyWaypoints.unshift(t);n.historyWaypoints.length>=n.Max_limit&&n.historyWaypoints.splice(n.Max_limit,n.historyWaypoints.length-n.Max_limit);n.commitChanges()}},n.getWaypoints=function(t){var f,e,r,o,u,s,h,i;if(!n._saveHistoryEnabled())return[];if((!n.historyWaypoints||n.historyWaypoints.length===0)&&(f=yt.getItem(n.SearchHistoryLocalStorageKey),n.historyWaypoints=[],f))for(e=f.split("$"),i=0;i<e.length;i++)r=e[i].split("|"),o=null,r[2].length>0&&r[3].length>0&&(o=new wt(parseFloat(r[2]),parseFloat(r[3]))),u=new vt(r[0],r[1],"",null,o),n.historyWaypoints.push(u);if(!t||t.length===0)return n.historyWaypoints;for(t=t.toLowerCase(),s=[],h=[],i=0;i<n.historyWaypoints.length;i++){var u=n.historyWaypoints[i],c=u.getAddress(),l=u.getTitle(),a=c&&c.toLowerCase().indexOf(t),v=l&&l.toLowerCase().indexOf(t);a===0||v===0?h.push(u):Math.max(a,v)>0&&s.push(u)}return h.concat(s)},n.commitChanges=function(){var r,t;if(n.historyWaypoints.length>0){for(r="",t=0;t<n.historyWaypoints.length;t++){var i=n.historyWaypoints[t],u=i.getRoutableLocation(),f=u&&i.getLocationType()==="StreetAddress",e=n.SerializedWaypointFormat.replace("{title}",i.getTitle().replace(/[\|$]/g,"")).replace("{address}",i.getAddress().replace(/[\|$]/g,"")).replace("{lat}",f?u.latitude.toString():"").replace("{long}",f?u.longitude.toString():"");t!==n.historyWaypoints.length-1&&(e+="$");r+=e}yt.setItem(n.SearchHistoryLocalStorageKey,r)}},n.removeAll=function(){n._saveHistoryEnabled()&&(n.historyWaypoints=[],yt.removeItem(n.SearchHistoryLocalStorageKey))},n.isHistoryEnabled=function(){if(n._saveHistoryEnabled()){var t=yt.getItem(n.SaveSearchHistoryKey);return t==="0"?!1:!0}return!1},n.resetIsHistoryEnabled=function(t){n._saveHistoryEnabled()&&yt.setItem(n.SaveSearchHistoryKey,t?"1":"0")},n._saveHistoryEnabled=function(){return yt.isEnabled()&&!(e&&e.autosuggestHistory)},n.SearchHistoryLocalStorageKey="BingMapsSearchHistory",n.SaveSearchHistoryKey="BingMapsSaveSearchHistory",n.historyWaypoints=[],n.Max_limit=100,n.SerializedWaypointFormat="{title}|{address}|{lat}|{long}",n}(),ui=function(n){function t(t){var i=n.call(this,t&&t.suggestionTypes?t.suggestionTypes:"place,business,address")||this;return i._parseLocationFromAS=e.useAutosuggestLocationForDirections,i._useDefaultSuggestions=!0,i._useFavoriteSuggestions=!0,i._parseLocationFromAS=!0,i._setDefaultOptions(),i.updateOptions(t),i}return a(t,n),t.updateCurrentLocalDetailCards=function(n){t.localDetailCards=n},t.appendLocalDetailCards=function(n){t.localDetailCards=t.localDetailCards.concat(n)},t.resetCurrentLocalDetailsCards=function(){t.localDetailCards=[]},t.updateCurrentTransitStopCards=function(n){t.transitStopCards=n},t.prototype.updateOptions=function(n){n&&(this._options.suggestionTypes=n.suggestionTypes?n.suggestionTypes:this._options.suggestionTypes,this._options.showHistorySuggestions=typeof n.showHistorySuggestions=="boolean"?n.showHistorySuggestions:this._options.showHistorySuggestions,this._options.showDetailCards=typeof n.showDetailCards=="boolean"?n.showDetailCards:this._options.showDetailCards,this._options.showMyLocation=typeof n.showMyLocation=="boolean"?n.showMyLocation:this._options.showMyLocation,this._options.prevWaypoint=n.prevWaypoint!==undefined?n.prevWaypoint:this._options.prevWaypoint,this._options.dirMode=n.dirMode!==undefined?n.dirMode:this._options.dirMode,this._options.width=n.width!==undefined?n.width:0,this._options.maxHistoryWaypoints=typeof n.maxHistoryWaypoints=="number"?n.maxHistoryWaypoints:this._options.maxHistoryWaypoints,this._prevWaypoint=n.prevWaypoint?n.prevWaypoint:this._prevWaypoint,this._dirMode=n.dirMode?this._getDirMode(n.dirMode):this._dirMode)},t.prototype.update=function(n,t,i,r){n&&(this._prevWaypoint=n);this._dirMode=this._getDirMode(t);this.instrumentationHelper&&this.instrumentationHelper.createDirectionsInstrumentationData(this._dirMode,i,r)},t.prototype._setDefaultOptions=function(){this._options={suggestionTypes:"place,business,address",showHistorySuggestions:!e.autosuggestHistory,showDetailCards:!0,showMyLocation:!0,maxHistoryWaypoints:5}},t.prototype._getDirMode=function(n){var t="car";switch(n){case gt.transit:t="bus";break;case gt.walking:t="walk"}return t},t.prototype.getDefaultSuggestions=function(){var i,e,f,n,u;if(!this._useDefaultSuggestions)return[];if(i=[],this._options.showMyLocation&&(u=this.createSuggestion(r.L_MyLocation,null),i.push(u)),this._options.showDetailCards&&(t.localDetailCards||t.transitStopCards))for(e=Array.prototype.concat.apply(t.localDetailCards,t.transitStopCards),f=0;f<e.length;f++)n=e[f],n&&(u=this.createSuggestion(n.getTitle(),n.getDescription(),n.getRoutableLocation(),n.id,n.getPrimaryCategoryPath(),!!n.getLocationType()),i.push(u));return i},t.prototype.addExtraASParams=function(n,t){if(this._dirMode&&(n+="&cmdir="+this._dirMode),this._prevWaypoint){n+="&ctx=to";var i=this._prevWaypoint.point;i&&(n+="&clFrom="+i.latitude.toString()+","+i.longitude.toString());this._prevWaypoint.eid&&(n+="&ceFrom="+this._prevWaypoint.eid);this._prevWaypoint.type&&(n+="&ccFrom="+this._prevWaypoint.type)}else n+="&ctx=from";return e.autosuggestHistory&&(n=n.replace("{histcnt}",e.autosuggestDirectionsMaxHistCount.toString()),n=n.replace("{favcnt}",t.searchText?e.autosuggestDirectionsMaxFavCount.toString():"")),n},t.prototype.createSuggestion=function(n,t,i,r,u,f){var e={defaultSuggestion:!0,title:n,formatedAddress:t,location:i,entityId:r,primaryCategoryPath:u,type:"Default"};return f&&(e.type="Place"),e},t.prototype.getHistorySuggestions=function(n){var r,u,t,i,f;if(this._options&&!this._options.showHistorySuggestions)return[];for(r=[],u=rr.getWaypoints(n),t=0;t<Math.min(u.length,this._options.maxHistoryWaypoints);t++)i=u[t],i&&(f=this.createSuggestion(i.getTitle(),i.getAddress()),f.type=li.HistorySuggestionType,r.push(f));return r},t.prototype.getMaxResults=function(){return e.autosuggestDirectionsMaxResults},t.localDetailCards=[],t}(ri),tf=function(n){function t(){return n.call(this)||this}return a(t,n),t.prototype.getDefaultSuggestions=function(){var i,u,t,n;if(!this._useDefaultSuggestions)return[];if(i=[],this._options.showMyLocation&&(n={},n.title=r.L_MyLocation,n.defaultSuggestion=!0,i.push(n)),ui.localDetailCards)for(u=0;u<ui.localDetailCards.length;u++)t=ui.localDetailCards[u],t&&(n=this.createSuggestion(t.getTitle(),t.getDescription(),t.getRoutableLocation(),t.id),i.push(n));return i},t}(ui),rf=function(n){function i(i,r,u,f,e,o){var s=n.call(this,i,r,u,f,e)||this;return s._backButton=o,s._rootContainer=t("#container"),s.attachEvents(),s}return a(i,n),i.prototype.stopAutosuggest=function(){n.prototype.stopAutosuggest.call(this);this._onBackButtonClick(null)},i.prototype.removeEventHandlers=function(){n.prototype.removeEventHandlers.call(this);this._onBackButtonClickHandler&&this._backButton&&this._backButton.remove_event("click",this._onBackButtonClickHandler)},i.prototype.attachEvents=function(){var t=this;n.prototype.attachEvents.call(this);!this._onBackButtonClickHandler&&this._backButton&&(this._onBackButtonClickHandler=function(n){return t._onBackButtonClick(n)},this._backButton.add_event("click",this._onBackButtonClickHandler))},i.prototype._onBackButtonClick=function(n){this.asTextBox.remove_class("focused");this.asTextBox.set_style({width:null});this._rootContainer.remove_class("hideAll");n&&n.preventDefault();n&&n.stopPropagation()},i.prototype.onFocus=function(){var t,r;n.prototype.onFocus.call(this);this.asTextBox.add_class("focused");t=parseInt(this._backButton.get_style("width").replace("px",""));this.asTextBox.set_style({width:window.innerWidth-t-i.focusedInputboxMargin+"px"});this._rootContainer.add_class("hideAll");r={action:"updateLayout",state:{layoutType:"expandCard"}};f.invokeHandler(u.layoutDataHandlerKey,r)},i.focusedInputboxMargin=16,i}(ir),uf=function(n){function t(){var t=n.call(this)||this;return t._defaultSuggestions=[],t._useFavoriteSuggestions=!0,t}return a(t,n),t.prototype.updateDefaultSuggestions=function(n,t){this._defaultSuggestions=n;this._mapBounds=t;this._useDefaultSuggestions=!0;this._useFavoriteSuggestions=!1},t.prototype.clearDefaultSuggestions=function(){this._defaultSuggestions=[];this._mapBounds=null;this._useDefaultSuggestions=!1;this._useFavoriteSuggestions=!0},t.prototype.getDefaultSuggestions=function(){var r=[],t,i,n;if(this._defaultSuggestions&&this._useDefaultSuggestions)for(t=0;t<this._defaultSuggestions.length;t++)i=this._defaultSuggestions[t],i&&(n={},n.defaultSuggestion=!0,n.title=i,n.searchText=i,n.mapBounds=this._mapBounds,r.push(n));return r},t.prototype.getMaxResults=function(){return e.autosuggestSearchBoxMaxResults},t}(ri),wi=function(n){function i(t,i,u,f,e,o,s,h,c,l,a,v){var y,p,k,w,b;return l===void 0&&(l=!1),a===void 0&&(a=!1),y=this,p={},y=n.call(this,p)||this,y._map=i,y._container=u,y._label=f,y._message=e,y._calendarSync=t,y.resources=r,k=i.getContainer(),y._showDateTimeOnLabel=!1,y.updatingStartTime=!1,y.updatingEndTime=!1,y._startCalendar=null,y._endCalendar=null,y.OneMinute=6e4,y.OneHour=36e5,y.TwentyFourHours=864e5,y.ElevenFiftyFivePm=1435*y.OneMinute,y._allowPastTimes=l,y._userUtcOffset=-(new Date).getTimezoneOffset(),h&&(y._utcOffset=h,y._userUtcOffset===y._utcOffset||c||(y._displayLocalTime=!0,o&&!isNaN(o)&&(o+=(y._utcOffset-y._userUtcOffset)*y.OneMinute),s&&!isNaN(s)&&(s+=(y._utcOffset-y._userUtcOffset)*y.OneMinute))),p.defineProperty("hasPresetStartEndTime"),p.defineProperty("startDate",y._onStartDateTimeChanged),p.defineProperty("startTime",y._onStartDateTimeChanged),p.defineProperty("endDate",y._onEndDateTimeChanged),p.defineProperty("endTime",y._onEndDateTimeChanged),p.defineProperty("calendarType",y._onCalendarTypeChanged),p.defineProperty("isAllDayEvent",y._onIsAllDayEventChanged),p.defineProperty("startEditingTime"),p.defineProperty("endEditingTime"),p.defineProperty("showStartCalendarSelector"),p.defineProperty("showEndCalendarSelector"),p.defineProperty("showEndCalendar"),p.defineProperty("showEndTimeLink"),p.defineProperty("timeControlDisabled"),p.defineProperty("showTimeZoneDisclaimer"),p.defineProperty("showStartEndTimeLinks"),p.defineProperty("startTaskId"),p.defineProperty("endTaskId"),y._prePopulateCalendarTypeDropdowns(),y.startDateTime=y.endDateTime=r.L_CalendarSync_SelectDateTime,y.setShowStartCalendarSelector(!1),y.setShowEndCalendarSelector(!1),y.setHasPresetStartEndTime(a),y.setShowStartEndTimeLinks(!a),y.setShowEndCalendar(s&&!isNaN(s)?!0:!1),y.setShowEndTimeLink(!1),y.setTimeControlDisabled(!1),y.setIsAllDayEvent(!1),y.setShowTimeZoneDisclaimer(y._displayLocalTime),v&&(y.setStartTaskId(v+"Start"),y.setEndTaskId(v+"End")),c&&o&&!isNaN(o)&&(y.setIsAllDayEvent(!0),y.setTimeControlDisabled(!0),o=Math.floor(o/y.TwentyFourHours)*y.TwentyFourHours,o-=y._userUtcOffset*y.OneMinute,s&&!isNaN(s)?(s=Math.floor(s/y.TwentyFourHours)*y.TwentyFourHours,s-=y._userUtcOffset*y.OneMinute,s===o&&(s=s+y.ElevenFiftyFivePm)):s=o+y.ElevenFiftyFivePm),w=new Date,o&&!isNaN(o)?(w=new Date(o),y._setDateAndTime(o,!1,!1)):y._setDateAndTime(w.getTime(),!1,!0),s&&!isNaN(s)?y._setDateAndTime(s,!0,!1):(b=!(o&&!isNaN(o)),w.setHours(w.getHours()+1),y._setDateAndTime(w.getTime(),!0,b)),y._initialStartDateTime=o,y._calendarControlAdded=!1,f.add_event("click",function(n){y._onLabelClick(n)}),y._showHideCalendarSyncControl(!1||y.getHasPresetStartEndTime()),y}return a(i,n),i.prototype.addPrefixSpace=function(n){return n&&n.charAt(n.length-1)!==" "?n.concat(" "):n},i.prototype.adjustEndTime=function(){if(!this.updatingEndTime){this.updatingEndTime=!0;var t=i.getDate(this.getStartDate(),this.getStartTime()),n=new Date(this.getStartDate()+this.getStartTime()*1e3);n.setTime(n.getTime()+this.OneHour);this.setEndTime(i.getTimeInSeconds(n));n.setHours(0,0,0,0);this.setEndDate(n.getTime());this.endDateTime=i.formatDateTimeString(this.getEndDate(),this.getEndTime(),this.getIsAllDayEvent());this._endCalendar&&this._endCalendar.SetDate(this.getEndDate());this.updatingEndTime=!1}},i.prototype._onStartDateTimeChanged=function(){var n,t,r;this.updatingStartTime||(this.updatingStartTime=!0,n=new Date(Date.now()),t=i.getDate(this.getStartDate(),this.getStartTime()),!this._allowPastTimes&&t<n&&(this.setStartTime(n.getHours()*this.OneHour),this.setStartDate(n.getTime())),this.startDateTime=i.formatDateTimeString(this.getStartDate(),this.getStartTime(),this.getIsAllDayEvent()),this.updatingStartTime=!1,r=i.getDate(this.getEndDate(),this.getEndTime()),(r<t||!this.getShowEndCalendar())&&this.adjustEndTime(),this._showHideMessage(!1))},i.prototype._onEndDateTimeChanged=function(){if(!this.updatingEndTime){var n=i.getDate(this.getStartDate(),this.getStartTime()),t=i.getDate(this.getEndDate(),this.getEndTime());t<n&&this.adjustEndTime();this.endDateTime=i.formatDateTimeString(this.getEndDate(),this.getEndTime(),this.getIsAllDayEvent());this._showHideMessage(!1)}},i.prototype._onCalendarTypeChanged=function(){this._message.set_style({display:"none"})},i.prototype._onIsAllDayEventChanged=function(){this.setTimeControlDisabled(this.getIsAllDayEvent());this.startDateTime=i.formatDateTimeString(this.getStartDate(),this.getStartTime(),this.getIsAllDayEvent());this.endDateTime=i.formatDateTimeString(this.getEndDate(),this.getEndTime(),this.getIsAllDayEvent())},i.prototype._setDateTimeToLabel=function(){this._calendarSync.getPermalink()},i.prototype._addCalendar=function(n,i){var r=this,u=this._map.getContainer(),e=n.select(".calendarSyncStartDate"),o,f,s;e&&u&&u.instanceAsync("SingleCalendar",function(n){r._startCalendar=n;n.init(e,i);n.onDateChangeEvent.add(function(n){n.setHours(0,0,0,0);r.setStartDate(n.getTime())})});o=i;f=n.select(".calendarSyncEndDate");f&&u&&u.instanceAsync("SingleCalendar",function(n){r._endCalendar=n;n.init(f,o);n.onDateChangeEvent.add(function(n){n.setHours(0,0,0,0);r.setEndDate(n.getTime())})});this.getHasPresetStartEndTime()&&(s=this._container.select(".bm_dropdownEntry"),s.for_each(function(n){var i=t(n);i.add_event("click",function(n){var t=n.target.attributes.getNamedItem("data-dropdown").nodeValue;r.setCalendarType(r.calendarTypes[t]);r.onExportClick(n)})}))},i.prototype.onStartTimeClick=function(n){this._argsPreventer(n);this.setShowStartCalendarSelector(!this.getShowStartCalendarSelector());this.getShowStartCalendarSelector()&&(this.getShowEndCalendar()||this.setShowEndTimeLink(!0),this.setShowEndCalendarSelector(!1),this._calendarSync.log("C","STC"))},i.prototype.onStartKeyDown=function(n){var r=n,t,i;r.keyCode&&r.keyCode===27&&(this._argsPreventer(n),this._onLabelClick(n),this.setShowStartCalendarSelector(!1),this.setShowEndCalendarSelector(!1),this.setShowEndTimeLink(!1),this._container&&this._container.length>0&&(t=this._container[0].previousElementSibling,t&&t.classList.contains("calendarLabelContainer")&&t.childElementCount>0&&(i=t.firstElementChild,i&&i.focus())))},i.prototype.onEndTimeClick=function(n){this._argsPreventer(n);this.setShowEndCalendarSelector(!this.getShowEndCalendarSelector());this.getShowEndCalendarSelector()&&(this.setShowStartCalendarSelector(!1),this.setShowEndTimeLink(!1),this._calendarSync.log("C","ETDD"))},i.prototype.onEndTimeLinkClick=function(n){this._argsPreventer(n);this.getShowEndTimeLink()&&(this.setShowStartCalendarSelector(!1),this.setShowEndTimeLink(!1),this.setShowEndCalendar(!0),this.setShowEndCalendarSelector(!0),this._calendarSync.log("C","ETL"))},i.prototype.onExportClick=function(n){var t=this;this._argsPreventer(n);this.setStartEditingTime(!1);this.setEndEditingTime(!1);this.setShowEndCalendarSelector(!1);this.setShowStartCalendarSelector(!1);this.setShowEndCalendar(!0);this.setShowEndTimeLink(!1);this._calendarSync.log("S",this.getCalendarType().value.toString(),this._calendarSync.getEntityInfoForLogging());this._calendarSync.logIn(this.getCalendarType().value,function(){var i=t.getStartDate()+t.getStartTime()*1e3,n=t.getEndDate()+t.getEndTime()*1e3,u,f;t._displayLocalTime&&(i-=(t._utcOffset-t._userUtcOffset)*t.OneMinute,n-=(t._utcOffset-t._userUtcOffset)*t.OneMinute);t.getIsAllDayEvent()&&(t._utcOffset?(i+=t._utcOffset*t.OneMinute,n+=t._utcOffset*t.OneMinute):t._userUtcOffset&&(i+=t._userUtcOffset*t.OneMinute,n+=t._userUtcOffset*t.OneMinute),n+=t.TwentyFourHours);u=new Date(i);f=new Date(n);i>=n?(t._updateCalendarText(l._formatString(r.L_CalendarSync_StartEndDateError),!1,!0),t._calendarSync.log("ERR",t.getCalendarType().value.toString(),"Start Date greater End Date Mismatch")):t._calendarSync.createEvent(u,f,t.getIsAllDayEvent(),t._calendarSync.entity,function(){t.getCalendarType().value!==2?t._updateCalendarText(l._formatString(r.L_CalendarSync_Message,t.getCalendarType().text),!0):t._updateCalendarText(l._formatString(r.L_CalendarSync_ICS_Downloaded),!0)},function(){t._updateCalendarText(l._formatString(r.L_CalendarSync_APIErrorMessage),!1,!0);t._calendarSync.log("ERR",t.getCalendarType().value.toString(),"Login Failed")})},function(){t._updateCalendarText(l._formatString(r.L_CalendarSync_LoginErrorMessage),!1,!0)})},i.prototype._updateCalendarText=function(n,t,i){this._message.set_html(l._formatString(n));(t||i)&&(t?this._message.remove_class("failureMessage").add_class("successMessage"):this._message.remove_class("successMessage").add_class("failureMessage"));this._showHideMessage(!0)},i.prototype._createCalendarDropdown=function(){var n=this,t=this._map.getContainer(),i={boolToDisplay:function(t){return n.boolToDisplay(t)},addPrefixSpace:function(t){return n.addPrefixSpace(t)}};this._container&&t&&t.instanceAsync("ControlTemplate",function(t){var i=t.applyDataTemplate(n);i.appendTo(n._container);n._addCalendar(i,n._initialStartDateTime);n._calendarControlAdded=!0;n._processOnLabelClick()},{templateText:tr,staticResources:i})},i.prototype._processOnLabelClick=function(){var i=this._container?this._container.get_style("display")==="none":!1,n;i&&this._calendarSync.getPermalink();this._container&&this._showHideCalendarSyncControl(i);n=t(".calendarSyncLabel");n&&n.length>0&&n[0].setAttribute("aria-expanded",i);this._showHideMessage(!1);this._calendarSync.preAuth();this._calendarSync.log("A")},i.prototype._onLabelClick=function(n){this._argsPreventer(n);this._calendarControlAdded?this._processOnLabelClick():this._createCalendarDropdown()},i.prototype._setDateAndTime=function(n,t,i){var r=new Date(n),u,f;i&&r.setHours(r.getHours()+1,0,0,0);u=r.getHours()*3600+r.getMinutes()*60+r.getSeconds()*60;t?this.setEndTime(u):this.setStartTime(u);r.setHours(0,0,0,0);f=r.getTime();t?this.setEndDate(f):this.setStartDate(f);t||!this._calendarSync.entity||this._calendarSync.entity.getDateTime&&this._calendarSync.entity.getDateTime()||this._calendarSync.entity.setDateTime(n)},i.prototype.getStartDateTime=function(){return this.getStartDate()+this.getStartTime()*1e3},i.prototype._prePopulateCalendarTypeDropdowns=function(){this.calendarTypes=[{text:r.L_CalendarSync_Outlook,value:0},{text:r.L_CalendarSync_Google,value:1},{text:r.L_CalendarSync_OutlookDesktop,value:2}];this.setCalendarType({text:r.L_CalendarSync_Outlook,value:0})},i.prototype._showHideCalendarSyncControl=function(n){this._container&&this._container.set_style({display:n?"block":"none"});var t="expandArrow",i="collapseArrow";n?(this._label.add_class(i),this._label.remove_class(t)):(this._label.add_class(t),this._label.remove_class(i))},i.prototype._showHideMessage=function(n){this._message.set_style({display:n?"inline":"none"})},i.prototype._argsPreventer=function(n){n.preventDefault();n.stopImmediatePropagation()},i.getDate=function(n,t){return new Date(i.getDateInMilliseconds(n,t))},i.getDateInMilliseconds=function(n,t){return n+t*1e3},i.formatDateTimeString=function(n,t,i){return i?l._formatLongDateString(new Date(n)):l._formatLongDateString(new Date(n))+" "+l._formatUTCTimeString(new Date(t*1e3))},i.getTimeInSeconds=function(n){return n.getHours()*3600+n.getMinutes()*60+n.getSeconds()},i}(ei),ff=function(){function n(n){this._clientId=ut.gCalClientId;this._scopes=ut.gCalScopes;this.loggedIn=!1;this._calendarSync=n;this._addRemoteAPIScript()}return n.getInstance=function(t){return n._instance||(n._instance=new n(t)),n._instance},n.prototype.logOut=function(){gapi.auth.signOut();this.loggedIn=!1},n.prototype.logIn=function(n,t){var i=this;gapi.auth.authorize({client_id:this._clientId,scope:this._scopes,immediate:!1},function(r){return i._handleAuthenticationResult(r,n,t)})},n.prototype.preAuth=function(n){n&&n()},n.prototype._addRemoteAPIScript=function(){window.AM&&window.AM.push("google.com");var t=document.head,n=document.createElement("script");n.type="text/javascript";n.src=ut.gCalApiSource;t.appendChild(n)},n.prototype._handleAuthenticationResult=function(n,t,i){n&&!n.error?(gapi.client.load("calendar",ut.gCalVersion,function(){t&&t()},function(){i&&i()}),this.loggedIn=!0):i&&i()},n.prototype.createOrUpdateEvent=function(n,t,i){this.createNewEvent(n,t,i)},n.prototype.createNewEvent=function(n,t,i){var r=this,u=this._parseEvent(n);gapi.client.load("calendar",ut.gCalVersion,function(){var n=gapi.client.calendar.events.insert({calendarId:"primary",resource:u});n.execute(function(n){n.error?i&&i():(r._calendarSync.createdEventIdGoogle=n.id,t&&t())})})},n.prototype.updateEvent=function(n,t,i,r){var u=this,f=this._parseEvent(n);gapi.client.load("calendar",ut.gCalVersion,function(){var n=gapi.client.calendar.events.update({calendarId:"primary",eventId:t,resource:f});n.execute(function(n){n.error?r&&r():(u._calendarSync.createdEventIdGoogle=n.id,i&&i())})})},n.prototype._parseEvent=function(n){return n.isAllDayEvent?{summary:n.title,location:n.location,description:n.description,start:{date:n.eventStart},end:{date:n.eventEnd}}:{summary:n.title,location:n.location,description:n.description,start:{dateTime:n.eventStart},end:{dateTime:n.eventEnd}}},n.prototype.getEventsByDateRange=function(n,t,i,r){var u=gapi.client.calendar.events.list({calendarId:"primary",timeMin:n,timeMax:t,maxResults:20,singleEvents:!0,orderBy:"startTime"});u.execute(function(n){n.error?r&&r():i&&i()})},n}(),ef=function(){function n(){this._store=window.sessionStorage}return n.prototype.set=function(n,t){this._store.setItem(n,t)},n.prototype.get=function(n){return this._store.getItem(n)},n.prototype.clear=function(){this._store.clear()},n.prototype.remove=function(n){this._store.removeItem(n)},n}(),sf=function(){function n(){}return n}(),hf=function(n){function i(t){var i=this,r={};return i=n.call(this,r)||this,i._store=new ef,i._config=ut,i._calendarSync=t,r.defineProperty("isSignedIn",function(n,t){return i._onSignInStateChange(n,t)}),i._consumersPayloadTypeId="9188040d-6c67-4c5b-b112-36a304b66dad",i._silentAuthUrl="{authUrl}&prompt=none&domain_hint={userDomainType}&login_hint={userSigninName}",i._issuerTenantId="https://login.microsoftonline.com/{payloadTid}/v2.0",i.isUserSignedIn()||i.clearUserState(),i}return a(i,n),i.prototype.CreateMapsAuthCallback=function(){var i=this,t=this,n=this._store;return function(r){if(r.accessToken&&r.idToken){n.remove("accessToken");n.remove("idToken");var u=n.get("authState");if(r.state!==u){n.remove("authState");n.remove("authNonce");return}n.set("authState","");n.set("accessToken",r.accessToken);n.set("tokenExpires",r.expires);n.set("idToken",r.idToken);t.validateIdToken(function(n){var u,f,r;n?(i.setIsSignedIn(!0),window.sj_evt&&sj_evt.fire("wl:auth"),Identity&&Identity.wlProfile&&Identity.popupLoginUrls&&(u=Identity.popupLoginUrls,u&&(f=u.WindowsLiveId,f&&(r=document.createElement("iframe"),r.style.display="none",r.src=f+"&checkda=1",document.body.appendChild(r))))):t.clearUserState();t._authCallback&&t._authCallback(n)})}else t.clearUserState(),t.getCalendarSync().log("ERR",0..toString(),r.error)}},i.prototype.isAuthenticated=function(){if(!this.isUserSignedIn())return this.clearUserState(),!1;var n=this._store.get("accessToken");return n!==null&&n.length>0},i.prototype.getCalendarSync=function(){return this._calendarSync},i.prototype.retrieveEmailIfSignedIn=function(){var n=this;this.isUserSignedIn()&&this.getSignedInUserEmail(function(t){t&&n._store.set("WindowsLiveEmail",t)})},i.prototype.isUserSignedIn=function(){return typeof Identity!="undefined"&&Identity.wlProfile&&Identity.wlProfile()!==null},i.prototype.dispose=function(){if(this._disposables){for(var n=0;n<this._disposables.length;n++)this._disposables[n].dispose();this._disposables=null}},i.prototype.sendInvite=function(n,t){var i=this;this.getUserEmailAddress(function(r,u){u?t&&t(!1):i.sendCalendarInvite(r,n,function(n,i){i||t&&t(!0)})})},i.prototype.addDays=function(n,t){var i=new Date(n.valueOf());return i.setDate(i.getDate()+t),i},i.prototype.addHours=function(n,t){var i=new Date(n.valueOf());return i.setTime(i.getTime()+t*36e5),i},i.prototype._onSignInStateChange=function(n,t){this.notifySignedIn&&this.notifySignedIn.invoke(t)},i.prototype.buildAuthUrl=function(){var u=this.guid(),f=this.guid(),n,t,i,r;this._store.set("authState",u);this._store.set("authNonce",f);n={};n.response_type="id_token token";n.client_id=this._config.appId;n.redirect_uri=this._config.authorizationRedirectUrl;n.scope=this._config.scopes.replace("+"," ");n.state=u;n.nonce=f;n.response_mode="fragment";t=this._config.authorizationEndpointBase+this._config.authorizationEndpoint;i=0;for(r in n)t+=r+"="+n[r]+"&",i++;return i>1&&(t=t.slice(0,-1)),t},i.prototype.popupAuthenticate=function(n,t){var i=this.buildAuthUrl(),f=this._store.get("WindowsLiveEmail"),u,r;this.isUserSignedIn()&&t?(u=this._store.get("userDomainType"),r=this._store.get("userSigninName"),r=r||f,u=u||"consumers",r&&(i=this._silentAuthUrl.replace("{authUrl}",i).replace("{userDomainType}",u).replace("{userSigninName}",r),this.openPopupAuthWindow(i,n))):t?n&&n(!1):(this.isUserSignedIn()&&f&&(i=i+"&login_hint="+f),this.openPopupAuthWindow(i,n))},i.prototype.openPopupAuthWindow=function(n,t){this._authPopupWindow=window.open(n,"_blank","resizable,scrollbars,status");t&&(this._authCallback=t)},i.prototype.validateIdToken=function(n){var u=this._store.get("idToken"),c=this._store.get("authNonce"),r,o,i,f;if(null===u||u.length<=0){n(!1);return}if(r=u.split("."),r.length!==3){n(!1);return}if(o=t.Internals.parseJSON(atob(r[0])),i=t.Internals.parseJSON(atob(r[1])),i.nonce!==this._store.get("authNonce")){this._store.set("authNonce","");n(!1);return}if(i.aud!=this._config.appId){n(!1);return}if(f=this._issuerTenantId.replace("{payloadTid}",i.tid),i.iss!==f){n(!1);return}var e=new Date,s=new Date((i.nbf-300)*1e3),h=new Date((i.exp+300)*1e3);if(e<s||e>h){n(!1);return}this._store.set("userDisplayName",i.name);this._store.set("userSigninName",i.preferred_username);this._store.set("userDomainType",i.tid===this._consumersPayloadTypeId?"consumers":"organizations");n(!0)},i.prototype.makeSilentTokenRequest=function(n){var t=this;this.popupAuthenticate(function(i){i&&n&&n(t._store.get("accessToken"))},!0)},i.prototype.getAccessToken=function(n){var i=this._store.get("tokenExpires"),t=this._store.get("accessToken"),r=Date.now(),u=r>parseInt(i);t&&!u?n&&n(t):this.makeSilentTokenRequest(n)},i.prototype.makeApiCall=function(n,t){var i={Authorization:"Bearer "+n.token,"client-request-id":this.guid(),"return-client-request-id":"true"},r;n.email&&(i["X-AnchorMailbox"]=n.email);n.method==="POST"&&(i["Content-Type"]="application/json",i.Accept="application/json");r={url:n.url,dataType:"json",type:n.method,headers:i};n.query&&(r.data=n.query);this.makeRequest(r,t)},i.prototype.makeRequest=function(n,t){n.type==="POST"?(n.onSuccess=function(n){t(n)},n.onError=function(n,i,r){i>400||!n?t(null,r+","+n):r==="Created"?t(n):t(null,r+","+n)},ot.doPost(n.url,n.data,n)):ot.downloadJson(n.url,"tokens",function(n){t(n)},function(n,i,r){t(null,r)},n,!1,0,!0,n.headers)},i.prototype.getSignedInUserEmail=function(n){this.isUserSignedIn()?ot.downloadGeneric(this._config.emailEndpoint,"email",function(t){n&&n(t)},null,function(){n&&n(null)}):n&&n(null)},i.prototype.getUserEmailAddress=function(n){var t=this,i=this._store.get("userEmail");if(i)return i;this.getAccessToken(function(i){var r,u;i?(r={url:t._config.apiEndpoint+"/Me",token:i,method:"GET"},t.makeApiCall(r,function(t,i){i||!t?n(null,i):n({email:t.EmailAddress,name:t.DisplayName})})):(u={responseText:"Could not retrieve access token"},n(null,u))})},i.prototype.sendCalendarInvite=function(n,t,i){var r=this,u=n.email,e=n.name,f=t.isAllDayEvent?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",o='{"Subject": "'+t.title+'","Location":{"DisplayName": "'+t.location+'"},"Body": {"ContentType": "HTML","Content": "'+t.description+'" },"Start": {"DateTime": "'+t.eventStart+(t.isAllDayEvent?"T00:00:00":"")+'", "TimeZone": "'+f+'"}, "End": { "DateTime": "'+t.eventEnd+(t.isAllDayEvent?"T00:00:00":"")+'", "TimeZone": "'+f+'"}, "IsAllDay": '+t.isAllDayEvent+', "Attendees": [{"EmailAddress": {"Address": "'+u+'", "Name": "'+e+'" }, "Type": "Required" } ]}';this.getAccessToken(function(n){var t,f;n?(t={url:r._config.apiEndpoint+"/Me/events",token:n,method:"POST",email:u,query:o},r.makeApiCall(t,function(n,t){t?i(null,t):i(n.value)})):(f={responseText:"Could not retrieve access token"},i(null,f))})},i.prototype.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n=="x"?t:t&3|8;return i.toString(16)})},i.prototype.decodePlusEscaped=function(n){return n?decodeURIComponent(n.replace(/\+/g," ")):""},i.prototype.clearUserState=function(){this._store.clear();this.setIsSignedIn(!1)},i.prototype.formatDate=function(n){var t=new Date(n);return t.toLocaleDateString()+" "+t.toLocaleTimeString()},i}(ct),cf=function(){function n(n){this.loggedIn=!1;this._calendarSync=n;this._calendarHelper=new hf(n);window.MapsAuthCallback=this._calendarHelper.CreateMapsAuthCallback()}return n.getInstance=function(t){return n._instance||(n._instance=new n(t)),n._instance},n.prototype.createOrUpdateEventWithAPI=function(n,t,i){this._calendarSync.createdEventIdO365?this.updateEvent(n,this._calendarSync.createdEventIdO365,t,i):this.createNewEvent(n,t,i)},n.prototype.createOrUpdateEvent=function(n,t,i){var r=this;this._calendarHelper.popupAuthenticate(function(u){u?(r._writeInviteToCalendar(n),t&&t()):i&&i()})},n.prototype._writeInviteToCalendar=function(n){var i=new Date,t=this._calendarHelper;t.sendInvite(n,function(){})},n.prototype.createNewEvent=function(n,t,i){this.createOrUpdateEvent(n,t,i)},n.prototype.updateEvent=function(n,t,i,r){this.createOrUpdateEvent(n,i,r)},n.prototype._parseEvent=function(n){return JSON.stringify({Subject:n.title,Body:{ContentType:"HTML",Content:n.description},Location:{DisplayName:n.location},Start:n.eventStart,End:n.eventEnd})},n.prototype.logIn=function(n){n&&n()},n.prototype.preAuth=function(){this._calendarHelper.retrieveEmailIfSignedIn()},n.prototype.logOut=function(){this.loggedIn=!1},n.prototype.getEventsByDateRange=function(n,t,i,r){r&&r()},n}(),lf=function(){function n(){this.loggedIn=!0}return n.getInstance=function(t){return n._instance||(n._instance=new n(t)),n._instance},n.prototype.logIn=function(n){n&&n()},n.prototype.logOut=function(){},n.prototype.preAuth=function(n){n&&n()},n.prototype.createOrUpdateEvent=function(n,t){var r="BEGIN:VCALENDAR\nVERSION:2.0\nBEGIN:VEVENT\nSUMMARY:"+n.title+"\nDESCRIPTION:"+n.description+"\nLOCATION:"+n.location+"\nDTSTART;"+(n.isAllDayEvent?"VALUE=DATE:":"TZID=UTC:")+n.eventStart+"\nDTEND;"+(n.isAllDayEvent?"VALUE=DATE:":"TZID=UTC:")+n.eventEnd+"\nEND:VEVENT\nEND:VCALENDAR",u,i;window.navigator.msSaveOrOpenBlob?(u=new Blob([r]),window.navigator.msSaveOrOpenBlob(u,n.title+".ics")):(i=document.createElement("a"),i.href="data:text/calendar;charset=utf-8,"+encodeURIComponent(r),i.setAttribute("download",n.title+".ics"),document.body.appendChild(i),i.click(),document.body.removeChild(i));t&&t()},n.prototype.updateEvent=function(){},n.prototype.getEventsByDateRange=function(){},n}(),pr=function(){function n(n,t,i,r,u,f,e){var o=this;this.APIs={};this._hasCalendarCustomizations=!1;this.localSearchTaskConfigs=e;n.getContainer()&&n.getContainer().instanceAsyncAll([{name:"Permalink"},{name:"TaskManager"}],function(e){if(o.permalinkAPI=e.Permalink,o.taskManager=e.TaskManager,t){var s=t.get_attr("startDate"),h=t.get_attr("endDate"),c=s?Date.parse(s):null,l=h?Date.parse(h):null;o._hasCalendarCustomizations=s?h?!0:!1:!1;o._calendarSyncViewModel=f?new wi(o,n,t,i,r,c?c:f.getDateTime(),l?l:f.getEndDateTime(),f.getUtcOffset(),f.getIsAllDayEvent(),!0,o._hasCalendarCustomizations,u):new wi(o,n,t,i,r,c,l,null,null,!1,o._hasCalendarCustomizations,u)}});this.map=n;this.entity=f;this.taskId=u}return n.prototype.logOut=function(){this.selectedAPI.logOut()},n.prototype.logIn=function(n,t,i){this.selectedAPI=this.APIs[n];this.currentCalendarType=n;this.selectedAPI&&(this.selectedAPI.loggedIn?t():this.selectedAPI.logIn(t,i))},n.prototype.preAuth=function(n,t){ut.saveIntoCalendar&&(this.APIs[0]=cf.getInstance(this),this.APIs[1]=ff.getInstance(this),this.APIs[2]=lf.getInstance(this),this.APIs[0].preAuth(n,t))},n.prototype.getPermalink=function(n){var t=this;this.permalinkAPI.getGeneralPermalink(this.map,function(i){if(i){var r=i.permalink;t._permalink=r.toLowerCase().indexOf("form=")!=-1?r.replace(/(form=).*?(&|$)/,"$1"+ut.formCode+"$2"):r+"&form="+ut.formCode;t._shortLink=null;n&&n()}},function(){t.log("ERR","Permalink Generation","Error while building permalink");t._permalink=ut.defaultPermalink},null,!0)},n.prototype.createEvent=function(n,t,i,u,f,e){var l=this,h,c,s,o;u&&(h=u.getTitle(),h||(h=u.getAddress()),c=u.getAddress(),c||(c=u.getTitle()),s=this._hasCalendarCustomizations,o=new sf,o.title=s?r.L_CalendarSync_OpenHouse_Subject+h:h,o.location=c,i?(o.eventStart=n.toISOString().substring(0,10),o.eventEnd=t.toISOString().substring(0,10),o.isAllDayEvent=!0):(o.eventStart=n.toISOString(),o.eventEnd=t.toISOString(),o.isAllDayEvent=!1),this._shortLink||this._permalink?this._ensureShortUrlAndCreateEvent(o,u,s,f,e):s?this.getPermalink(function(){l._ensureShortUrlAndCreateEvent(o,u,s,f,e)}):this._ensureShortUrlAndCreateEvent(o,u,s,f,e))},n.prototype._ensureShortUrlAndCreateEvent=function(n,t,i,u,f){var e=this._shortLink?this._shortLink:this._permalink,o=null,s=null;switch(this.currentCalendarType){case 0:o=i?r.L_CalendarSync_OpenHouse_EventMessage_HTML:r.L_CalendarSync_EventMessage_HTML;s='<a href=\\"'+e+'\\">'+e+"<\/a>";break;case 1:o=i?r.L_CalendarSync_OpenHouse_EventMessage_PlainText:r.L_CalendarSync_EventMessage_PlainText;s=e;break;default:case 2:o=i?r.L_CalendarSync_OpenHouse_EventMessage:r.L_CalendarSync_EventMessage;s=e}n.description=o.replace("{0}",t.getTitle())+s;this.selectedAPI.createOrUpdateEvent(n,u,f)},n.prototype.getStartDateTime=function(){var n;return this._calendarSyncViewModel&&(n=this._calendarSyncViewModel.getStartDateTime()),n},n.prototype.getEntityInfoForLogging=function(){var n=[];return this.entity&&(n.push(this.entity.id?this.entity.id:""),n.push(this.entity.getSegmentTypes()?this.entity.getSegmentTypes().join("~"):"")),n.join("|")},n.prototype.log=function(n,t,i){var e=this.taskManager.getTaskById(this.taskId),o=e&&yr.getImpressionGuid(e.panelRoot),r={logData:{feature:"CAL",action:n,data:{}},impressionGuid:o};switch(n){case"ERR":r.logData.data.TYP=t;r.logData.data.Error=i;break;case"C":r.logData.data.TYP=t;break;case"S":r.logData.data.TYP=t;r.logData.data.EntityInfo=i}f.invokeHandler(u.instrumentationDataHandlerKey,r)},n}(),af=function(){function n(){}return n.requestTabControl=function(t,i,r,u,f,e){var v=function(t){var r=n._convertToResponseObject(t),u=r.select(".tab-container"),f=u.length&&u[0].id;i(r,f);n.prepareTabControl(r)},y=function(){},c=t.join("_"),h,l,a;return c=encodeURI(c),h=o.tabCreatorUrl.replace("{names}",c),h+="&count="+n.count,r&&r>=50&&(h+="&w="+r),u&&u<t.length&&(h+="&dft="+u),f&&(h+="&hero=1"),e&&(h+="&button=1"),vi.getFunctionalTestHooksEnabled()&&(h+="&testhooks=1"),h.toLowerCase().indexOf("mcig")<0&&(l=s.dynamicProperties.mapsIG,l&&(h+="&MCIG="+l)),a=ot.downloadGeneric(h,"tabctrl",v,null,y,null,0),n.count++,a},n.prepareTabControl=function(n){var t=n.select(".tabControlRoot");t&&t.length&&Microsoft.Maps.setTimeout(function(){sj_evt.fire("tab_init",tabcontrol)},200)},n._convertToResponseObject=function(n){var i=t(document.createElement("div"));return i.set_html(n),i},n.count=0,n}(),vf=function(n){function i(i,u,f,e,o,s){var h=n.call(this,e)||this,c,l;return h.resources=o||r,c=f||{},c.onCloseClick||(c.onCloseClick=function(n){n.preventDefault();n.stopPropagation();h.CloseDialog()}),c.onDlgKeydown=function(n){var i=n,f=i.keyCode||i.which,r,u;f===27&&h.CloseDialog();f===9&&(r=h.getFirstTabbableChild(h._getRootElement()),u=t(".dialogClose")[0],i.target!==u||i.shiftKey?i.target===r&&i.shiftKey&&(u.focus(),i.preventDefault()):(r.focus(),i.preventDefault()))},l=s?' id="'+s+'"':"",h.setTemplate(new it('<div class="bm_modalDialog MicrosoftMap" event:keydown="onDlgKeydown" tabindex="-1"><div><div class="'+u+'"'+l+">"+i+'<a href="#" class="dialogClose closeIcon" data-tag="Dialog.Close" event:click="onCloseClick" aria-label="'+r.L_Dlg_Close+'" role="button"><\/a><\/div><\/div><\/div >',c)),h}return a(i,n),i.prototype.OpenDialog=function(){var n=this._getRootElement();n&&(document.body.appendChild(n),n.focus())},i.prototype.CloseDialog=function(){this.getRootElement().removeFromParent()},i.prototype._getRootElement=function(){var n=this.getRootElement();return n?n[0]:null},i}(dt),yf=function(){function n(n,t,i,r,u){this.value=n;this.label=t;this.augmentation=i||"";this.isSelected=r||!1;this.isEnabled=typeof u=="undefined"?!0:u}return n}(),pf=function(){function n(n,t,i,r,u,f){this.id=n;this.cssClass=t;this.displayName=i;this.filterType=r;this.options=[];this.selectionRenderer=f;this.instId=u;this.instrumentationData=this._createInstrumentationData(this.instId)}return n.prototype.getSelectedOptions=function(){for(var t=[],n=0;n<this.options.length;n++)this.options[n].isSelected&&t.push(this.options[n]);return t},n.prototype.hasSelectedOptions=function(){for(var n=0;n<this.options.length;n++)if(this.options[n].isSelected)return!0;return!1},n.prototype.isEnabled=function(){if(this.options.length==0)return!1;for(var n=0;n<this.options.length;n++)if(this.options[n].isEnabled)return!0;return!1},n.prototype.addAllOptions=function(n){var t=this;return n.forEach(function(n){t.addOption(n)}),this},n.prototype.addOption=function(n){return this.options.push(n),n.item=this,this},n.prototype.removeOptionAt=function(n){if(n<0||n>=this.options.length)throw new Error("Index ["+n+"] of option to remove is out of bound, must be in (0, "+this.options.length+"] range!");return this.options.splice(n,1)[0]},n.prototype.getOptionByValue=function(n){for(var t=0;t<this.options.length;t++)if(n==this.options[t].value)return this.options[t];return null},n.prototype.equals=function(n){if(!n)return!1;if(n==this)return!0;if(this.id!==n.id||this.options.length!=n.options.length)return!1;for(var t=0;t<this.options.length;t++)if(this.options[t].value!=n.options[t].value||this.options[t].label!=n.options[t].label)return!1;return!0},n.prototype.applySelection=function(n){var i,t,r;if(this.id!=n.id)throw new Error("Filter items id missmatch "+this.id+"/"+n.id+"! Selection could not be applied!");for(i=0;i<this.options.length;i++)t=this.options[i],r=n.getOptionByValue(t.value),r&&(t.isSelected=r.isSelected,t.isEnabled=t.isEnabled||t.isSelected)},n.prototype.displaySelection=function(){return this.selectionRenderer?this.selectionRenderer(this):this.getSelectedOptions().map(function(n){return n.label}).join(", ")},n.prototype.unselectAllOptions=function(){for(var n=0;n<this.options.length;n++)this.options[n].isSelected=!1},n.prototype.prune=function(){for(var t,n=this.options.length-1;n>=0;n--)t=this.options[n],t.isEnabled||this.removeOptionAt(n)},n.prototype.clear=function(){this.options=[]},n.prototype.hasOptions=function(){return this.options&&this.options.length>0},n.prototype._createInstrumentationData=function(n){var i={logData:{feature:"FSB",action:"C",data:{FT:n}}};return t.Internals.stringify(i)},n}(),wf=function(){function n(n){var t=this;this._items=[];n.forEach(function(n){t.addItem(n)})}return n.prototype.getItems=function(){return this._items.slice()},n.prototype.getItemsNumber=function(){return this._items.length},n.prototype.getItemAt=function(n){return this._checkRange(n),this._items[n]},n.prototype.addItem=function(n){this._items.push(n)},n.prototype.addItemAt=function(n,t){if(t<0||t>this._items.length)throw new Error("Index ["+t+"] is out of bound, must be in [0, "+this._items.length+"] range!");this._items.splice(t,0,n)},n.prototype.removeItemAt=function(n){return this._checkRange(n),this._items.splice(n,1)[0]},n.prototype._checkRange=function(n){if(n<0||n>=this._items.length)throw new Error("Index ["+n+"] is out of bound, must be in [0, "+this._items.length+") range!");},n.prototype.removeItem=function(n){var t=this.indexOf(n);return t>=0?(this.removeItemAt(t),!0):!1},n.prototype.clear=function(){this._items=[]},n.prototype.indexOf=function(n){for(var t=0;t<this._items.length;t++)if(n.id===this._items[t].id)return t;return-1},n.prototype.hasSelectedOptions=function(){for(var n=0;n<this._items.length;n++)if(this._items[n].hasSelectedOptions())return!0;return!1},n.prototype.getItemById=function(n){for(var t=0;t<this._items.length;t++)if(n===this._items[t].id)return this._items[t];return null},n.prototype.getSelectedItems=function(){var n=[];return this._items.forEach(function(t){t.hasSelectedOptions()&&n.push(t)}),n},n.prototype.applyHistograms=function(n){var t=this;n&&(this.clear(),n._items.forEach(function(n){t.addItem(n)}))},n}(),ur=function(n){function t(i,r,u){var f=this;return f=n.call(this,{},r,cu)||this,t._initializeFilterItemTemplates(),f._eventHandlers=[],f._filtersBar=i,f.filterOptionClicked=new p,f._createFiltersViewModels(),f._expansionState=u||{isExpanded:!1},f._processExpansionState(),f}return a(t,n),t.prototype.unselectItem=function(n){for(var i,t=0;t<this._filtersViewModels.length;t++)if(i=this._filtersViewModels[t],n.id===i.filterItem.id){i.filterItem.unselectAllOptions();i.refresh();break}},t.prototype.dispose=function(){this._eventHandlers.forEach(function(n){n.item.remove_event(n.eventName,n.handler)});this._eventHandlers=[]},t._initializeFilterItemTemplates=function(){t._filterItemTemplates[2]=hu;t._filterItemTemplates[1]=yu;t._filterItemTemplates[0]=yi},t._resolveFilterItemTemplate=function(n){var i=t._filterItemTemplates[n.filterType];return i?i:(vi.logDebugData("There's no template defined for filter type: "+n.filterType+", returning ListDropdownTemplate as default one."),yi)},t.prototype._processExpansionState=function(){var n=this,t=this._getExpandButton(),i;if(!this._isExpandable()){this._expansionState.isExpanded=!1;t&&t.length===1&&t.removeFromParent();return}this._synchronizeExpansionStateWithView();i=function(t){t.preventDefault();n._expansionState.isExpanded=!n._expansionState.isExpanded;n._synchronizeExpansionStateWithView();n._logExpandButtonClick(n._expansionState.isExpanded)};t.add_event("click",i);this._addEventsToEventList(t,"click",i)},t.prototype._getExpandButton=function(){var n="a[class="+t._expandButtonCssClass+"]";return this.getControl().select(n)},t.prototype._synchronizeExpansionStateWithView=function(){var n=this._getExpandButton(),i=this.getControl();this._expansionState.isExpanded?(i.add_class(t._filtersBarExpandedCssClass),n.set_text(r.L_FiltersBar_Less_Text)):(i.remove_class(t._filtersBarExpandedCssClass),n.set_text(r.L_FiltersBar_More_Text))},t.prototype._isExpandable=function(){return this._filtersViewModels.length>=t._expandButtonThreshold},t.prototype._logExpandButtonClick=function(n){var t={logData:{feature:"FSB",action:"EX",data:{ED:n}}};f.invokeHandler(u.instrumentationDataHandlerKey,t)},t.prototype._createFiltersViewModels=function(){var r=this,n;for(this._filtersViewModels=[],this._filtersBar.getItems().forEach(function(n){if(n.options.length>0){var i=new ie(n,t._resolveFilterItemTemplate(n));i.filterOptionClicked.add(function(n){r.filterOptionClicked.invoke(n)});r._filtersViewModels.push(i)}}),n=0;n<this._filtersViewModels.length;n++){var i=this._filtersViewModels[n],u=i.filterItem,f=this.getControl().select("a."+u.cssClass),e=this.getControl().select("div."+u.cssClass);i.setViewModelData(e,f);this._addFilterButtonClickHandler(f,i)}},t.prototype._addFilterButtonClickHandler=function(n,t){var i=function(n){return t.filterButtonButtonClicked(n)};n.add_event("click",i);this._addEventsToEventList(n,"click",i)},t.prototype._addEventsToEventList=function(n,t,i){this._eventHandlers.push({item:n,eventName:t,handler:i})},t._filterItemTemplates={},t._expandButtonCssClass="expandFiltersButton",t._expandButtonThreshold=4,t._filtersBarExpandedCssClass="Expanded",t}(ei),fr=function(n){function i(t,i){var r=this,u={};return r=n.call(this,u,i,lu)||this,u.defineProperty("selectedItems",function(n,t){r.setIsVisible(t.length>0)}),u.defineProperty("isVisible"),r.setSelectedItems(t.getSelectedItems()),r.filterItemDiscardedFromSelection=new p,r}return a(i,n),i.prototype.onDiscardFilterItemSelection=function(n){n.stopPropagation();n.preventDefault();var i=t(n.target).get_attr("class"),u=this._getItemById(i),r=this.getSelectedItems().slice();r.splice(this._getItemIndex(i),1);this.setSelectedItems(r);this.filterItemDiscardedFromSelection.invoke(u)},i.prototype.itemToString=function(n){if(n){var t=this._getItemById(n);return t.displaySelection()}return""},i.prototype._getItemById=function(n){var t=this._getItemIndex(n);return t==-1?null:this.getSelectedItems()[t]},i.prototype._getItemIndex=function(n){for(var i,t=0;t<this.getSelectedItems().length;t++)if(i=this.getSelectedItems()[t],n===i.id)return t;return-1},i}(ei),bf=function(){function n(n){this._controlTemplateFactory=n;this._filtersBarViewModelExpansionState={isExpanded:!1};this.filterOptionClicked=new p;this.filtersBarRecreated=new p;this.filterItemDiscardedFromSelection=new p}return n.prototype.update=function(n,t){var i=this;this.dispose();this._control=t;t.getParent().remove_class("withFilters");t.clear();n&&n.getItemsNumber()>0&&(this._filtersBarViewModel=new ur(n,this._controlTemplateFactory,this._filtersBarViewModelExpansionState),this._filtersBarViewModel.filterOptionClicked.add(function(t){i._filtersStatusBarViewModel.setSelectedItems(n.getSelectedItems());i.filterOptionClicked.invoke(t)}),t.append(this._filtersBarViewModel.getControl()),this._filtersStatusBarViewModel=new fr(n,this._controlTemplateFactory),this._filtersStatusBarViewModel.filterItemDiscardedFromSelection.add(function(n){i._filtersBarViewModel.unselectItem(n);i.filterItemDiscardedFromSelection.invoke(n)}),t.append(this._filtersStatusBarViewModel.getControl()),t.getParent().add_class("withFilters"),this.filtersBarRecreated.invoke())},n.prototype.disableInteraction=function(){if(this._control){var n=l._createElement("div").add_class("bm_filtersBarModuleOverlay").set_html("&nbsp;");this._control.append(n);Microsoft.Maps.setTimeout(function(){n.append(l._createElement("div").add_class("spinner"))},400)}},n.prototype.enableInteraction=function(){this._control&&this._control.select(".bm_filtersBarModuleOverlay").removeFromParent()},n.prototype.dispose=function(){this._filtersBarViewModel&&this._filtersBarViewModel.dispose();this._filtersStatusBarViewModel&&this._filtersStatusBarViewModel.dispose()},n}(),kf=function(n){function t(){var t=n.call(this)||this;return t._templateString='<div class="{TemplateBinding Class}" data-tag="canvasIcon"><\/div>',t.defineProperty("class",null,null,{defaultValue:""}),t.defineProperty("vectorTemplate",function(n,i){t._onVectorTemplateChanged(n,i)}),t.setTemplate(new it(t._templateString,null)),t}return a(t,n),t.prototype._onVectorTemplateChanged=function(n,t){var i=this.getRootElement();i.clear();t&&i.append(t.renderIcon())},t}(dt);it.registerControl("CanvasControl",kf);var df=function(n){function i(t,u,f,e,h){var c=n.call(this,t,u)||this,l;return c._primerHoverTimeout=-1,c._requestHoverTimeout=-1,c._primerDelay=100,c._requestDelay=150,l=s.isInPrivateMode,c._buttonGroupViewModel=l?null:f,c._cardLessMode=o.enableOneClickSave&&!c._buttonGroupViewModel,c._buttonGroupViewModel||l||s.isSDK||s.isMsftPartner||c._cardLessMode||(c._saveDropDown=oi&&oi.container&&oi.container.instance&&oi.container.instance("SaveDropdownControl")),c._taskId=e,c._formCode=h,c.dispatchKeys=[],i._keepVisible=!0,c._segmentClicked=!1,c._nonSDKEvent=typeof sj_evt!="undefined",c._nonSDKEvent&&sj_evt.bind("pushpinhoverstopped",function(){i._keepVisible=!1;c.abortRequests();c._closeAfterDelay()}),c._saveTip=o.enableOneClickSave?r.L_SaveUpdateButton:r.SaveOnSerp_HoverTip,c}return a(i,n),i.prototype.dispose=function(){n.prototype.dispose.call(this);this._saveDropDown&&this._saveDropDown.dispose()},i.getExistingInfobox=function(){return i._existingInfobox},i.setExistingInfobox=function(n){i._existingInfobox=n},i.prototype.keepVisible=function(n,t){n?i._keepVisible=n:t&&t.layer.primitiveHoverStopped&&(i._keepVisible=!1,this.abortRequests(),this._closeAfterDelay())},i.prototype.setMap=function(r){var u=this,f=t("#transientLens");f.length>0&&f.get_style("visibility")==="visible"||(n.prototype.setMap.call(this,r),this.mouseenter.add(function(n){var t=s.features.localSearch;i._keepVisible=t&&t.enableRichInfoBox?!0:!1;(!i._keepVisible||n&&n.target&&n.target.getVisible())&&(u.preventAutoClose=!0)}),this.mouseleave.add(function(){u.preventAutoClose=i._keepVisible=!1;var n=u._saveDropDown;n&&n.confirmationTip&&n.confirmationTip.removeTip();u.setOptions({visible:!1,closeDelayTime:nt&&nt.enableRichInfoBox?150:500})}))},i.prototype.setOptions=function(r){var u=this,c=t("#transientLens"),h,f,e,o;c.length>0&&c.get_style("visibility")==="visible"||(h=this._createInfoboxUrl(r),nt&&nt.enableRichInfoBox&&h?(n.prototype.setOptions.call(this,{visible:!1},!0),f=this._saveDropDown,f&&f.confirmationTip&&f.confirmationTip.removeTip(),e="",this._requestHoverTimeout=Microsoft.Maps.setTimeout(function(){e=ot.downloadGeneric(h,"richinfobox",function(f){var e,o,c,h,a,l,v;f&&i._keepVisible&&(u._map&&u._map.getMapOptions().showLandmarksInfobox&&s.isMsftPartner&&(f=f.replace(/src="\/th\?/g,'src="https://www.bing.com/th?').replace(/url\(\//g,"url(https://www.bing.com/")),e=t(document.createElement("div")).set_html(f),o=e.select("div[data-answerinfo]"),o&&o.length&&(c=o.get_attr("data-answerinfo"),c&&nt.richInfoboxEnabledAnswerKeys.indexOf(c)>-1&&(h=u._moveButtons(e,r.entity),h&&h.length>0&&u.getVisible()&&(r.htmlContent=u._updateHtmlContentV2(h[0].innerHTML),n.prototype.setOptions.call(u,r),l=e.select("div[data-itineraryfacts]").get_attr("data-itineraryfacts"),a=l&&t.Internals.parseJSON(l),u._processResponse(r.entity,a),s.isSDK||s.isMsftPartner||k.isLandmarkEntity(r.entity)?u._handleLandmarkClick(r.entity):u._createTaskClickHandler(r.entity),v=u._createInfoTaskData(r.entity),u._logOpen(v,r.entity,e),i._keepVisible=!0,i.setExistingInfobox(u)),u.dispatchKeys&&u.dispatchKeys.length>0&&u.dispatchKeys.pop())))},null,function(){u.setOptions({visible:!1})},null,0);u.dispatchKeys?u.dispatchKeys.push(e):u.dispatchKeys=[e];window.clearTimeout(u._requestHoverTimeout)},this._requestDelay),r&&r.entity&&(this._primerHoverTimeout=Microsoft.Maps.setTimeout(function(){var t,f;i._keepVisible&&(t=k.getDisplayName(r.entity),t&&(t=t.replace("<","").replace(">","")),f=r.entity.getAddress&&r.entity.getAddress(),f&&(f=f.replace("<","").replace(">","")),r.htmlContent=u._createHtmlContentV2Primer(t||f),n.prototype.setOptions.call(u,r));window.clearTimeout(u._primerHoverTimeout)},this._primerDelay))):(r.htmlContent&&(r.htmlContent=this._updateHtmlContent(r.htmlContent)),n.prototype.setOptions.call(this,r),o=r.entity,o&&o.infoboxAdLink&&Microsoft.Maps.setTimeout(function(){u._createAdInfoboxClickHandler(o.infoboxAdLink)},this._primerDelay)))},i.prototype.abortRequests=function(){if(this.dispatchKeys&&this.dispatchKeys.length>0){for(var n=0;n<this.dispatchKeys.length;n++)ot.abortRequest(this.dispatchKeys[n]);this.dispatchKeys=[]}},i.prototype._handleLandmarkClick=function(n){var r=this,t=this._getRichInfoboxObject(),i;t&&t.length&&n&&(i=t.select(".infoBoxLink"),i.add_event("click",function(){r._logClick(n)}))},i.prototype._createTaskClickHandler=function(n){var r=this,t=this._getRichInfoboxObject(),i;t&&t.length&&n&&(i=t.select(".infoBoxLink"),i.add_event("click",function(t){r._infoboxEventHandler(t,n)}),i.add_event("keydown",function(t){var i=t;i&&i.keyCode&&i.keyCode!==13||r._infoboxEventHandler(t,n)}))},i.prototype._createAdInfoboxClickHandler=function(n){var t=this.getOverlayElement(),i;t&&t.length&&(i=t.select(".MapsInfoboxContainer .MapsAdInfoBox"),i.length&&i.add_event("click",function(){_w.si_ct&&_w.si_ct(n,!1,null);_w.open(n.href,"_blank")}))},i.prototype._infoboxEventHandler=function(n,t){var i=this,r;if(this._segmentClicked){this._segmentClicked=!1;return}r=!0;this._map.getContainer().instanceAsync("TaskManager",function(e){var y=e===null||e===void 0?void 0:e.getStacks(),a,s,h,o,c,p,w,v,b,k;(y===null||y===void 0?void 0:y.length)&&(a=e.getFocusedStack().getForegroundTask(),a.id.toLowerCase().indexOf("details")>-1&&(s=a._getTaskState(),(s===null||s===void 0?void 0:s.id)&&(h=":YN",o=t===null||t===void 0?void 0:t.id,(o===null||o===void 0?void 0:o.indexOf(h))>-1&&(o=o.replace(h,":")),c=s.id,c.indexOf(h)>-1&&(c=c.replace(h,":")),c===o&&(p={action:"focus",id:a.id},f.invokeHandler(u.taskDataHandlerKey,p),r=!1))));r&&(w=n.currentTarget,w.classList.contains("infoBoxLink")&&(v=i._createInfoTaskData(t),v&&(b=l._overrideTasktypeBasedOnCategory("LocalDetailsTask",v),i._logClick(t),k={state:v,type:b,activateOptions:{parentId:i._taskId}},f.invokeHandler(u.taskDataHandlerKey,k))))});n.preventDefault();n.stopImmediatePropagation()},i.prototype._createInfoTaskData=function(n){var r,t,f,i,u;return n?(r=n.ypid,t={entryPoint:y.Infobox,id:r?r:n.id,selectedCategoryId:n.getSelectedCategoryForIcon&&n.getSelectedCategoryForIcon(),flippingCard:!0,taskTitle:k.getDisplayName(n),listingCategoryPath:n.getPrimaryCategoryPath&&n.getPrimaryCategoryPath(),asName:k.getDisplayName(n),asFormattedAddress:n&&n.getAddress&&n.getAddress(),localFilters:n.getLocalFilters&&n.getLocalFilters()},nt.passListFormToDetails&&this._formCode&&(t.formCode=this._formCode),f=n.id.indexOf("eventId")>-1,f&&(i=n.getLocation(),u=n.getCity(),i&&(t.latLongForEventRequery=i.latitude+","+i.longitude,t.locationForEventRequery=u?u:"undefined")),n instanceof vt&&(t.localFilters=n.getLocalFilters()),l._updateSearchTaskStateWithAdsData(t,n),t):null},i.prototype._closeAfterDelay=function(){var n=this,t=this.getVisible()?501:1;Microsoft.Maps.setTimeout(function(){i._keepVisible||n.setOptions({visible:!1})},t)},i.prototype._createInfoboxUrl=function(n){var f=n&&n.entity,a,o,v,h,c,y;if(f&&f.id&&s&&s.dynamicProperties){var e=k.getDisplayName(n.entity),t=f.ypid||f.id,r=void 0,u="";return(t.indexOf("ypid:")===0?(r=nt.localFilterFormat,u=encodeURIComponent(r.replace("{ypid}",t.substring(5))+" ")):t.indexOf("sid:")===0?(a=f.getPrimaryCategoryPath&&f.getPrimaryCategoryPath(),r=nt.entityFilterFormat,nt.sendDoNotBlockResultsForSID&&a&&l._isAttractionCategory(a)&&(r+=encodeURIComponent('DoNotBlockResultsForSID:"false" ')),u=encodeURIComponent(r.replace("{sid}",t.substring(4))+" ")):t.indexOf("eventId:")===0&&(r='eventId:"{eventId}" eventParentId:"{eventParentId}"',h=t.indexOf("eventParentId:"),h!==-1?(o=t.substring(8,h-1),v=t.substring(h+14)):(o=t.substring(8),v=o),u=encodeURIComponent(r.replace("{eventId}",o).replace("{eventParentId}",v)+" "),!e&&u&&(e=u)),!e||!u)?null:(c=nt.infoboxUrlFormat.replace(new RegExp("{query}","gi"),encodeURIComponent(e.trim())).replace("{filter}",u).replace("{tid}",i._tabID).replace("{appid}",s.dynamicProperties.appId)+"&cardWidth=280",c.toLowerCase().indexOf("mcig")<0&&(y=s.dynamicProperties.mapsIG,y&&(c+="&MCIG="+y)),c)}return null},i.prototype._processResponse=function(n,t){var i=this,r,u,f;if(t&&n&&(t.Address&&(n.addressFields=t.Address),t.PhoneNumber&&(n.setPhone?n.setPhone(t.PhoneNumber):n.PhoneNumber=t.PhoneNumber),t.PriceInfo&&(n.fullPriceString=t.PriceInfo),t.AverageStay&&(n.averageStay=t.AverageStay),t.Categories&&(n.interests=t.Categories.join(", ")),t.Rating&&(n.rating=t.Rating),t.OpenHours&&(n.openHours=t.OpenHours),t.Action&&t.Action.ActionName&&t.Action.ActionUrl&&(n.actionName=t.Action.ActionName,n.actionUrl=t.Action.ActionUrl)),r=this._getRichInfoboxObject(),r&&r.length&&n){var e=r.select(".b_entityTitle"),s=r.select(".b_mapbtns"),h=e.getParent();e.length&&s.length&&h.length&&(u=s.select("a"),u.length&&u.for_each(function(t){t&&(t.setAttribute("target",""),t.setAttribute("href","#"),t.setAttribute("role","button"),t.id&&(t.id.indexOf("newCollectAction")>-1?i._buttonGroupViewModel||o.enableOneClickSave&&i._cardLessMode?(i._buttonGroupViewModel||(i._buttonGroupViewModel=new ar(i._map)),t.addEventListener("click",function(t){i._saveClickHandler(t,n,r)}),t.addEventListener("keydown",function(t){var u=t;u&&u.keyCode&&u.keyCode!==13||i._saveClickHandler(t,n,r)})):i._saveDropDown?i._setSaveDropDownControl(t,n,r):t.setAttribute("style","display: none"):t.id.indexOf("directionAction")>-1&&(t.addEventListener("click",function(t){i._directionClickHandler(t,n)}),t.addEventListener("keydown",function(t){var r=t;r&&r.keyCode&&r.keyCode!==13||i._directionClickHandler(t,n)}))))}));f=r.select(".b_sgmbtns a");f.length&&f.for_each(function(t){t.parentElement.tagName.toLowerCase().indexOf("li")>-1?(t.setAttribute("target","_blank"),t.addEventListener("click",function(n){return i._segmentClickHandler(n)}),t.addEventListener("keydown",function(n){return i._segmentClickHandler(n)})):(t.removeAttribute("target"),t.removeAttribute("href"),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.addEventListener("click",function(t){return i._buttonSegmentClickHandler(t,n)}),t.addEventListener("keydown",function(t){return i._buttonSegmentClickHandler(t,n)}))})}},i.prototype._buttonSegmentClickHandler=function(n,t){var r=n,i,e,o;r&&r.keyCode&&r.keyCode!==13||(i=this._createInfoTaskData(t),i&&(i.launchOverflowTaskOnTaskActivate=!0),e=l._overrideTasktypeBasedOnCategory("LocalDetailsTask",i),o={state:i,type:e,activateOptions:{parentId:this._taskId}},f.invokeHandler(u.taskDataHandlerKey,o),this._segmentClickHandler(n))},i.prototype._getRichInfoboxObject=function(){var n=this.getOverlayElement();return n&&n.length?n.select(".MapsInfoboxContainer.rich"):null},i.prototype._insertPrice=function(n,t){var e=t.iconText,o=t&&t.getSegmentTypes&&t.getSegmentTypes(),r=o&&o.length&&o[0]||t&&t.getSearchCategory&&t.getSearchCategory(),i,u,f,s,h,c;r=r||t&&t.getSelectedCategoryForIcon&&t.getSelectedCategoryForIcon();r&&!l._isHouseCategory(r)&&e&&e.length>0&&(i=l._createElement("span"),i.add_class("lm_ritem"),u=l._createElement("div"),u.add_class("bm_lmrcon"),f=l._createElement("div"),f.add_class("lm_hpaprice"),f.appendText(e),f.appendTo(u),u.appendTo(i),s=n.select(".b_twoimages"),h=n.select(".b_mapbtns"),s.length>0?s[0].insertAdjacentElement("afterend",i[0]):h.length>0?h[0].insertAdjacentElement("beforeend",i[0]):(c=n.select(".b_entityTitle"),c.length>0&&c[0].insertAdjacentElement("beforebegin",i[0])))},i.prototype._moveButtons=function(n,t){var i,e,o;if(n&&n.length&&(i=n.select(".overlay-container"),i&&i.length&&t)){var f=i.select(".b_entityTitle"),u=i.select(".b_mapbtns"),s=f.getParent(),h=u.select("#newCollectAction");h.set_attr("title",this._saveTip);h.set_attr("aria-label",this._saveTip);e=u.select("#directionAction");o=r.L_Directions_To;e.set_attr("title",o);e.set_attr("aria-label",o);f.length&&u.length&&s.length&&(s.insertBefore(u,f),this._insertPrice(i,t))}return n},i.prototype._setSaveDropDownControl=function(n,t,i){var u=this,f,r;if(n){if(f=n.parentElement,!f)return;f.removeChild(n);var e=this._saveDropDown.getControl(),o=e.select(".saveDropdown.popOutTop"),s=o.removeFromParent();i.append(s);f.appendChild(e[0]);r=e.select(".saveButton");r.has_class("saved")&&r.remove_class("saved");r.set_attr("title",this._saveTip);r.set_attr("aria-label",this._saveTip);this._saveDropDown.setShowSaveButton(!0);this._buildSaveDropDownData(t);this._saveDropDown.setPreventDefaultClick(!0);r[0].addEventListener("click",function(n){n.preventDefault();n.stopPropagation();u._saveDropDown.setEntityImage(u._getImageURL(t,i));u._saveDropDownEventHandler(n,r)});r[0].addEventListener("keydown",function(n){var f=n;f&&f.keyCode&&f.keyCode!==13||(n.preventDefault(),n.stopPropagation(),u._saveDropDown.setEntityImage(u._getImageURL(t,i)),u._saveDropDownEventHandler(n,r))})}},i.prototype._saveDropDownEventHandler=function(n,t){var i=this;this._saveDropDown.saveOnInfoboxClicked(n,function(n){if(n===r.SavedOnInfobox){t.add_class("saved");var e={logData:{feature:"INF",action:"C",data:{AN:"CollectionsMenu",EP:y.Infobox}},impressionGuid:i._getOwnerIG()};f.invokeHandler(u.instrumentationDataHandlerKey,e)}},!1)},i.prototype._buildSaveDropDownData=function(n){var t=n,r=t&&t.getRoutableLocation?t.getRoutableLocation():null,u,f;r||(r=this.getOptions().location);var e=this._getSearchCategoryFromEntity(n),o=t&&t.getAddress&&t.getAddress(),s=t&&t.addressFields,i=k.getYpid(n);i.indexOf("ypid:")>-1&&(i=i.split("ypid:")[1]);i=i?n.id.toUpperCase().indexOf("YN")===-1?"YN"+i:i:"";u={id:i,title:k.getDisplayName(n),location:r,categoryId:e,address:o,addressFields:s};f={action:h.AddToTemporaryCollection,data:u};this._saveDropDown.setEntityInformation(f)},i.prototype._getImageURL=function(n,t){var r,i,u,f;if(n instanceof vt&&n.getImageUrl()){if(r=n.getImageUrl(),r)return r}else if(i=t.select(".b_twoimages"),i&&i.length>0&&i[0].childElementCount>0&&(u=i.select(".cico img"),u.length>0&&(f=u[0].getAttribute("src"),f)))return f;return""},i.prototype._saveClickHandler=function(n,i,r){var p=this,e,s,l,a,v;n&&(n.stopPropagation(),n.preventDefault());e=i;s=e&&e.getRoutableLocation&&e.getRoutableLocation();s||(s=this.getOptions().location);var h=y.Infobox,w=new bt,c={logData:{feature:"INF",action:"C",data:{AN:"CollectionsMenu",EP:h}},impressionGuid:this._getOwnerIG()};f.invokeHandler(u.instrumentationDataHandlerKey,c);this._buttonGroupViewModel&&(l=this._buttonGroupViewModel.getSaveButton(),l&&l.length!==0||this._buttonGroupViewModel.setSaveButton(t(n.target)),o.enableOneClickSave&&this._cardLessMode?(i.imageUrl=this._getImageURL(e,r),a=function(n){p._processCallback(n,e,s)},this._buttonGroupViewModel.setEntityData(i,{processCallback:a},r)):this._buttonGroupViewModel.setEntityData(i,{requestorType:"LocalSearchTask",requestorId:this._taskId},r),o.enableOneClickSave&&r.length>0&&(v=r.select(".b_twoimages"),v.length>0&&r.add_class("bm_images")),w.getIsSignedIn()?this._buttonGroupViewModel.collectionMenuButtonClicked(n,s,c,h):this._buttonGroupViewModel.collectionButtonClicked(n,s,c,h))},i.prototype._processCallback=function(n,t,i){if(o.enableOneClickSave&&n&&n.inData&&n.processorType===c.collectionsTask&&this._buttonGroupViewModel){var r=d.getMyPlacesTaskOptions(k.getDisplayName(t),i,t.dn);r.state.data.id=t.id;this._buttonGroupViewModel.processCollectionsData(n,r)}},i.prototype._directionClickHandler=function(n,t){var i;n&&(n.stopPropagation(),n.preventDefault());i={logData:{feature:"INF",action:"C",data:{AN:"Directions",EP:y.Infobox}},impressionGuid:this._getOwnerIG()};f.invokeHandler(u.instrumentationDataHandlerKey,i);var r=t.getAddress?t.getAddress():null,e=t.getRoutableLocation?t.getRoutableLocation():null,o=k.getDisplayName(t),s=new uu(r,e,o,!1,null,t.id,null,null,null,2,1,null),h={entryPoint:3,waypoints:[s]};f.invokeHandler(u.taskDataHandlerKey,{type:c.directionsTask,state:h})},i.prototype._segmentClickHandler=function(n){var t=n,i;t&&t.keyCode&&t.keyCode!==13||(this._segmentClicked=!0,i={logData:{feature:"INF",action:"C",data:{AN:"Segment",EP:y.Infobox}},impressionGuid:this._getOwnerIG()},f.invokeHandler(u.instrumentationDataHandlerKey,i))},i.prototype._logClick=function(n){if(n){var i=k.isLandmarkEntity(n)?s.dynamicProperties.mapsIG:this._getOwnerIG(),t=this._getlogData(n,"C");t.impressionGuid=i;f.invokeHandler(u.instrumentationDataHandlerKey,t)}},i.prototype._logOpen=function(n,t,i){var e=k.isLandmarkEntity(t)?s.dynamicProperties.mapsIG:this._getOwnerIG(),r=this._getlogData(t,"EX");r.impressionGuid=e;f.invokeHandler(u.instrumentationDataHandlerKey,r);this._logMapPageView(i)},i.prototype._logMapPageView=function(n){var t=n.select("div[data-ig]").get_attr("data-ig"),i;(t===null||t===void 0?void 0:t.length)>0&&(i={impressionGuid:s.dynamicProperties.mapsIG,logData:{feature:wr.MapPageView,action:"C",data:{P:"Page.Maps.Search",CIG:t}}},f.invokeHandler(u.instrumentationDataHandlerKey,i))},i.prototype._getOwnerIG=function(){for(var u,f,n=t(".taskCard.focus"),r=0;r<n.length;r++)if(u=n[r].getAttribute("data-subtaskid"),u&&u.indexOf(this._taskId)>-1&&(f=n.select("div[data-ig]"),f.length>0))return f.get_attr("data-ig");return i._tabID},i.prototype._getlogData=function(n,t){var i=this._taskId?this._taskId.indexOf("$")>-1?this._taskId.substring(0,this._taskId.indexOf("$")):this._taskId:"",u,r;return i=i?i:"Landmark",u=n&&n.id?n.id:"",r={logData:{feature:"INF",action:t,data:{SRC:i,TYP:this._getSearchCategoryFromEntity(n),LBL:k.getDisplayName(n),ID:u}}},t==="C"&&(r.logData.data.Q=k.getDisplayName(n)),r},i.prototype._getSearchCategoryFromEntity=function(n){if(k.isLandmarkEntity(n))return"Landmark";var t=n;if(t){if(t.getPrimaryCategoryName&&t.getPrimaryCategoryName())return t.getPrimaryCategoryName();if(t.getSearchCategory&&t.getSearchCategory())return t.getSearchCategory();if(t.getSelectedCategoryForIcon&&t.getSelectedCategoryForIcon())return t.getSelectedCategoryForIcon();if(t.getPrimaryCategoryPath&&t.getPrimaryCategoryPath())return t.getPrimaryCategoryPath()}return""},i.prototype._updateHtmlContent=function(n){return'<div class="MapsInfoboxContainer">'+n+"<\/div>"},i.prototype._updateHtmlContentV2=function(n){return'<div class="MapsInfoboxContainer rich"><div class="infoBoxLink" role="button" tabindex="0" aria-label="'+r.InfoboxListAriaLabel+'">'+n+'<\/div><div class="directionsPopOut" data-tag="directionsPopOut"><\/div><div class="collectionsPopOut"><\/div><\/div>'},i.prototype._createHtmlContentV2Primer=function(n){return'<div class="MapsInfoboxContainer rich"><div class="rib_primer"><a class="infoBoxLink" role="button" tabindex="0" aria-label="'+r.InfoboxListAriaLabel+'"><div class="bm_ib_container"><div class="bm_ib_title"><span class="cnm">'+(n?n:".")+"<\/span><\/div><\/div><\/a><\/div><\/div>"},i._tabID=l._hasBingHeaders()&&_G.IG,i}(br),gf=function(n){function i(t,i){var u=this,f={};return u=n.call(this,f,i,bu)||this,f.defineProperty("trafficOn",function(n,t){return u._onTrafficOnChanged(n,t)},null,{defaultValue:!1}),u._map=t,u.resources=r,u.onSettingsClosed=new p,u.onFeedbackClicked=new p,u.onExploreNearYouClicked=new p,u._highlightMapStyleButton(),u._closeSettingsOnClickOutsideSettingsPage(),u}return a(i,n),i.prototype.onRoadMapStyleClick=function(){var n=this._map.getMapTypes()[g.road];n&&this._map.setBaseLayers(n);this._highlightMapStyleButton()},i.prototype.onDarkRoadMapStyleClick=function(){var n=this._map.getMapTypes()[g.roadDark];n&&this._map.setBaseLayers(n);this._highlightMapStyleButton()},i.prototype.onAerialMapStyleClick=function(){var n=this._map.getMapTypes()[g.aerial];n&&this._map.setBaseLayers(n);this._highlightMapStyleButton()},i.prototype.onDoneClick=function(){this._closeSettings()},i.prototype.onTrafficClick=function(){this.setTrafficOn(!this.getTrafficOn())},i.prototype.onFeedbackClick=function(){var n=this,i=this._map.getContainer();i&&i.instanceAsync("FeedbackTask",function(i){i.activate(n._map,{title:"Feedback",feedbackTaskType:1,options:{showFeedbackHeader:!0}});var r=t("#feedbackContainer");r.clear();r.append(i.getContent(null));t("#feedbackWrapper").remove_class("collapsed");n.onFeedbackClicked.invoke()});this._closeSettings()},i.prototype.onExploreNearYouClick=function(){this.onExploreNearYouClicked.invoke();this._closeSettings()},i.prototype._highlightMapStyleButton=function(){var n="selected",t=this.getControl(),i=t.select(".roadStyle"),r=t.select(".darkStyle"),u=t.select(".aerialStyle");i.remove_class(n);r.remove_class(n);u.remove_class(n);this._map.getMapType().id===g.road?i.add_class(n):this._map.getMapType().id===g.roadDark?r.add_class(n):this._map.getMapType().id===g.aerial&&u.add_class(n)},i.prototype._closeSettingsOnClickOutsideSettingsPage=function(){var i=this,r=this.getControl().select("#settingsWrapper"),n;r.add_event("click",function(n){n.stopPropagation();n.preventDefault()});n=t("#screenOverlay");n.add_event("click",function(n){i._closeSettings();n.stopPropagation();n.preventDefault()})},i.prototype._closeSettings=function(){this.onSettingsClosed.invoke()},i.prototype._onTrafficOnChanged=function(n,t){var i=this,f=t,u=function(){i._trafficLayer&&(f?i._trafficLayer.showTrafficMapLayer():i._trafficLayer.hideTrafficMapLayer())},r;this._trafficLayer?u():(r=this._map.getContainer(),r&&r.instanceAsync("TrafficLayerV2",function(n){i._trafficLayer=n;u()}))},i}(ei),ne=function(n){function t(t,i){var r=this;return i=i||{},r=n.call(this,i)||this,i.defineProperty("name"),i.defineProperty("checked",function(n,t){r._onChanged(n,t)},null,{defaultValue:!1}),i.defineProperty("icon"),r.setName(t),r.onCheckedChanged=new p,r}return a(t,n),t.prototype.onItemClick=function(n){this.setChecked(!this.getChecked());n.preventDefault()},t.prototype._onChanged=function(n,t){t?this.onCheckedChanged.invoke(!0):n&&this.onCheckedChanged.invoke(!1)},t}(ct),te=function(n){function t(){var t=this,i={};return t=n.call(this,i)||this,i.defineProperty("itemList"),i.defineProperty("displayDropdown",null,null,{defaultValue:!1}),i.defineProperty("buttonName"),i.defineProperty("buttonIcon"),i.defineProperty("dropdownTitle"),t.setTemplate(new it(ou,{boolToDisplay:function(n){return t._boolToDisplay(n)},onDropdownButtonClick:function(n){t._onDropdownButtonClick(n)},itemCheckedClass:function(n){return t._itemCheckedClass(n)},dropdownOpenClass:function(n){return t._dropdownOpenClass(n)},mouseoverDropdown:function(n){t._mouseoverDropdownHandler(n)},mouseexitDropdown:function(n){t._mouseexitDropdownHandler(n)}})),t}return a(t,n),t.prototype._boolToDisplay=function(n){return n?"":"none"},t.prototype._onDropdownButtonClick=function(n){this.setDisplayDropdown(!0);n&&n.preventDefault&&n.preventDefault()},t.prototype._itemCheckedClass=function(n){return"multiselectCheckbox"+(n?" checked":"")},t.prototype._dropdownOpenClass=function(n){return"dropdownButton"+(n?" open":"")},t.prototype._mouseoverDropdownHandler=function(n){var t=this;window.clearTimeout(this._mouseoverDelay);this._mouseoverDelay=Microsoft.Maps.setTimeout(function(){t.setDisplayDropdown(!0)},50);this._tempButtonIcon||(this._tempButtonIcon=this.getButtonIcon());this.setButtonIcon(this._tempButtonIcon+" hover");n&&n.preventDefault&&n.preventDefault()},t.prototype._mouseexitDropdownHandler=function(n){var t=this;window.clearTimeout(this._mouseoverDelay);this._mouseoverDelay=Microsoft.Maps.setTimeout(function(){t.setDisplayDropdown(!1)},200);this.setButtonIcon(this._tempButtonIcon);n&&n.preventDefault&&n.preventDefault()},t}(dt);it.registerControl("MultiselectDropdown",te);var er=function(n){function t(t,i,r,u){var f=this,e={};return f=n.call(this,e)||this,f.title=t,f.linkTitle=i,f.linkData=r,f._buttonElement=u,e.defineProperty("showLink",null,null,{defaultValue:!0}),e.defineProperty("showChangeLink"),e.defineProperty("nickName"),e.defineProperty("showAnnotate"),e.defineProperty("parentClass"),f.setShowAnnotate(!1),f}return a(t,n),t.prototype.getButtonElement=function(){return this._buttonElement},t.prototype.setButtonElement=function(n){this._buttonElement=n},t.prototype.onLinkClick=function(n){this.linkData&&f.invokeHandler(u.taskDataHandlerKey,this.linkData);n&&n.preventDefault&&n.preventDefault()},t.prototype.onEditLinkClick=function(n){n&&n.preventDefault&&n.preventDefault()},t.prototype.onCloseLinkClick=function(n){n&&n.preventDefault&&n.preventDefault()},t.prototype.onSaveLinkClick=function(n){return n&&n.preventDefault&&n.preventDefault(),!0},t.prototype.onChangeLinkClick=function(n){return n&&n.preventDefault&&n.preventDefault(),!0},t.prototype.onKeyPress=function(){},t.prototype.boolToDisplay=function(n){return n?"inline":"none"},t.prototype.boolToNotDisplay=function(n){return n?"none":"block"},t}(ct),bi=function(n){function i(t,i,r,u,f,e,o){var s=n.call(this,t,i,r,u)||this;return s._buttonElement=u,s._container=f,s.setShowLink(!0),s.processOptions=e,s.entityId=o,s.showFooter=e&&e.requestState&&e.requestState.entityId?"":"none",s.popOutChangeLinkClicked=new p,s}return a(i,n),i.prototype.onLinkClick=function(t){var i,r,e;if(this.linkData)n.prototype.onLinkClick.call(this,t);else if(this.processOptions){if(this._container&&o.enableSingleMyPlacesCard&&(i=this._container.instance("CollectionsTask"),i&&i.id&&i.stackId)){r=this.processOptions.requestState;r.action=h.ViewCollection;this.processOptions.taskId=i.id;e={action:"focus",id:i.id,type:c.collectionsTask,state:r};f.invokeHandler(u.taskDataHandlerKey,e);return}f.invokeHandler(u.taskProcessDataHandlerKey,this.processOptions)}else this.activateOptions&&(this.isTempCollectionMessage||o.enableOneClickSave)&&f.invokeHandler(u.taskDataHandlerKey,this.activateOptions);t&&t.preventDefault&&t.preventDefault()},i.prototype.onSaveLinkClick=function(t){var i,r,e,o;return n.prototype.onSaveLinkClick.call(this,t),i=this.getNickName().trim(),i?(this.processOptions&&this.processOptions.requestState?(r=this.processOptions.requestState,r.action=h.UpdateEntity,r.entityId=this.entityId,r.data={title:i},this.processOptions.useActiveTasks=!1,f.invokeHandler(u.taskProcessDataHandlerKey,this.processOptions)):(e=this.activateOptions&&this.activateOptions.state&&this.activateOptions.state.collectionId,o={type:c.collectionsTask,requestorType:this.requestorType,requestorId:this.requestorId,requestState:{action:h.UpdateEntity,entityId:this.entityId,collectionId:e,data:{title:i}}},f.invokeHandler(u.taskProcessDataHandlerKey,o)),this.saveNicknameClicked=!0,!0):(this.focusMessageOrTextBox(),!1)},i.prototype.onChangeLinkClick=function(t){return n.prototype.onChangeLinkClick.call(this,t),this.popOutChangeLinkClicked.invoke(t),!0},i.prototype.onKeyPress=function(n){var i,r;if(n.keyCode===13)this.onSaveLinkClick(null);else n.keyCode===9&&(i=n.target,this._buttonElement&&this._buttonElement.length>0&&i&&(i.classList.contains("popoutSaveButton")||i.classList.contains("seeItLink")&&n.shiftKey)&&(r=t(".messageContainer"),r.length>0&&r.fireEvent("blur"),this._buttonElement[0].focus()))},i.prototype.focusMessageOrTextBox=function(){this.getShowAnnotate()?Microsoft.Maps.setTimeout(function(){var n=t(".nameEditBox"),i,r,f,u;if(n&&n.length)for(i=null,r=0;r<n.length;r++)if(n[r].focus(),i=document.activeElement,i&&i.classList.contains("nameEditBox"))break;f=document.activeElement;f.classList.contains("nameEditBox")||(u=t(".messageContainer"),u.length>0&&u[0].focus())},500):Microsoft.Maps.setTimeout(function(){var n=t(".messageContainer");n.length>0&&n[0].focus()},100)},i}(er),ht=function(){function n(n){this._buttonElement=n;this.setDropdown([])}return n.prototype.getButtonElement=function(){return this._buttonElement},n.prototype.setButtonElement=function(n){this._buttonElement=n},n.prototype.setDropdown=function(n){this.dropdownList=n||[]},n.prototype.onEntryClicked=function(n){if(n>=0&&n<this.dropdownList.length){var t=this.dropdownList[n];t.options?f.invokeHandler(u.taskDataHandlerKey,t.options):t.handler&&t.handler.call(this,null,n);t.instData&&f.invokeHandler(u.instrumentationDataHandlerKey,this.dropdownList[n].instData)}},n.prototype.onEntryMouseover=function(n){if(n>=0&&n<this.dropdownList.length){var t=this.dropdownList[n];t.mouseoverhandler&&(t.mouseoverhandler.call(this,null,n),t.instData&&f.invokeHandler(u.instrumentationDataHandlerKey,this.dropdownList[n].instData))}},n.prototype.onEntryMouseout=function(n){if(n>=0&&n<this.dropdownList.length){var t=this.dropdownList[n];t.mouseouthandler&&t.mouseouthandler.call(this,null,n)}},n}(),ki=function(n){function e(t,i,r,u,f,e){var o=n.call(this,i)||this,h;return o._map=t,o.entityDescription=e,o.entityNickName=u,o.entityOriginalName=f,o.isMoveToMenu=r,h=s.features.travel,o._showItineraries=h&&h.isEditable,o.newCollectionCreated=new p,o.contextMenuFinished=new p,o}return a(e,n),e.prototype.setDropdownData=function(n,t,i,r,u,f,e,o,s){var h=this,c,l;this._entityId=i.id;c=new bt;this._showItineraries&&c.getIsSignedIn()?(l=this._map.getContainer(),l.instanceAsync("ItineraryDataManager",function(c){h._dataManager=c;h._dataManager.retrieveAllItinerariesMetaData(function(c,l){c&&l===0&&(h.dropdownList=h._populateDropDownListData(n,t,i,r,u,f,e,c,s));o&&o()})})):(this.dropdownList=this._populateDropDownListData(n,t,i,r,u,f,e),o&&o())},e.prototype.onEntryClicked=function(n){var e,i,r,t,s,l;n<0||n>=this.dropdownList.length||(e=this.dropdownList[n],i=e.options,i&&(t=i.requestState,t?(r=u.taskProcessDataHandlerKey,o.enableOneClickSave&&(t.removeEntityFromItinerary?(s={type:c.itineraryDetailsTask,taskId:t.removeEntityFromItineraryDetailsTaskId,requestState:{action:8,itineraryItem:{Id:t.entityId||t.itineraryItem.Id}}},f.invokeHandler(r,s)):t.removeEntityAndPerformAction&&t.removeEntityFromCollectionId&&i.type===c.itineraryDetailsTask&&(l={type:c.collectionsTask,requestState:{action:h.RemoveEntity,removeEntityFromCollectionId:t.removeEntityFromCollectionId,entityId:t.entityId}},f.invokeHandler(r,l)))):(r=u.taskDataHandlerKey,this.newCollectionCreated.invoke()),f.invokeHandler(r,i)),e.handler&&e.handler(null,n))},e.prototype._populateDropDownListData=function(n,t,i,u,f,e,s,c){var ht=this,p=[],k,w,yt,st,ft,b,nt,ut;if(!n||!i||!u||!f&&!e)return p;var v=i,g=i instanceof vt?v:null,ct=v.categoryId||g&&g.getSelectedCategoryForIcon(),pt=v.addressFields,wt=v.interests,bt=v.stayDuration,it=v.getImageUrl(),a=d.getMyPlacesTaskOptions(v.getTitle(),u,this.entityDescription,v.getAddress(),it&&it.length>0?it:null,ct,this._entityId,pt,v.metadataString,v.mainSegmentType),l=t&&t.requestState;if(o.enableOneClickSave&&(!this.isMoveToMenu&&(l===null||l===void 0?void 0:l.removeEntityAndPerformAction)?(a.state.removeEntityAndPerformAction=l.removeEntityAndPerformAction,a.state.removeEntityFromCollectionId=t.requestState.removeEntityFromCollectionId,l.entityId&&(a.state.entityId=l.entityId)):!this.isMoveToMenu&&(l===null||l===void 0?void 0:l.removeEntityFromItinerary)&&(a.state.removeEntityFromItinerary=l.removeEntityFromItinerary,a.state.removeEntityFromItineraryDetailsTaskId=l.removeEntityFromItineraryDetailsTaskId,a.state.removeEntityFromCollectionId=t.requestState.removeEntityFromCollectionId,l.entityId&&(a.state.entityId=l.entityId))),a.activateOptions={parentId:f},this.entityNickName&&this.entityOriginalName?(a.state.data.nickName=this.entityNickName,a.state.data.title=this.entityOriginalName):v.getNickname&&v.getNickname()&&(a.state.data.nickName=v.getNickname()),k=s.logData.data,a.state.entryPoint=k&&(k.EP&&k.EP===y.LocalDetails||k.ID)?3:2,w=k&&k.EP,this.isMoveToMenu&&(a.state.isMove=!0),(!o.enableOneClickSave||(l===null||l===void 0?void 0:l.removeEntityFromCollectionId)||(l===null||l===void 0?void 0:l.removeEntityFromItinerary)||this.isMoveToMenu)&&this._pushFavoritesAction(p,this.isMoveToMenu?r.L_MoveToFavorites:r.L_AddFavorite,h.AddFavorite,a,e,w,"newFavorite icon"),p.push({name:"",separator:!0}),this._showItineraries){var et=!1,rt=g&&g.getSegmentTypes(),lt=g&&g.getPrimaryCategoryName(),at=function(){ht.contextMenuFinished.invoke()},ot=a.state,tt=d.getItineraryItem(ot.data.nickName||ot.data.title,u,i.id,it,ct,wt,bt);if(lt?tt.CategoryName=lt:(rt===null||rt===void 0?void 0:rt.length)>0&&(tt.CategoryName=rt[0]),tt.OriginalName=ot.data.title,w===y.ContextMenu||o.enableOneClickSave||this._pushMostRecentlyUsedListEntries(p,tt,at,a,e,f,w)&&(et=!0),c&&c.length)for(et=!0,b=0,yt=c.length;b<yt;b++)st=c[b],o.enableOneClickSave&&(l===null||l===void 0?void 0:l.removeEntityFromCollectionId)&&(l===null||l===void 0?void 0:l.removeEntityFromCollectionId)===st.collectionId||(ut=this._createSaveToItineraryAction(tt,a,at,st,e,f,w),p.push(ut));et&&p.push({name:"",separator:!0})}for(p.push({name:r.L_CreateNewCollection,handler:function(){ht._createNewCollectionControl(a.state)},iconClass:"newCollection icon"}),ft=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,b=0;b<n.collections.length;b++)nt=n.collections[b],o.useJsonApiForFavorites&&ft&&ft.Utilities&&ft.Utilities.isDefaultCollectionId(nt.id)||o.enableOneClickSave&&t.requestState.removeEntityFromCollectionId&&t.requestState.removeEntityFromCollectionId===nt.id||(ut=this._createSaveToCollectionAction(nt.name,nt.id,a,e,f,w),nt.name&&p.push(ut));return p.push({name:"",separator:!0}),this._pushFavoritesAction(p,this.isMoveToMenu?r.L_MoveToHome:r.L_SetAsHome,h.SetHome,a,e,w,"setHome icon"),this._pushFavoritesAction(p,this.isMoveToMenu?r.L_MoveToWork:r.L_SetAsWork,h.SetWork,a,e,w,"setWork icon"),p},e.prototype._pushFavoritesAction=function(n,t,i,r,u,f,e){var o={type:r.type,requestorId:r.activateOptions.parentId,requestorType:u,requestState:{action:i,data:r.state.data,removeEntityAndPerformAction:r.state.removeEntityAndPerformAction,removeEntityFromCollectionId:r.state.removeEntityFromCollectionId,removeEntityFromItinerary:r.state.removeEntityFromItinerary,removeEntityFromItineraryDetailsTaskId:r.state.removeEntityFromItineraryDetailsTaskId,entityId:r.state.entityId},requestorState:{entryPoint:f}};n.push({name:t,options:o,iconClass:e})},e.prototype._pushSaveToTempAction=function(n,t,i,u,f){var e={requestorId:t.activateOptions.parentId,requestorType:i,type:c.collectionsTask,requestState:{action:h.AddToTemporaryCollection,data:t.state.data},requestorState:{entryPoint:u}};n.push({name:r.L_TemporaryCollectionTitle,options:e,iconClass:f?"newCollection icon":"icon"})},e.prototype._createSaveToCollectionAction=function(n,t,i,r,u,f){var e={type:i.type,requestorId:u,requestorType:r,requestState:{action:h.AddEntity,data:i.state.data,collectionId:t,removeEntityAndPerformAction:i.state.removeEntityAndPerformAction,removeEntityFromCollectionId:i.state.removeEntityFromCollectionId,removeEntityFromItinerary:i.state.removeEntityFromItinerary,removeEntityFromItineraryDetailsTaskId:i.state.removeEntityFromItineraryDetailsTaskId,entityId:i.state.entityId},requestorState:{title:n,entryPoint:f}};return{name:n,options:e,iconClass:"icon"}},e.prototype._createSaveToItineraryAction=function(n,t,i,r,u,f,e){var s=this._getActiveItineraryTaskId(r),h={type:c.itineraryDetailsTask,requestorId:f,requestorType:u,taskId:s,requestState:{action:o.enableOneClickSave&&s?1:5,itineraryItem:n,itineraryCollectionId:r.collectionId,removeEntityAndPerformAction:t.state.removeEntityAndPerformAction,removeEntityFromCollectionId:t.state.removeEntityFromCollectionId,removeEntityFromItinerary:t.state.removeEntityFromItinerary,removeEntityFromItineraryDetailsTaskId:t.state.removeEntityFromItineraryDetailsTaskId,title:r.getName()},requestorState:o.enableOneClickSave?{title:n.Name,entryPoint:e}:null};return{name:r.getName(),options:h,handler:i,iconClass:"icon"}},e.prototype._createSaveToOpenItineraryAction=function(n,t,i,r){var u={type:c.itineraryDetailsTask,requestState:{action:1,itineraryItem:n},taskId:r};return{name:i,options:u,handler:t,iconClass:"icon"}},e.prototype._pushMostRecentlyUsedListEntries=function(n,t,r,u,f,e,s){var p=i.CloudGraphDataManager.MostRecentlyUsedList&&i.CloudGraphDataManager.MostRecentlyUsedList.instance,a=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,v,l,h,c,w,y;if(p.getLength()>0){for(n.splice(0,0,{name:"",separator:!0}),v=p.getList(),l=v.length-1;l>=0;l--)h=v[l],h.IsItinerary?h.IsOpenTask?c=this._createSaveToOpenItineraryAction(t,r,h.TaskTitle,h.TaskId):(w=h.Itinerary,c=this._createSaveToItineraryAction(t,u,r,w,f,e,s)):o.useJsonApiForFavorites&&a&&a.Utilities&&a.Utilities.isDefaultCollectionId(h.Collection.id)||(y=h.Collection,c=this._createSaveToCollectionAction(y.name,y.id,u,f,e,s)),l===0&&c&&(c.iconClass="recentlyUsed icon"),c&&n.splice(0,0,c);return!0}return!1},e.prototype._createNewCollectionControl=function(n){var i=this,r;this.newCollectionCreated.invoke();r=this._map.getContainer();r.instanceAsync("NewCollectionControl",function(r){var e=t("#transientLens"),o,s,f,u;e.length>0?(u=e.getParent(),f=i._map.getRootElement().getParent(),u.getParent().has_class("bm_listMenu")&&(u=u.getParent(),f=u.getParent()),o=u.get_style("left"),s=u.get_style("top")):f=i.popOutRoot;r.setLeftPosition(o);r.setTopPosition(s);r.setEntityData(n);i.contextMenuFinished.invoke();i.contextMenuFinished.invoke();r.finished.add(function(){i._removeNewCollectionControl()});i._newCollectionControl=r.getControl();f&&f.append(i._newCollectionControl)})},e.prototype._removeNewCollectionControl=function(){this._newCollectionControl&&this._newCollectionControl.removeFromParent();this._newCollectionControl=null},e.prototype._getActiveItineraryTaskId=function(n){var u,f,r,t;if(!o.enableOneClickSave)return null;if(u=i.CloudGraphDataManager.MostRecentlyUsedList&&i.CloudGraphDataManager.MostRecentlyUsedList.instance,u.getLength()>0){for(f=u.getList(),r=f.length-1;r>=0;r--)if(t=f[r],t.IsItinerary&&t.ItineraryCollectionId&&t.ItineraryCollectionId===n.collectionId)return t.TaskId;return null}},e}(ht),or=function(n){function t(t,i,r,u,f,e){var o=n.call(this,u)||this;return o._addToRouteMode=e,o.setDropdownData(t,i,r,f),o}return a(t,n),t.prototype.setDropdownData=function(t,i,r,u){n.prototype.setDropdown.call(this,this._populateDropDownListData(t,i,r,u))},t.prototype._populateDropDownListData=function(n,t,u,f){var s=[],v,y,p,w,e,b,it,g,c,h,l,a,o,rt,ut,k,ft,nt,tt,et,ot;if(!n||!t||!u)return s;if(w=t.getDescription()||t.getTitle(),e=t,e&&e.id&&e.id.indexOf("event")>-1&&(it=i.GlobalConfig.features.localSearch.eventPreArrivalTime,b=e&&e.getDateTime&&e.getDateTime()?e.getDateTime()+e.getUtcOffset()*6e4-it*6e4:null),g=d.getDirectionTaskOptions(w,u,f.logData.data.EP,t.getTitle(),t.id,null,b),f){v={logData:{feature:f.logData.feature,action:f.logData.action,data:{}}};y={logData:{feature:f.logData.feature,action:f.logData.action,data:{}}};p={logData:{feature:f.logData.feature,action:f.logData.action,data:{}}};c=f.logData.data;for(h in c)c.hasOwnProperty(h)&&(v.logData.data[h]=c[h],y.logData.data[h]=c[h],p.logData.data[h]=c[h]);v.logData.data.DT="DirectionsTo";y.logData.data.DT="DirectionsFrom";p.logData.data.DT="AddWaypoint"}for(l=null,a=0;a<n.length;a++)o=n[a].data,o.activationState!==1||this._addToRouteMode?(o.routeTitle&&o.mode!==gt.transit||o.isIncomplete)&&(k="",this._addToRouteMode||(k=r.L_Directions_AddToRoute+"\n"),k+=o.routeTitle,o.isIncomplete&&(g.state.waypoints[0].waypointType=4),ft={action:"focus",state:g.state,id:n[a].processorId},s.push({name:k,options:ft,instData:p})):(l=n[a].processorId,o.routeTitle&&o.mode!==gt.transit&&(rt=d.getDirectionTaskOptions(w,u,f.logData.data.EP,t.getTitle(),t.id,3,b),ut={action:"focus",state:rt.state,id:l},s.splice(0,0,{name:r.L_Add_To_Current_Route,options:ut,instData:p})));return this._addToRouteMode||(nt=d.getDirectionTaskOptions(w,u,f.logData.data.EP,t.getTitle(),t.id,2,b),tt=d.getDirectionTaskOptions(w,u,f.logData.data.EP,t.getTitle(),t.id,1,b),l?(et={action:"focus",state:tt.state,id:l},s.splice(0,0,{name:r.L_Directions_From,options:et,instData:y}),ot={action:"focus",state:nt.state,id:l},s.splice(0,0,{name:r.L_Directions_To,options:ot,instData:v})):(s.splice(0,0,{name:r.L_Directions_From,options:tt,instData:y}),s.splice(0,0,{name:r.L_Directions_To,options:nt,instData:v}))),s},t}(ht),di=function(n){function i(i,u,f,e,o){var s=this,h={},c,l;return s=n.call(this,h)||this,h.defineProperty("popOutTemplate",function(n,t){return s._onTemplateChange(n,t)}),h.defineProperty("popOutContent"),h.defineProperty("isDisplayed",function(n,t){return s._onDisplayChange(n,t)},null,{defaultValue:!1}),h.defineProperty("buttonClass"),s.setButtonClass("hidePopupButton"),h.defineProperty("popOut"),h.defineProperty("ariaLabel"),h.defineProperty("dropdownClass"),h.defineProperty("parentClass"),h.defineProperty("popOutId"),s.setParentClass(o?o:""),s.resources=r,s.dropdownList=new gr,s.setDropdownClass("popOutTop"),i&&s.setDropdown(i),u&&s.setPopOut(u),c=f?f:yi,l=e?e:vu,s._dropdownListTemplate=new it(c,{onEntryClicked:function(n){s._dropdownListViewModel.onEntryClicked(n);i.dropdownList&&i.dropdownList[n]&&i.dropdownList[n].subMenu||s.setIsDisplayed(!1)},onEntryMouseover:function(n){s._dropdownListViewModel.onEntryMouseover(n);i.dropdownList&&i.dropdownList[n]&&i.dropdownList[n].subMenu||s.setIsDisplayed(!0)},onEntryMouseout:function(n){s._dropdownListViewModel.onEntryMouseout(n)}}),s._popoutMessageTemplate=new it(l,{onPopOutLinkClick:function(n){return s.onPopOutLinkClicked(n)},onPopOutEditLinkClick:function(n){return s.onPopOutEditLinkClick(n)},onPopOutCloseLinkClick:function(n){return s.onPopOutCloseLinkClick(n)},onPopOutSaveLinkClick:function(n){return s.onPopOutSaveLinkClick(n)},onPopOutKeyPressed:function(n){return u.onKeyPress(n)},onTextBoxClick:function(n){return s.onTextBoxClick(n)},onPopOutClick:function(n){return s.onPopOutClick(n)},onPopOutChangeLinkClick:function(n){return u.onChangeLinkClick(n)},boolToDisplay:function(n){return u.boolToDisplay(n)},boolToNotDisplay:function(n){return u.boolToNotDisplay(n)}}),s.popOutHidden=new p,s.setPopOutTemplate(s._dropdownListTemplate),s.setPopOutContent(s),s.setPopOutId(o+"popOut"),s._windowKeyupEventHandler=function(n){var u=n,f=s.getParentClass()&&t("."+s.getParentClass()),i,r;if(u.keyCode===9){if(i=document.activeElement,r=i&&i.classList,r&&r.contains("bm_dropdownEntry"))return;s._hideControls()}else if(u.keyCode===37)s._hideControls();else if(u.keyCode===38){if(i=document.activeElement,r=i&&i.classList,r&&r.contains("bm_dropdownEntry"))return;s._hideControls()}else if(u.keyCode===39)s._hideControls();else if(u.keyCode===40){if(i=document.activeElement,r=i&&i.classList,r&&r.contains("bm_dropdownEntry"))return;s._hideControls()}},s._windowBlurEventHandler=function(){Microsoft.Maps.setTimeout(function(n){s.onPopoutMessageBlur(n)},50)},s}return a(i,n),i.prototype.dispose=function(){n.prototype.dispose.call(this);this.dropdownList.clear()},i.prototype.isPopOutInListMode=function(){return this.getPopOutTemplate()===this._dropdownListTemplate},i.prototype.setDropdown=function(n,i){var u=this._dropdownListViewModel&&this._dropdownListViewModel.getButtonElement(),r;u&&u.remove_class("selected");this._dropdownListViewModel=n;r=this._dropdownListViewModel.getButtonElement();r&&r.add_class("selected");this.dropdownList.clear();this.dropdownList.insertAll(this._dropdownListViewModel.dropdownList);this.setPopOutTemplate(i?i:this._dropdownListTemplate);t(window).add_event("keyup",this._windowKeyupEventHandler)},i.prototype.setTemplateToPopOutMessage=function(){var i=this,n;this.setPopOutTemplate(this._popoutMessageTemplate);n=this.getPopOut();n&&n instanceof bi?(n.focusMessageOrTextBox(),Microsoft.Maps.setTimeout(function(){var n=t(".messageContainer");n.length>0&&n.add_event("blur",i._windowBlurEventHandler)},501)):Microsoft.Maps.setTimeout(function(){var n=t(".messageContainer");n.length>0&&n[0].focus()},100)},i.prototype.onPopOutLinkClicked=function(n){this.getPopOut().onLinkClick(n);this.setIsDisplayed(!1)},i.prototype.onPopOutEditLinkClick=function(n){this.getPopOut().onEditLinkClick(n);this.setIsDisplayed(!1)},i.prototype.onPopOutCloseLinkClick=function(n){this.getPopOut().onCloseLinkClick(n);this.setIsDisplayed(!1)},i.prototype.onPopOutSaveLinkClick=function(n){var t=this.getPopOut().onSaveLinkClick(n);this.setIsDisplayed(!t)},i.prototype.onTextBoxClick=function(n){n&&n.preventDefault&&n.preventDefault()},i.prototype.onPopOutClick=function(n){n&&n.preventDefault&&n.preventDefault()},i.prototype.onPopoutMessageBlur=function(n){var r,i;n&&n.target&&n.target.classList&&n.target.classList.contains("messageContainer")&&(this.setIsDisplayed(!1),r=this.getParentClass(),r&&(i=t("."+r),i&&i.get_attr("aria-expanded")!==undefined&&i.set_attr("aria-expanded","true")),n.preventDefault(),n.stopImmediatePropagation())},i.prototype.buildPopOut=function(n){var t=n?n:au,i=new it(t);return i.applyDataTemplate(this)},i.prototype._onTemplateChange=function(n,t){var i=this._dropdownListViewModel&&this._dropdownListViewModel.getButtonElement(),r=this.getPopOut()&&this.getPopOut().getButtonElement();n===this._dropdownListTemplate?i&&i.remove_class("selected"):n===this._popoutMessageTemplate?r&&r.remove_class("selected"):(i&&i.remove_class("selected"),r&&r.remove_class("selected"));t===this._dropdownListTemplate?i&&i.add_class("selected"):t===this._popoutMessageTemplate&&r&&r.add_class("selected")},i.prototype._onDisplayChange=function(n,i){var r=this._dropdownListViewModel&&this._dropdownListViewModel.getButtonElement(),u=this.getPopOut()&&this.getPopOut().getButtonElement(),o=this.getPopOutTemplate(),f,e;o===this._dropdownListTemplate?(u&&u.remove_class("selected"),r&&(i?(r.add_class("selected"),f=r.select(".feedbackMenuLink"),f&&f.length>0&&r.set_attr("aria-expanded","true")):(r.remove_class("selected"),r.get_attr("aria-expanded")?r.set_attr("aria-expanded","false"):null))):o===this._popoutMessageTemplate&&(r&&r.remove_class("selected"),u&&(i?u.add_class("selected"):u.remove_class("selected")));n&&!i?(this.popOutHidden.invoke(),r&&r.remove_class("selected"),u&&u.remove_class("selected"),t(window).remove_event("keyup",this._windowKeyupEventHandler)):!n&&i&&(e=this.getPopOut(),e&&e.setNickName(""))},i.prototype._hideControls=function(){this.setIsDisplayed(!1);var n=this._dropdownListViewModel&&this._dropdownListViewModel.getButtonElement();n&&n.length>0&&(n.get_attr("aria-expanded")&&n.set_attr("aria-expanded","false"),n[0].focus())},i}(ct),sr=function(n){function t(t,i,r){var u=n.call(this,i)||this;return u.setDropdown(t),u._isMultipleSelection=r||!1,u._updateItemsCssClasses(),u}return a(t,n),t.prototype.onEntryClicked=function(t){if(t>=0&&t<this.dropdownList.length){var i=this.dropdownList[t];if(i.isSelected&&!this._isMultipleSelection)return;i.isSelected||this._isMultipleSelection||this._unselectAllItems();i.isSelected=!i.isSelected;this._updateItemsCssClasses();n.prototype.onEntryClicked.call(this,t)}},t.prototype._unselectAllItems=function(){for(var n=0;n<this.dropdownList.length;n++)this.dropdownList[n].isSelected=!1},t.prototype._updateItemsCssClasses=function(){for(var i=0;i<this.dropdownList.length;i++){var n=this.dropdownList[i],r=t._selectedCssClass,u=n.cssClass&&n.cssClass.search(r)!=-1;n.isSelected&&!u?n.cssClass&&n.cssClass.length>0?n.cssClass+=" "+r:n.cssClass=r:!n.isSelected&&u&&(n.cssClass=n.cssClass.replace(r,""),n.cssClass=n.cssClass.replace("  "," ").trim())}},t._selectedCssClass="selected",t}(ht),ie=function(){function n(n,t){this._events=[];this.filterItem=n;this._filterItemTemplateName=t;this.filterOptionClicked=new p;this._viewModelInitialized=!1;this.hideParent=new p}return n.prototype.setViewModelData=function(n,t){this._popOutRootElement=n;this._filterButton=t},n.prototype.filterButtonButtonClicked=function(n){if(n.preventDefault(),this.filterItem.isEnabled()){var t=this._popOutButtonViewModel&&this._popOutButtonViewModel.getIsDisplayed();t||this._showPopOut()}},n.prototype._updatePopOutListDropdownViewModel=function(n){this._popOutButtonViewModel.setDropdown(n)},n.prototype.dispose=function(){this._popOutButtonViewModel&&this._popOutButtonViewModel.dispose()},n.prototype.refresh=function(){this._viewModelInitialized&&this._dropdownViewModel.setDropdown(this._createDropdownListData())},n.prototype._displayPopOut=function(){var n=this;Microsoft.Maps.setTimeout(function(){n._popOutButtonViewModel.setIsDisplayed(!0)},0)},n.prototype._showPopOut=function(){if(this._initializeViewModels(),this._dropdownViewModel.dropdownList.length>0){var i=l._isFeatureEnabled("mobileMyPlaces")?t("#filterChoiceBar"):this._popOutRootElement.select("div."+n.popOutCssClass);this._updatePopOutListDropdownViewModel(this._dropdownViewModel);i.append(this._popOutElement);this._displayPopOut()}else this.hideParent.invoke()},n.prototype._initializeViewModels=function(){var n=this;this._viewModelInitialized?this._dropdownViewModel.setButtonElement(this._filterButton):(this._dropdownViewModel=new sr(this._createDropdownListData(),this._filterButton,this.filterItem.filterType===2),this._popOutButtonViewModel=new di(this._dropdownViewModel,this._PopOutMessageViewModel,this._filterItemTemplateName,null),this._events.push(this._popOutButtonViewModel.popOutHidden.add(function(){n._dropdownViewModel!=null&&n._dropdownViewModel.dropdownList.length>1?n.hideParent.invoke():n._popOutButtonViewModel.isPopOutInListMode()||n.hideParent.invoke()})),this._popOutElement=this._popOutButtonViewModel.buildPopOut(),this._viewModelInitialized=!0)},n.prototype._createDropdownListData=function(){for(var n,t=this,r=[],i=0;i<this.filterItem.options.length;i++)n=this.filterItem.options[i],r.push({value:n.value,name:n.label,isSelected:n.isSelected,cssClass:"variant",handler:function(n,i){t._applyViewModelSelection();t.filterOptionClicked.invoke(t.filterItem.options[i])}});return r},n.prototype._applyViewModelSelection=function(){for(var n=0;n<this._dropdownViewModel.dropdownList.length;n++)this.filterItem.options[n].isSelected=this._dropdownViewModel.dropdownList[n].isSelected},n.popOutCssClass="routesPopOut",n}(),hr=function(n){function t(t,i,r,u,f){var e=n.call(this,u)||this;return e.setDropdownData(t,i,r,f),e}return a(t,n),t.prototype.setDropdownData=function(t,i,r,u){n.prototype.setDropdown.call(this,this._populateDropDownListData(t,i,r,u))},t.prototype.onEntryClicked=function(n){if(!(n<0)&&!(n>=this.dropdownList.length)){var t=this.dropdownList[n].options,i;i=t.requestState?u.taskProcessDataHandlerKey:u.taskDataHandlerKey;f.invokeHandler(i,t)}},t.prototype._populateDropDownListData=function(n,t,i){var f=[],u,h,e;if(!n||!n.length||!t||!i)return f;var c=t,o=n[0].data.days,l=n[0].processorId;for(u=0;u<=o;u++)(h=d.getItineraryDayOptions(c,l,u),e=r.L_MoveToDay.replace("{0}",u+1),u===o&&(e=r.L_MoveToNewDay,s.isInPrivateMode))||f.push({name:e,options:h});return f},t}(ht),cr=function(n){function t(t,i,r,u){var f=n.call(this,r)||this;return f._address=u,f.setDropdownData(t,i),f.contextMenuFinished=new p,f}return a(t,n),t.prototype.setDropdownData=function(t,i){n.prototype.setDropdown.call(this,this._populateDropDownListData(t,i))},t.prototype.setAddress=function(n){this._address=n},t.prototype.buildCategoryIcons=function(n,t,i){var u,f,r;if(this._categories&&this._categories.length!==0&&t&&t.length!==0)for(u=t.select(".nearbyCatIcon"),f=this._categories.length,r=0;r<f;r++)this._drawIcon(n,this._categories[r],u[r],i)},t.prototype.onEntryClicked=function(n){if(n>=0&&n<this.dropdownList.length){var t=this.dropdownList[n];t.options&&t.options.type===c.nearbyTransitTask?f.invokeHandler(u.taskDataHandlerKey,t.options):f.invokeHandler(u.taskProcessDataHandlerKey,t.options);f.invokeHandler(u.instrumentationDataHandlerKey,t.instData);this.contextMenuFinished.invoke()}},t.prototype._populateDropDownListData=function(n,i){var f=[],r,e,o,u;if(!n||n.length===0||!i)return f;for(this._categories=n,r=0;r<this._categories.length;r++)e={logData:{feature:"NBC",action:"C",data:{query:this._categories[r].Name,lat:i.latitude,lon:i.longitude}}},this._categories[r].Id===t.nearbyTransitCategoryId?(o={location:i,title:this._address,entryPoint:2},f.push({name:this._categories[r].Name,options:{state:o,type:c.nearbyTransitTask},cssClass:"nearbyItem",instData:e,iconClass:"nearbyCatIcon"})):(u={},u.entryPoint=y.ContextMenu,u.query=this._categories[r].Name,u.point=[i.latitude,i.longitude],f.push({name:this._categories[r].Name,options:{requestState:u,type:c.localSearchTask},cssClass:"nearbyItem",instData:e,iconClass:"nearbyCatIcon"}));return f},t.prototype._drawIcon=function(n,i,r){var f=i.Id,u=null;l._isHighContrastMode()&&(u=t._suggestionHighContrastIconColor);n.getCategoryIconTemplate(function(n){var t=n&&n.icon;t&&r.appendChild(t.renderIcon()[0])},f,u,24,24)},t._suggestionRoadIconColor="rgb(64,64,64)",t._suggestionAerialIconColor="rgba(255, 255, 255, 0.8)",t._suggestionHighContrastIconColor="rgb(255, 255, 0)",t.nearbyTransitCategoryId="250",t}(ht),re=function(n){function i(){var t=n.call(this)||this;t.resources=r;t.defineProperty("linkTitle",null,function(n,i){return t._convertSaveMessage(n,i)});t.defineProperty("showLink",null,null,{defaultValue:!0});t.defineProperty("showChangeLink",function(n,i){t._onShowChangeLinkChanged(n,i)});t._baseTemplate='<div class="saveLink" data-tag="saveLink spaceBeforeLink" style:display="{TemplateBinding ShowLink Converter=displaySeeItLink}">{0}<\/div>';var e=r.L_SeeIt,s=r.L_SeeItWithChange,h="seeItLink"+(e.indexOf("<link>")!==0?" spaceBeforeLink":""),o=i._linkStart.replace("{0}",h),f=e.replace("<link>",o).replace("<\/link>",i._linkEnd),u=s.replace("<link>",o).replace("<\/link>",i._linkEnd);return u=u.replace("<changelink>",i._changeLinkStart).replace("{1}",r.L_Change).replace("<\/changelink>",i._linkEnd),f=f.replace("{0}",'<TextBlock Text="{TemplateBinding LinkTitle}" />'),u=u.replace("{0}",'<TextBlock Text="{TemplateBinding LinkTitle}" />'),t._templateString=t._baseTemplate.replace("{0}",f),t._templateStringWithChange=t._baseTemplate.replace("{0}",u),t._resetTemplate(t._templateString),t.popupLinkClicked=new p,t.popupChangeLinkClicked=new p,t}return a(i,n),i.prototype._resetTemplate=function(n){var t=this;this.setTemplate(new it(n,{onPopOutLinkClick:function(n){return t._popupLinkClicked(n)},onPopOutChangeLinkClick:function(n){return t._popupChangeLinkClicked(n)},displaySeeItLink:function(n){return t.displaySeeItLink(n)}}))},i.prototype._onShowChangeLinkChanged=function(n,t){t?this._resetTemplate(this._templateStringWithChange):this._resetTemplate(this._templateString)},i.prototype._popupLinkClicked=function(n){(n&&n.preventDefault&&n.preventDefault(),n.type!=="pointerup"||t(".mapContainer .MicrosoftMap").has(n.target))&&this.popupLinkClicked.invoke(n)},i.prototype._popupChangeLinkClicked=function(n){(n&&n.preventDefault&&n.preventDefault(),n.type!=="pointerup"||t(".mapContainer .MicrosoftMap").has(n.target))&&this.popupChangeLinkClicked.invoke(n)},i.prototype.displaySeeItLink=function(n){return n?"":"none"},i.prototype._convertSaveMessage=function(n){return n&&n.length>0||(n=r.L_Favorite_Text),n},i._linkStart='<a href="#" class="{0}" data-tag="seeItLink" event:click="onPopOutLinkClick" event:touchend="onPopOutLinkClick" role="link" aria-label="{TemplateBinding LinkTitle}">',i._changeLinkStart='<a href="#" class="seeItLink spaceBeforeLink" data-tag="changeContainerLink" event:click="onPopOutChangeLinkClick" event:touchend="onPopOutChangeLinkClick" role="link" aria-label="{TemplateBinding LinkTitle}">',i._linkEnd="<\/a>",i._linkText="",i}(dt);it.registerControl("PopUpMessageControl",re);var ue=function(n){function t(t,i,r,u,f,e,o,s){var h=n.call(this,t,o)||this;return h.setDropdownData(null,null,r,u,f,e,s,null,i),h}return a(t,n),t.prototype.setDropdownData=function(t,i,r,u,f,e,o,s,h){n.prototype.setDropdown.call(this,this._populateSaveListData(h,r,u,f,e,o))},t.prototype.onEntryClicked=function(n){if(!(n<0)&&!(n>=this.dropdownList.length)){var t=this.dropdownList[n].options,i;i=t.requestState?u.taskProcessDataHandlerKey:u.taskDataHandlerKey;f.invokeHandler(i,t)}},t.prototype._populateSaveListData=function(n,t,i,r,u,f){var w=this,l=[],e,a,c;if(!t||!i||!f)return l;e=t;e.getImageUrl()&&e.getImageUrl().length>0&&(a=e.getImageUrl());var p=d.getItineraryAddItemOptions(e.getTitle(),i,t.id,a,r,e.categoryId,e.interests,e.stayDuration),h=f.logData.data,v=h&&h.EP,b=function(){w.contextMenuFinished.invoke()},k=s.features.collections;return v===y.ContextMenu||o.enableOneClickSave||this._pushMostRecentlyUsedListEntries(l,p.requestState.itineraryItem,b,p,u,r,v),c=d.getMyPlacesTaskOptions(e.getTitle(),i,null,e.getAddress()),c.activateOptions={parentId:r},c.state.data.id=t.id,c.state.entryPoint=h&&(h.EP&&h.EP===y.LocalDetails||h.ID)?3:2,c.state.data.photoUrl=a,this._pushSaveToTempAction(l,c,u,v,!0),l},t}(ki),fe=function(n){function t(t,i,r){var u=n.call(this,i)||this;return u.setDropdownData(t,null,r),u}return a(t,n),t.prototype.setDropdownData=function(t,i,r){var c=this,h,l,f,e,u,o,s;if(i){for(h=[],l=function(n,t){if(t<c.dropdownList.length){var i=c.dropdownList[t].value;i&&window.open(i)}},e=0;e<i.length;e++){if(u=i[e],r){f={logData:{feature:r.logData.feature,action:r.logData.action,data:{}}};o=r.logData.data;for(s in o)o.hasOwnProperty(s)&&(f.logData.data[s]=o[s]);f.logData.data.Source=u.DisplayName}h.push({name:u.DisplayName,value:u.Url,handler:l,iconClass:u.DisplayName+" icon",instData:f})}n.prototype.setDropdown.call(this,h)}},t}(ht),ee=function(n){function t(t,i){var r=n.call(this,i)||this;return r.setDropdown(t),r.taskBarListDropDownTemplate=wu,r.shouldAllowFeedbackClick=!1,r}return a(t,n),t.prototype.boolTodisplay=function(n){return n?"inline-block":"none"},t.prototype.onEntryClicked=function(t){if(t>=0&&t<this.dropdownList.length){var i=this.dropdownList[t];i.cssClass!=="feedbackMenuLink"||this.shouldAllowFeedbackClick?n.prototype.onEntryClicked.call(this,t):i.mouseoverhandler.call(this,null,t)}},t.prototype.onEntryMouseover=function(n){var r=this,i;n>=0&&n<this.dropdownList.length&&(i=this.dropdownList[n],i.cssClass==="feedbackMenuLink"&&(window.clearTimeout(t._mouseOverDelayHandle),t._mouseOverDelayHandle=Microsoft.Maps.setTimeout(function(){i.mouseoverhandler.call(r,null,n)},t._mouseTimeout)))},t.prototype.onEntryMouseout=function(n){if(n>=0&&n<this.dropdownList.length){var i=this.dropdownList[n];i.mouseouthandler&&(window.clearTimeout(t._mouseOverDelayHandle),i.mouseouthandler.call(this,null,n))}},t._mouseTimeout=250,t}(ht),bt=function(n){function t(){var i=this,r;return t.instance?(t.instance.tryUpdateIsSignedIn(),t.instance):(r={},i=n.call(this,r)||this,r.defineProperty("isSignedIn",function(n,t){return i._onSignInStateChange(n,t)}),i.notifySignedInStarted=new p,i.notifySignedIn=new p,window.sj_evt&&sj_evt.bind("wl:auth",function(){i._updateIsSignedIn()}),o.enableAADAccountLinking&&o.useAADAccountForCollections&&window.sj_evt&&sj_evt.bind("aad:signedin",function(){i._updateIsSignedIn(!0)}),i._updateIsSignedIn(),t.instance=i,i)}return a(t,n),t.prototype.dispose=function(){n.prototype.dispose.call(this);t.instance=null},t.prototype.signIn=function(){typeof Identity!="undefined"&&Identity.popupAuthenticate&&(Identity.headerLoginMode=1,Identity.popupAuthenticate("WindowsLiveId"))},t.prototype.tryUpdateIsSignedIn=function(){var t,n,i;vi.getFunctionalTestHooksEnabled()||(t=this.getIsSignedIn(),n=!1,o.enableAADAccountLinking&&o.useAADAccountForCollections?n=!0:typeof Identity!="undefined"&&(i=Identity.wlProfile&&Identity.wlProfile(),n=i!==null),n!==t&&(this.setIsSignedIn(n),f.invokeHandler(u.instrumentationDataHandlerKey,{logData:{feature:"CX",action:"SI",data:{BSI:this.getIsSignedIn()}},isMapsAction:!0})))},t.prototype._onSignInStateChange=function(n,t){this.notifySignedInStarted.invoke();this.notifySignedIn.invoke(t)},t.prototype._updateIsSignedIn=function(n){if(n||o.enableAADAccountLinking&&o.useAADAccountForCollections)this.setIsSignedIn(!0),f.invokeHandler(u.instrumentationDataHandlerKey,{logData:{feature:"CX",action:"SI",data:{BSI:this.getIsSignedIn(),AADSignIn:!0}},isMapsAction:!0});else if(typeof Identity!="undefined"){var t=Identity.wlProfile&&Identity.wlProfile();this.setIsSignedIn(t!==null);f.invokeHandler(u.instrumentationDataHandlerKey,{logData:{feature:"CX",action:"SI",data:{BSI:this.getIsSignedIn()}},isMapsAction:!0})}},t.instance=null,t}(ct),oe=function(n){function t(){var t=n.call(this)||this;return t.signInStateHandler=new bt,t.resources=r,t.defineProperty("signInMessage",null,function(n,i){return t._convertSignInMessage(n,i)}),t._baseTemplate='<div class="signInControlTop" style:display="{TemplateBinding signInStateHandler.IsSignedIn Converter=displaySignInPopUpControl}"><div class="signInMessage">{0}<\/div>{1}<\/div>',t._templateString=t._baseTemplate.replace("{0}","").replace("{1}",""),t._resetTemplate(t._templateString),t.signInClicked=new p,t.signedIn=new p,t.signInStateHandler.notifySignedIn.add(function(n){n&&t.signedIn&&t.signedIn.invoke()}),t}return a(t,n),t.prototype.displaySignInPopUpControl=function(){return this.signInStateHandler.tryUpdateIsSignedIn(),this.signInStateHandler.getIsSignedIn()?"none":"block"},t.prototype._resetTemplate=function(n){var t=this;this.setTemplate(new it(n,{onSignInLinkClick:function(n){return t._onSignInLinkClick(n)},displaySignInPopUpControl:function(n){return t.displaySignInPopUpControl(n)}}))},t.prototype._onSignInLinkClick=function(n){f.invokeHandler(u.instrumentationDataHandlerKey,{logData:{feature:"CX",action:"SI",data:{SGNIN:"SigningIn"}},isMapsAction:!0});n.preventDefault();this.signInStateHandler.signIn();this.signInClicked.invoke(n);n&&n.preventDefault&&n.preventDefault()},t.prototype._convertSignInMessage=function(n){var i="",r="",u;if(n)switch(n.indexOf("<link>")){case-1:i=n;u=t._cardifiedSignInButton;r=u.replace("{0}",this.resources.L_SignInLink_Text);break;case 0:i=n.replace("<link>",t._linkStart).replace("<\/link>",t._linkEnd);break;default:i=n.replace("<link>",t._linkStartSpaceBefore).replace("<\/link>",t._linkEnd)}else i=t._linkStart.concat(this.resources.L_SignInLink_Text,t._linkEnd);return this._templateString=this._baseTemplate.replace("{0}",i).replace("{1}",r),this._resetTemplate(this._templateString),n},t._linkStart='<a href="#" class="signInLink" event:click="onSignInLinkClick" event:touchend="onSignInLinkClick" data-tag="signInLink">',t._linkStartSpaceBefore='<a href="#" class="signInLink spaceBeforeLink" event:click="onSignInLinkClick" event:touchend="onSignInLinkClick" data-tag="signInLink">',t._linkEnd="<\/a>",t._cardifiedSignInButton='<a href="#" class="signInButton secondaryButton" event:click="onSignInLinkClick" event:touchend="onSignInLinkClick" data-tag="signInLink">{0}<\/a>',t}(dt);it.registerControl("SignInPopUpControl",oe);var lr=function(){function n(){}return n.processResponse=function(n){var u=n&&n.inData&&n.inData.requestState&&n.inData.requestState,t=u&&u.action,i,r;if(n&&n.outData&&n.outData.length!==0){if(i=n.outData&&n.outData[0].data,i.notSignedIn)return 2;if(r=i.actionSucceeded,t===h.SetHome)return r?10:i.favorite?15:i.maxFavorites?16:9;if(t===h.SetWork)return r?12:i.favorite?15:i.maxFavorites?16:11;if(t===h.AddFavorite)return r?8:i.favorite?15:i.maxFavorites?16:7;if(t===h.AddToTemporaryCollection)return r?20:i.favorite?22:7;if(t===h.UpdateEntity)return r?25:7;if(t===h.AddEntity)return r&&i.collections?6:i.failureMessage?24:i.collections?17:3;if(i.collections.length===0){if(t===h.GetAllCollectionNamesAndIds)return 4;if(t===h.GetActiveTasks)return 13}else{if(t===h.GetAllCollectionNamesAndIds)return u.isMove?23:5;if(t===h.GetActiveTasks)return 13}}else return t&&t===h.GetActiveTasks?13:t&&t===h.AddToTemporaryCollection?21:1;return 1},n}(),ar=function(){function n(n){this._events=[];this._map=n;this._viewModelInitialized=!1;this.hideParent=new p;this.moveToNewCollection=new p}return n.prototype.setEntityData=function(n,t,i){this._entity=n;this._options=t;this._rootElement=i},n.prototype.setAddToRouteMode=function(n,t){this._directionsButton=n;this._addToRouteMode=t},n.prototype.setSaveButton=function(n){this._saveButton=n},n.prototype.getSaveButton=function(){return this._saveButton},n.prototype.processDirectionsData=function(n,t){this._showDirectionsPopOut(n.outData,t,n.inData.requestorState)},n.prototype.processCollectionsData=function(n,t){this._showCollectionsPopOut(n,t,n.inData.requestorState)},n.prototype.processTravelMoveToData=function(n,t){this._showTravelMoveToPopOut(n.outData,t,n.inData.requestorState)},n.prototype.processSaveWithTravelData=function(n,i){var u=i&&i.type==="mouseover",r;i&&i.currentTarget&&(this._saveButton=t(i.currentTarget));this.openItineraryTaskInfo=n.outData;r=n.inData.requestorState;o.enableOneClickSave&&r&&r.entryPoint!==y.ContextMenu?this._showItineraryPopout(n):r.isSignedIn?this.collectionMenuButtonClicked(i,r.location,r.instData,r.entryPoint):this._showSaveWithTravelPopOut(n.outData,r)},n.prototype.directionButtonClicked=function(n,i,r,e){n&&n.preventDefault();this._directionsButton=t(n.currentTarget);this._setAriaExpanded(this._directionsButton);var o={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.directionsTask,requestState:{action:0},requestorState:{location:i,instData:r,entryPoint:e},useActiveTasks:!0};f.invokeHandler(u.taskProcessDataHandlerKey,o)},n.prototype.scheduleContactTourButtonClicked=function(n,i,r){n&&n.preventDefault();this._scheduleContactButton=n&&t(n.target);this._setAriaExpanded(this._scheduleContactButton);this._showScheduleContactPopOut(i,r)},n.prototype.collectionButtonClicked=function(n,i,r,u){var f,e,s,c;if(n&&n.preventDefault(),n&&n.currentTarget&&(this._saveButton=t(n.currentTarget)),this._setAriaExpanded(this._saveButton),o.enableOneClickSave&&this._entity){this._oneClickSave(i,r,u,!1);return}f=this._entity;e={title:k.getDisplayName(f),address:f.getAddress&&f.getAddress(),location:i,id:k.getYpid(f)};this.entityNickName&&this.entityOriginalName&&(e.nickName=this.entityNickName,e.title=this.entityOriginalName);this.entityDescription&&(e.description=this.entityDescription);s=f.getImageUrl&&f.getImageUrl();s&&s.length&&(e.photoUrl=s);c=h.AddToTemporaryCollection;this._trySaveProcessCall(e,c,r,u,!0);this._logData(r)},n.prototype.collectionMenuButtonClicked=function(n,i,r,e,s){var l,a;n&&n.preventDefault();n&&n.currentTarget&&(this._saveButton=t(n.currentTarget));this._setAriaExpanded(this._saveButton);o.enableOneClickSave&&this._entity&&!s?this._oneClickSave(i,r,e,!0):(l={action:h.GetAllCollectionNamesAndIds},s&&(l.isMove=!0),a={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.collectionsTask,requestState:l,requestorState:{location:i,instData:r,entryPoint:e}},f.invokeHandler(u.taskProcessDataHandlerKey,a));this._logData(r)},n.prototype.travelMoveToButtonClicked=function(n,i,r,e){n&&n.preventDefault();this._travelButton=t(n.target);this._setAriaExpanded(this._travelButton);var o={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.itineraryDetailsTask,requestState:{action:2},requestorState:{location:i,instData:r,entryPoint:e},taskId:this._options.requestorId};f.invokeHandler(u.taskProcessDataHandlerKey,o)},n.prototype.saveWithTravelButtonClicked=function(n,i,r,e,s){if(n&&n.preventDefault(),this._saveButton=t(n.currentTarget),this._setAriaExpanded(this._saveButton),o.enableOneClickSave&&this._entity)this._oneClickSave(i,r,e,s);else{var h={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.itineraryDetailsTask,requestState:{action:0},requestorState:{location:i,instData:r,entryPoint:e,isSignedIn:s},useActiveTasks:!0};f.invokeHandler(u.taskProcessDataHandlerKey,h)}s||this._logData(r)},n.prototype.nearbyButtonClicked=function(n,i,r,u,f,e){var o=this,s,h,c;n&&n.preventDefault();this._nearbyButton=t(n.target);this._setAriaExpanded(this._nearbyButton);this._initializeViewModels(i);s=this._rootElement?this._rootElement:t("#transientLens");this._nearbyListDropdownViewModel?(this._nearbyListDropdownViewModel.setAddress(e),this._nearbyListDropdownViewModel.setButtonElement(this._nearbyButton),this._nearbyListDropdownViewModel.setDropdownData(r,i)):(this._nearbyListDropdownViewModel=new cr(r,i,this._nearbyButton,e),this._events.push(this._nearbyListDropdownViewModel.contextMenuFinished.add(function(){o._popOutButtonViewModel.setIsDisplayed(!1);o._nearbyListDropdownViewModel.isDisplayed=!1;o.hideParent.invoke()})));this._popOutButtonViewModel.setAriaLabel(null);this._popOutButtonViewModel.setDropdownClass("popOutTop");this._updatePopOutListDropdownViewModel(this._nearbyListDropdownViewModel);this._nearbyListDropdownViewModel.isDisplayed=!0;h=this._nearbyButton&&this._nearbyButton.length>0?this._nearbyButton[0].className:"";this._popOutButtonViewModel.setParentClass(h);this._nearbyButton.add_class("selected");c=s.select("div.nearbyPopOut");c.append(this._popOutElement);this._nearbyListDropdownViewModel.buildCategoryIcons(u,s,f);this._displayPopOut();this._popOutElement.select&&this._popOutElement.select(".popOutTop").set_attr("aria-hidden","false")},n.prototype.hidePopout=function(){this._popOutButtonViewModel&&this._popOutButtonViewModel.setIsDisplayed(!1)},n.prototype.dispose=function(){this._popOutButtonViewModel&&this._popOutButtonViewModel.dispose()},n.prototype._showDirectionsPopOut=function(n,i,e){var o=e.location,s,h,c;this._initializeViewModels(o);this._directionsListDropdownViewModel.setButtonElement(this._directionsButton);this._directionsListDropdownViewModel.setDropdownData(n,this._entity,o,e.instData);this._directionsListDropdownViewModel.dropdownList.length>1?(s=this._rootElement?this._rootElement:t("#transientLens"),h=s.select("div.directionsPopOut"),this._popOutButtonViewModel.setAriaLabel(r.L_DirectionsPopOutAriaLabel),this._popOutButtonViewModel.setDropdownClass("popOutTop"),c=this._directionsButton&&this._directionsButton.length>0?this._directionsButton[0].className:"",this._popOutButtonViewModel.setParentClass(c),this._updatePopOutListDropdownViewModel(this._directionsListDropdownViewModel),h.append(this._popOutElement),this._displayPopOut(),this._popOutElement.select&&this._popOutElement.select(".popOutTop").set_attr("aria-hidden","false")):(this.hideParent.invoke(),f.invokeHandler(u.taskDataHandlerKey,i))},n.prototype._showSaveWithTravelPopOut=function(n,i){var o=i.location,u,e,f,s;this._initializeViewModels(o);u=this._saveWithTravelDropdownViewModel;u.setButtonElement(this._saveButton);u.setDropdownData(null,null,this._entity,o,this._options.requestorId,this._options.requestorType,i.instData,null,n);u&&u.dropdownList.length>0?(e=this._rootElement?this._rootElement:t("#transientLens"),f=e.select("div.collectionsPopOut"),this._handleCollectionsPopoutLocation(f,e),this._popOutButtonViewModel.setAriaLabel(r.L_TravelPopOutAriaLabel),s=this._saveButton&&this._saveButton.length>0?this._saveButton[0].className:"",this._popOutButtonViewModel.setParentClass(s),this._popOutButtonViewModel.setDropdownClass("popOutTop listDropdown"),this._updatePopOutListDropdownViewModel(this._saveWithTravelDropdownViewModel),f.append(this._popOutElement),this._displayPopOut(),this._popOutElement.select&&this._popOutElement.select(".popOutTop").set_attr("aria-hidden","false"),this._setPopoutFocus(f)):this.hideParent.invoke()},n.prototype._showScheduleContactPopOut=function(n,i){var f,e,r,o,u,s,h;this._initializeViewModels(null);f=this._scheduleTourDropdownViewModel;f&&(f.setButtonElement(this._scheduleContactButton),f.setDropdownData(null,n,i));f&&f.dropdownList.length>0?(e=this._rootElement?this._rootElement:t("#transientLens"),r=e.select("div.scheduleContactPopOut"),(!r||r.length<1)&&(r=t(document.createElement("div")),r.add_class("bm_popout scheduleContactPopOut")),o="popOutTop listDropdown scheduleContact",u=this._scheduleContactButton&&this._scheduleContactButton.get_ancestor(3),u&&u.has_class("b_sgmbtns")?u.append(r):(this._handleCollectionsPopoutLocation(r,e,"House"),s=u&&u[0]&&u[0].childElementCount||3,o+=s===1?" leftScheduleContact":s===2?" middleScheduleContact":" rightScheduleContact"),this._popOutButtonViewModel.setAriaLabel("scheduleTourLabel"),h=this._scheduleContactButton&&this._scheduleContactButton.length>0?this._scheduleContactButton[0].className:"",this._popOutButtonViewModel.setParentClass(h),this._popOutButtonViewModel.setDropdownClass(o),this._updatePopOutListDropdownViewModel(this._scheduleTourDropdownViewModel),r.append(this._popOutElement),this._displayPopOut(),this._popOutElement.select&&this._popOutElement.select(".popOutTop").set_attr("aria-hidden","false"),this._setPopoutFocus(r)):this.hideParent.invoke()},n.prototype._handleCollectionsPopoutLocation=function(n,t,i){var u,r,f,e,o,s;(i===void 0&&(i=""),u=t.select(".b_subModule"),!u||u.length<1)||(r=null,i||(f=this._entity,e=f&&f.getSegmentTypes&&f.getSegmentTypes(),i=e&&e.length&&e[0]||f&&f.getSearchCategory&&f.getSearchCategory()),l._isHouseCategory(i))&&(o=u.select(".b_actionBtns"),s=u.select(".b_mapbtns"),s&&s.length>0&&o&&o.length>0?(n.add_class("houseCollectionsPopout"),o.insertBefore(n,s)):(r=u.select(">.b_mort"),r&&r.length!==0||(r=u.select(">.b_subscomp")),r&&r.length!==0||(r=u.select(">.b_lBottom.b_snippet")),r&&r.length!==0||(r=u.select(">.b_infoCardCustFacts")),r&&r.length!==0||(r=u.select(".infoCardIcons")),r&&r.length!==0||(r=u.select(".b_vList")),r&&r.length>0&&u.insertBefore(n,r)))},n.prototype._showTravelMoveToPopOut=function(n,i,u){var e=u.location,f,o,s,h;this._initializeViewModels(e);f=this._itineraryDaysDropdownViewModel;f&&f.setButtonElement(this._travelButton);f&&f.setDropdownData(n,this._entity,e,u.instData);f&&f.dropdownList.length>0?(o=this._rootElement?this._rootElement:t("#transientLens"),s=o.select("div.travelPopOut"),this._popOutButtonViewModel.setAriaLabel(r.L_TravelPopOutAriaLabel),h=this._travelButton&&this._travelButton.length>0?this._travelButton[0].className:"",this._popOutButtonViewModel.setParentClass(h),this._popOutButtonViewModel.setDropdownClass("popOutTop"),this._updatePopOutListDropdownViewModel(f),s.append(this._popOutElement),this._displayPopOut(),this._popOutElement.select&&this._popOutElement.select(".popOutTop").set_attr("aria-hidden","false")):this.hideParent.invoke()},n.prototype._showCollectionsPopOut=function(n,t,i){var o=lr.processResponse(n),u=i.location,f=i.instData,e=i.entryPoint,i;switch(o){case 2:this.showSignInMessage(i.location);break;case 1:case 4:case 5:case 23:this._showCollectionsList(n.outData[0].data,n.inData,t,u,f,o===23);break;case 3:this._showAddEntityMessage(!1,n.inData.requestState,n.inData.requestorState);break;case 24:this._showAddEntityMessage(!1,n.inData.requestState,n.inData.requestorState,n.outData[0].data);break;case 6:this._showAddEntityMessage(!0,n.inData.requestState,n.inData.requestorState,n.outData[0].data);break;case 7:this._showCollectionsMessage(r.L_AddFavoriteFailed,u,f,e);break;case 15:this._showCollectionsMessage(r.L_AddFavoriteExists_Text,u,f,e);break;case 22:this._showCollectionsMessage(r.L_AddTemporaryExists,u,f,e);break;case 16:this._showCollectionsMessage(r.L_TooManyFavorites,u,f,e);break;case 8:this._showAddFavoriteMessage(n.inData.requestState,n.inData.requestorState,n.outData[0].data);break;case 20:this._showAddTemporaryMessage(n.inData.requestState,n.inData.requestorState,n.outData[0].data);break;case 21:i=n.inData.requestorState;this._trySaveProcessCall(n.inData.requestState.data,h.AddToTemporaryCollection,i.instData,i.entryPoint);break;case 9:this._showCollectionsMessage(r.L_SetHomeFailed,u,f,e);break;case 10:this._showCollectionsMessage(r.L_SetHomeSucceeded,u,f,e);break;case 11:this._showCollectionsMessage(r.L_SetWorkFailed,u,f,e);break;case 12:this._showCollectionsMessage(r.L_SetWorkSucceeded,u,f,e);break;case 13:this._openCollection(n.inData.requestState,n.inData.requestorState,n.outData);break;case 25:this._showCollectionsMessage(r.L_EntityUpdateSucceeded,u,f,e);break;case 17:this._showAddEntityMessage(!0,n.inData.requestState,n.inData.requestorState,n.outData[0].data)}},n.prototype.showSignInMessage=function(n,i){var u,f,e;this._initializeViewModels(n);u=this._rootElement?this._rootElement:t("#transientLens");f=u.select("div.collectionsPopOut");this._collectionsPopOutMessageViewModel.title=i?r.L_SignInRequiredItinerary:r.L_SignInRequired;this._collectionsPopOutMessageViewModel.linkTitle=null;this._collectionsPopOutMessageViewModel.linkData=null;this._collectionsPopOutMessageViewModel.setButtonElement(this._saveButton);this._popOutButtonViewModel.setPopOutTemplate(this._signInControlTemplate);e=this._travelButton&&this._travelButton.length>0?this._travelButton[0].className:"";this._popOutButtonViewModel.setParentClass(e);this._saveButton.add_class("selected");this._popOutButtonViewModel.setPopOut(this._collectionsPopOutMessageViewModel);f.append(this._popOutElement);this._displayPopOut()},n.prototype._showAddEntityMessage=function(n,t,i,u){var f={action:o.enableOneClickSave?h.ViewCollection:h.GetActiveTasks,collectionId:t.collectionId,data:t.data,entityId:u&&u.entityId||this._getEntityIdFromCollection(u,t.collectionId,t.data.id)},e="",s="",l,a;n?(t.collectionId&&(e=f.entityId?r.L_SavedCollection.replace("{0}",t.data.title):r.L_EntityPreviouslySaved.replace("{0}",t.data.title)),s=i.title,o.enableOneClickSave?a={type:c.collectionsTask,state:f}:l={type:c.collectionsTask,requestorType:this._options.requestorType,requestorId:this._options.requestorId,requestState:f,requestorState:i,useActiveTasks:!0}):e=u?u.failureMessage:r.L_SaveFailed.replace("{0}",i.title).replace("{1}",t.data.title);this._showCollectionsMessage(e,i.location,i.instData,i.entryPoint,s,null,l,a)},n.prototype._showAddTemporaryMessage=function(n,t,i){var u={action:o.enableOneClickSave?h.ShowTemporaryCollection:h.GetActiveTasks,data:n.data,entityId:i&&i.entityId,collectionId:i&&i.collections&&i.collections.length&&i.collections[0].id},f="",l=r.L_AddTemporaryCollectionTitle,e,s;i&&i.entityId&&(f=r.L_AddFavoriteSucceeded.replace("{0}",n.data.title),o.enableOneClickSave?s={type:c.collectionsTask,state:u}:e={type:c.collectionsTask,requestorId:this._options.requestorId,requestorType:this._options.requestorType,requestState:u,requestorState:t,useActiveTasks:!0});this._showCollectionsMessage(f,t.location,t.instData,t.entryPoint,l,null,e,s,!0)},n.prototype._showAddFavoriteMessage=function(n,t,i){var u={action:o.enableOneClickSave?h.ViewFavorites:h.GetActiveTasks,data:n.data,entityId:i&&i.entityId},f="",e,s;i.entityId&&(f=r.L_AddFavoriteSucceeded.replace("{0}",n.data.title),o.enableOneClickSave?s={type:c.collectionsTask,state:u}:e={type:c.collectionsTask,requestorType:this._options.requestorType,requestorId:this._options.requestorId,requestState:u,requestorState:t,useActiveTasks:!0});this._showCollectionsMessage(f,t.location,t.instData,t.entryPoint,"",null,e,s)},n.prototype._showCollectionsMessage=function(n,i,e,s,l,a,v,p,w){var b=this,k,g,tt,d,nt;this._initializeViewModels(null);k=this._rootElement?this._rootElement:t("#transientLens");g=k.select("div.collectionsPopOut");this._handleCollectionsPopoutLocation(g,k);this._collectionsPopOutMessageViewModel.setParentClass(k[0].className);this._collectionsPopOutMessageViewModel.title=n;this._collectionsPopOutMessageViewModel.linkTitle=l||"";this._collectionsPopOutMessageViewModel.editButtonTitle=r.L_EditFavorite_Text;this._collectionsPopOutMessageViewModel.closeButtonTitle=r.L_Dlg_Close;this._collectionsPopOutMessageViewModel.saveButtonTitle=r.L_SaveUpdateButton;this._collectionsPopOutMessageViewModel.updateNicknameMessage=r.L_UpdateNicknameMessage;this._collectionsPopOutMessageViewModel.linkData=a;this._collectionsPopOutMessageViewModel.processOptions=v;this._collectionsPopOutMessageViewModel.activateOptions=p;this._collectionsPopOutMessageViewModel.isTempCollectionMessage=w;this._collectionsPopOutMessageViewModel.setShowLink(a||v||p?!0:!1);this._collectionsPopOutMessageViewModel.saveNicknameClicked=!1;v&&v.requestState?(d=v.requestState,this._collectionsPopOutMessageViewModel.entityId=d.entityId,tt=d.data&&d.data.nickName):p&&(this._collectionsPopOutMessageViewModel.requestorId=this._options.requestorId,this._collectionsPopOutMessageViewModel.requestorType=this._options.requestorType,this._collectionsPopOutMessageViewModel.entityId=p.state.entityId);this._collectionsPopOutMessageViewModel.showFooter=this._collectionsPopOutMessageViewModel.entityId&&this._collectionsPopOutMessageViewModel.entityId.length>0?"":"none";this._collectionsPopOutMessageViewModel.setButtonElement(this._saveButton);o.enableOneClickSave?(nt=new bt,nt.getIsSignedIn()&&(this._collectionTaskState=(v===null||v===void 0?void 0:v.requestState)||(p===null||p===void 0?void 0:p.state),this._linkTaskOptions=a,this._collectionPopoutChangeRegistered||(this._collectionPopoutChangeRegistered=!0,this._collectionsPopOutMessageViewModel.popOutChangeLinkClicked.add(function(){var n,t,r;if(b._collectionTaskState)t={action:h.GetAllCollectionNamesAndIds,removeEntityAndPerformAction:!0,removeEntityFromCollectionId:b._collectionTaskState.collectionId,entityId:b._collectionTaskState.entityId};else if(((n=b._itineraryTaskState)===null||n===void 0?void 0:n.itineraryItem)&&b._linkTaskOptions)t={action:h.GetAllCollectionNamesAndIds,removeEntityFromItinerary:!0,removeEntityFromItineraryDetailsTaskId:b._linkTaskOptions.id,removeEntityFromCollectionId:b._itineraryTaskState.itineraryCollectionId,entityId:b._itineraryTaskState.itineraryItem.Id};else return;r={requestorType:b._options.requestorType,requestorId:b._options.requestorId,type:c.collectionsTask,requestState:t,requestorState:{location:i,instData:e,entryPoint:s}};f.invokeHandler(u.taskProcessDataHandlerKey,r)}))),(!s||s!==y.ContextMenu&&s!==y.Infobox)&&(v||p||a)&&nt.getIsSignedIn()?this._collectionsPopOutMessageViewModel.setShowChangeLink(!0):this._collectionsPopOutMessageViewModel.setShowChangeLink(!1)):this._collectionsPopOutMessageViewModel.setShowChangeLink(!1);this._popOutButtonViewModel.setTemplateToPopOutMessage();this._popOutButtonViewModel.setPopOut(null);this._popOutButtonViewModel.setPopOut(this._collectionsPopOutMessageViewModel);g.append(this._popOutElement);this._displayPopOut()},n.prototype._showCollectionsList=function(n,i,e,o,s,h){var c=this,l;this._initializeViewModels(o);l=function(){var i,n,o;c._collectionsListDropdownViewModel.dropdownList.length>1?(i=c._rootElement?c._rootElement:t("#transientLens"),n=i.select("div.collectionsPopOut"),c._popOutButtonViewModel.setAriaLabel(r.L_CollectionsPopOutAriaLabel),o=c._travelButton&&c._travelButton.length>0?c._travelButton[0].className:"",c._popOutButtonViewModel.setParentClass(o),c._popOutButtonViewModel.setDropdownClass("popOutTop listDropdown"),c._updatePopOutListDropdownViewModel(c._collectionsListDropdownViewModel),n.append(c._popOutElement),c._displayPopOut(),c._popOutElement.select&&c._popOutElement.select(".popOutTop").set_attr("aria-hidden","false"),c._setPopoutFocus(n)):f.invokeHandler(u.taskDataHandlerKey,e)};this._updateCollectionsListViewModel(n,i,o,s,l,h)},n.prototype._openCollection=function(n,t,i){var e=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,s=i&&i.length&&i[0].data,l=s&&s.taskId,r=n.collectionId?h.ViewCollection:h.ViewFavorites,a,v;o.enableOneClickSave&&(r=e&&e.Utilities&&e.Utilities.isDefaultCollectionId(n.collectionId)?h.ViewFavorites:h.ViewCollection);this._collectionsPopOutMessageViewModel.isTempCollectionMessage&&(r=h.ShowTemporaryCollection);a=n.collectionId?{action:r,collectionId:n.collectionId,entryPoint:2}:{action:r,entityId:n.entityId,entryPoint:2};v={action:l?"focus":"activate",id:l,type:c.collectionsTask,state:a};f.invokeHandler(u.taskDataHandlerKey,v)},n.prototype._updatePopOutListDropdownViewModel=function(n){this._popOutButtonViewModel.setDropdown(n)},n.prototype._displayPopOut=function(){var n=this;Microsoft.Maps.setTimeout(function(){n._popOutButtonViewModel.setIsDisplayed(!0);n._popOutElement.length>0&&l._setFocusOnFirstMenuItem(n._popOutElement)},20)},n.prototype._initializeViewModels=function(n){var i=this;this._viewModelInitialized||(this._directionsListDropdownViewModel=new or(null,this._entity,n,this._directionsButton,null,this._addToRouteMode),this._scheduleTourDropdownViewModel=new fe(null,this._scheduleContactButton,null),this._entity&&(this._saveWithTravelDropdownViewModel=new ue(this._map,null,this._entity,n,this._options.requestorId,this._options.requestorType,this._saveButton,null),this._collectionsListDropdownViewModel=new ki(this._map,this._saveButton,!1,this.entityNickName,this.entityOriginalName,this.entityDescription),this._collectionsListDropdownViewModel.setDropdownData(null,null,this._entity,n,this._options.requestorId,this._options.requestorType,null,function(){},this.openItineraryTaskInfo),this._events.push(this._collectionsListDropdownViewModel.newCollectionCreated.add(function(){i.hideParent.invoke();i._collectionsListDropdownViewModel.isMoveToMenu&&i.moveToNewCollection.invoke()})),this._events.push(this._collectionsListDropdownViewModel.contextMenuFinished.add(function(){i.hideParent.invoke()})),this.isItineraryContextMenu&&(this._itineraryDaysDropdownViewModel=new hr(null,this._entity,n,this._travelButton,null))),this._collectionsPopOutMessageViewModel=new bi(r.L_SignInRequired,null,null,this._saveButton,this._map.getContainer()),this._signInControlTemplate=new it(pu,{onPopOutLinkClick:function(n){return i._popOutButtonViewModel.onPopOutLinkClicked(n)},onSignedIn:function(){return i._saveButton.fireEvent("click")}}),this._popOutButtonViewModel=new di(this._directionsListDropdownViewModel,this._collectionsPopOutMessageViewModel),this._events.push(this._popOutButtonViewModel.popOutHidden.add(function(){i._directionsListDropdownViewModel!==null&&i._directionsListDropdownViewModel.dropdownList.length>1?(i.hideParent.invoke(),i._directionsButton&&i._directionsButton.get_attr("aria-expanded")!==undefined&&i._directionsButton.set_attr("aria-expanded","false")):i._popOutButtonViewModel.isPopOutInListMode()||i._popOutButtonViewModel.getPopOutTemplate()===i._signInControlTemplate||i._collectionsPopOutMessageViewModel.isTempCollectionMessage&&i._collectionsPopOutMessageViewModel.saveNicknameClicked?i._popOutButtonViewModel.isPopOutInListMode()&&i._nearbyListDropdownViewModel&&i._nearbyListDropdownViewModel.isDisplayed&&i.hideParent.invoke():(i.hideParent.invoke(),i._saveButton&&i._saveButton.get_attr("aria-expanded")!==undefined&&i._saveButton.set_attr("aria-expanded","false"));i._popOutElement.select&&i._popOutElement.select(".popOutTop").set_attr("aria-hidden","true")})),this._popOutElement=this._popOutButtonViewModel.buildPopOut(),this._popOutElement.getRootElement&&(this._popOutElement=t(this._popOutElement.getRootElement())),this._viewModelInitialized=!0)},n.prototype._updateCollectionsListViewModel=function(n,t,i,r,u,f){typeof f=="boolean"&&(this._collectionsListDropdownViewModel.isMoveToMenu=f);this.entityNickName&&(this._collectionsListDropdownViewModel.entityNickName=this.entityNickName);this.entityOriginalName&&(this._collectionsListDropdownViewModel.entityOriginalName=this.entityOriginalName);this.entityDescription&&(this._collectionsListDropdownViewModel.entityDescription=this.entityDescription);this._collectionsListDropdownViewModel.setButtonElement(this._saveButton);this._collectionsListDropdownViewModel.popOutRoot=this._popOutElement;this._collectionsListDropdownViewModel.setDropdownData(n,t,this._entity,i,this._options.requestorId,this._options.requestorType,r,u,this.openItineraryTaskInfo)},n.prototype._logData=function(n){f.invokeHandler(u.instrumentationDataHandlerKey,n)},n.prototype._trySaveProcessCall=function(n,t,i,r,e){var o={requestorType:this._options?this._options.requestorType:null,requestorId:this._options?this._options.requestorId:null,type:c.collectionsTask,requestState:{action:t,data:n},requestorState:{location:location,instData:i,entryPoint:r}};e&&(o.useActiveTasks=!0);f.invokeHandler(u.taskProcessDataHandlerKey,o)},n.prototype._setPopoutFocus=function(n){Microsoft.Maps.setTimeout(function(){l._setFocusOnFirstMenuItem(n)},100)},n.prototype._setAriaExpanded=function(n){n&&n.length>0&&n.get_attr("aria-expanded")!==undefined&&n.get_attr("aria-expanded")!==""&&n.set_attr("aria-expanded","true")},n.prototype._oneClickSave=function(n,t,i,r){var s,c,e,o;this._initializeViewModels(n);this._entity instanceof vt?(s=this._entity.id,c=this._entity.getImageUrl()):(s=k.getYpid(this._entity),c=this._entity.imageUrl);e=d.getMyPlacesTaskOptions(k.getDisplayName(this._entity),n,this.entityDescription,this._entity.getAddress&&this._entity.getAddress(),c,this._entity.getSelectedCategoryForIcon&&this._entity.getSelectedCategoryForIcon(),s,this._entity.addressFields,this._entity.metadataString,this._entity.mainSegmentType);e.activateOptions={parentId:this._options.requestorId};this.entityNickName&&this.entityOriginalName&&(e.state.data.nickName=this.entityNickName,e.state.data.title=this.entityOriginalName);o=this._getMostRecentlyUsedOption(n,t,i,e,r);o||(o={type:e.type,requestorId:this._options.requestorId,requestorType:this._options.requestorType,requestState:{action:r?h.AddFavorite:h.AddToTemporaryCollection,data:e.state.data},requestorState:{location:n,instData:t,entryPoint:i,isSignedIn:r},processCallback:this._options.processCallback});f.invokeHandler(u.taskProcessDataHandlerKey,o)},n.prototype._getMostRecentlyUsedOption=function(n,t,i,r,u){var f=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,c=f.MostRecentlyUsedList&&f.MostRecentlyUsedList.instance,h,s,e;if(c.getLength()>0)for(h=c.getList(),s=0;s<h.length;s++){if(e=h[s],e.IsItinerary)return this._getRecentItineraryProcessOptions(n,t,i,e,u);if(!o.useJsonApiForFavorites||!f||!f.Utilities||!f.Utilities.isKeyPlacesCollectionId(e.Collection.id))return this._getCollectionProcessOptions(n,t,i,u,e,r)}return null},n.prototype._getRecentItineraryProcessOptions=function(n,t,i,r,u){var f,e,o=d.getItineraryItemFromSearchEntity(this._entity,n);return{type:c.itineraryDetailsTask,requestorId:this._options.requestorId,requestorType:this._options.requestorType,taskId:r.TaskId,requestState:{action:r.TaskId?1:5,itineraryItem:o,itineraryCollectionId:(f=r.Itinerary)===null||f===void 0?void 0:f.collectionId,title:r.TaskTitle?r.TaskTitle:(e=r.Itinerary)===null||e===void 0?void 0:e.getName()},requestorState:{location:n,instData:t,entryPoint:i,isSignedIn:u},processCallback:this._options.processCallback}},n.prototype._getCollectionProcessOptions=function(n,t,i,r,u,f){var e=u.Collection,o=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,s;return s=r?o&&o.Utilities&&o.Utilities.isDefaultCollectionId(e.id)?h.AddFavorite:h.AddEntity:h.AddToTemporaryCollection,{type:c.collectionsTask,requestorId:this._options.requestorId,requestorType:this._options.requestorType,requestState:{action:s,data:f.state.data,collectionId:e.id},requestorState:{title:e.name,location:n,instData:t,entryPoint:i,isSignedIn:r},processCallback:this._options.processCallback}},n.prototype._showItineraryPopout=function(n){var u={action:7},o=r.L_SavedCollection.replace("{0}",this._entity.getTitle()),s=n.inData.requestState.title,i=n.outData&&n.outData.length>0?n.outData[0].processorId:null,f=n.outData&&n.outData.length>0&&n.outData[0].data?n.outData[0].data.collectionId:null,e,t;i||(u.itineraryCollectionId=f);e={type:c.itineraryDetailsTask,action:i?"focus":"activate",id:i,state:u};t=n.inData.requestorState;this._itineraryTaskState=n.inData.requestState;this._itineraryTaskState.itineraryCollectionId=f;this._showCollectionsMessage(o,t.location,t.instData,t.entryPoint,s,e)},n.prototype._getEntityIdFromCollection=function(n,t,i){var s,h,u,f,e,r;if(!o.enableOneClickSave||!n||!n.collections||n.collections.length==0||!t||!i)return null;for(u=0;u<n.collections.length;u++)if(f=n.collections[u],f.id===t)for(e=0;e<f.primitives.length;e++)if(r=f.primitives[e],((s=r===null||r===void 0?void 0:r.entity)===null||s===void 0?void 0:s.id)===i||((h=r===null||r===void 0?void 0:r.entity)===null||h===void 0?void 0:h.businesslistingid)===i)return r.entity.id},n}(),fi=function(n){function t(t,i,r,u,f,e){var o=n.call(this,t,i,null,null,null,f)||this;return o._taskDisplayState=r,o._menuUrl=u,o.isRecommendationEntity=!1,o.categoryId=e,o}return a(t,n),t.prototype.getDirectionTaskOptions=function(n,t){var i=this.getDescription()||this.getTitle();return d.getDirectionTaskOptions(i,n,t,this.getTitle(),this.id,null)},t.prototype.getTaskDisplayState=function(){return this._taskDisplayState},t.prototype.getMenuUrl=function(){return this._menuUrl},t.prototype.setSegmentTypes=function(n){this._segmentTypes=n},t.prototype.getSegmentTypes=function(){return this._segmentTypes},t.prototype.getPrimaryCategoryName=function(){return this._primaryCategoryName},t.prototype.setPrimaryCategoryName=function(n){this._primaryCategoryName=n},t}(nr),n;(function(n){n[n.Search=1]="Search";n[n.Directions=2]="Directions";n[n.Streetside=3]="Streetside";n[n.Zoom=5]="Zoom";n[n.Menu=6]="Menu";n[n.DirectionsTo=7]="DirectionsTo";n[n.DirectionsFrom=8]="DirectionsFrom";n[n.AddToRoute=9]="AddToRoute";n[n.OpenNewCard=11]="OpenNewCard";n[n.Nearby=12]="Nearby";n[n.Coordinates=13]="Coordinates";n[n.SaveWithTempCollection=14]="SaveWithTempCollection";n[n.MoveTo=15]="MoveTo";n[n.Measure=16]="Measure";n[n.editName=17]="editName";n[n.editDescription=18]="editDescription";n[n.deleteName=19]="deleteName";n[n.deleteDescription=20]="deleteDescription";n[n.editHomeWork=21]="editHomeWork";n[n.BirdseyeV2=22]="BirdseyeV2";n[n.hideHomeWork=23]="hideHomeWork";n[n.addToItinerary=24]="addToItinerary";n[n.moveToAnotherDay=25]="moveToAnotherDay";n[n.saveToRecent=26]="saveToRecent";n[n.Remove=27]="Remove";n[n.Edit=28]="Edit"})(n||(n={}));var et=function(){function e(i,r,u,f){var e=this,h,c;this._events=[];this._map=i;this._isRtl=l._isRtl();this._reverseGeocoder=r;h={templateText:ku,staticResources:{clickHandler:function(n){return e.clickHandler(n)},keydownHandler:function(n){return e.keydownHandler(n)},boolToDisplay:function(n){return e.boolToDisplay(n)}}};this._controlTemplate=u(h);this._events.push(this._map.viewChanged.add(function(){return e.hide()}));this._events.push(this._map.mapTapped.add(function(){return e.hide()}));this._events.push(this._map.mapZoomStarted.add(function(){return e.hide()}));this._events.push(this._map.primitiveTapped.add(function(){return e.hide()}));this._streetsideBubbleInfo=null;this.signInStateHandler=new bt;this._buttonGroupViewModel=f;this._hideTransientLensClickHandler=function(n){return e._onClick(n)};t(window).add_event("click,touchend",this._hideTransientLensClickHandler);this._hideTransientLensKeyDownHandler=function(n){return e._onKeyDown(n)};t(window).add_event("keydown",this._hideTransientLensKeyDownHandler);this.actionList=[];this.actionList.push(n.DirectionsTo);this.actionList.push(n.DirectionsFrom);this.actionList.push(n.AddToRoute);this.actionList.push(n.Search);c=i.getContainer();c.instanceAsync("MostRecentlyUsedList",function(n){e._mostRecentlyUsedList=n});hi&&hi.isEnabled&&this.actionList.push(n.Streetside);l._isFeatureEnabled("birdseyeV2UI")&&!this._map.getMapOptions().disableBirdseye&&this._map.getMapTypes()[g.birdseyeV2]&&this.actionList.push(n.BirdseyeV2);o&&o.isEnabled&&!s.isInPrivateMode&&this.actionList.push(n.SaveWithTempCollection);this.actionList.push(n.Remove);this.actionList.push(n.Zoom);o&&o.isEnabled&&this.actionList.push(n.Measure);nt&&nt.contextMenuNearbyCategories.length>0&&this.actionList.push(n.Nearby);this.actionList.push(n.Coordinates);this.invalidateLayer=new p;this.moveToNewCollection=new p;this._events.push(this._buttonGroupViewModel.hideParent.add(function(){return e.hide()}));this._events.push(this._buttonGroupViewModel.moveToNewCollection.add(function(){return e.moveToNewCollection.invoke()}));this._vectorImage=this._getVectorImage();this._ignoreHideEventOnce=!1;this._isDirectionsPopOutVisible=!1;this._isCollectionsPopOutVisible=!1;this._isTravelPopOutVisible=!1;this._isNearbyPopOutVisible=!1;this._populateNearbyCategories();this._adjustmentValueForTop=0;this._secondaryMenuOpen=!1}return e.prototype.selectorReady=function(){var n=this;return this._templateSelector?this._templateSelector.selectorReady():this._map.getTemplateSelector().then(function(t){return n._templateSelector=t,n._templateSelector.selectorReady()})},e.prototype.getPrimitive=function(){return this._primitive},e.prototype.getActionList=function(){var t=[];return this.actionList.forEach(function(i){t.push(n[i])}),t},e.prototype.getButtonGroupViewModel=function(){return this._buttonGroupViewModel},e.prototype.setOptions=function(n){this._options=n},e.prototype.processDirectionsData=function(n){var u,r,t,i;if(this._primitive){if(this._directionsProcessed=!0,this._directionsListCount=0,u=null,n.outData&&n.outData.length>0){for(r=0,t=0;t<n.outData.length;t++)i=n.outData[t].data,i&&!i.longDistanceIntent&&(i.routeTitle&&i.mode!==gt.transit&&(u||(u=n.outData[t].processorId),r++),i.activationState===1&&(this._activeDirectionTaskId=n.outData[t].processorId));r>0&&(this._directionsProcessData=n,this._directionsListCount=r,r===1&&(this._addToRouteDirectionTaskId=u))}this.updateTransientLens(n.inData)}},e.prototype.processTravelData=function(n){this._travelProcessed=!0;this._travelProcessData=n;this.updateTransientLens(n.inData)},e.prototype.updateTransientLens=function(t){var e=this,r,u,f;this._directionsProcessed&&(!tt||!tt.isEditable||this._travelProcessed)&&(this._directionsProcessed=!1,this._travelProcessed=!1,r=t.requestorState.location,this._populateActions(r),hi&&hi.isEnabled&&this._map.getContainer().instanceAsync("StreetsideMiniBootstrapper",function(n){n.isAvailable(r,function(n){return e._isStreetsideAvailable(n,r)})}),this._map.getMapType().id!==g.birdseyeV2&&this.actionList&&this.actionList.indexOf(n.BirdseyeV2)>=0&&(u=void 0,f=this._map.getView(),f&&f.cameraLocation&&(u=r.clone(),u.altitude=f.cameraLocation.altitude),i.BirdseyeV2Manager.getIsBirdseyeV2Available(this._map.getConfig(),u||r,null,function(n){e._isBirdseyeV2Available(n)},this._map.getViewport())),this.showOverlay(),this._updateOverlayPosition(t.requestorState.args,t.requestorState.preventInvalidate),this._updateEntityData())},e.prototype.showOverlay=function(){var n={overlayTemplate:this._controlTemplate,overlayEvent:0};ti.hideOverlay(this._map,this._sourcePrimitive);ti.showOverlay(this._map,n,this._primitive)},e.prototype.processCollectionsData=function(n){var t=null,i=n&&n.inData&&n.inData.requestState&&n.inData.requestState,r=i&&i.action;this._primitive&&this._primitive.entity?(t=this._primitive.entity.getMyPlacesTaskOptions(n.inData.requestorState.location),t.state.data.id=this._primitive.entity.id):i.data&&(t=d.getMyPlacesTaskOptions(n.inData.requestState.data.title,n.inData.requestorState.location),t.state.action=n.inData.requestState.action,t.state.data.id=n.inData.requestState.collectionId);t&&(t.activateOptions={parentId:this._options.requestorId});this._buttonGroupViewModel.processCollectionsData(n,t)},e.prototype.show=function(n,t){n&&n.preventDefault&&n.preventDefault();e._parentElement=n&&n.item?n.item:null;this._ignoreHideEventOnce=!1;this._isDirectionsPopOutVisible=!1;this._isCollectionsPopOutVisible=!1;this._isTravelPopOutVisible=!1;this._isNearbyPopOutVisible=!1;this.populatePrimitive(n);this._update(n,t);this.initializeCollections();this._setFocusOnFirstElement();t||this.invalidateLayer.invoke()},e.prototype.hide=function(){if(this._ignoreHideEventOnce){this._ignoreHideEventOnce=!1;return}if(this._secondaryMenuOpen){this._secondaryMenuOpen=!1;return}this._primitive&&(window.clearTimeout(e._mouseoverDelayHandle),window.clearTimeout(e._copyToClipboardHandle),window.clearTimeout(e._focusDelayHandle),ti.hideOverlay(this._map,this._primitive),this._reset())},e.prototype.dispose=function(){this._primitive&&this.hide();for(var n=this._events.length-1;n>=0;n--)this._events[n].dispose();this._events=[];t(window).remove_event("click,touchend",this._hideTransientLensClickHandler);t(window).remove_event("keydown",this._hideTransientLensKeyDownHandler);this._categories=[];this._buttonGroupViewModel.dispose()},e.prototype.clickHandler=function(n){n&&n.stopPropagation()},e.prototype.keydownHandler=function(n){var t=n;t.keyCode&&t.keyCode!==13?this._onKeyDown(n):this.clickHandler(n)},e.prototype.boolToDisplay=function(n){return n?"":"none"},e.prototype.populatePrimitive=function(n){var h=this,e,u,r;this._primitive&&this._cleanup();var f=n.location,t=n.primitive,o="",i="";t&&t.geometryType===1&&(e=t.crs,u=t.geometry,f=new wt(e.toLatitude(u.x,u.y),e.toLongitude(u.x,u.y)),o=k.getDisplayName(t.entity),i=k.getYpid(t.entity),!i&&n.primitive.entity.getBusinesslistingid?i=n.primitive.entity.getBusinesslistingid():!i&&t.entity.id&&(i=t.entity.id),this._sourcePrimitive=t);r=new nr(o,"",null);i&&(r.id=i);t&&t.entity&&(r.interests=t.entity.interests,r.stayDuration=t.entity.stayDuration);r.collisionBehavior=2;this._primitive=new si(f,r,this._vectorImage);this._primitive.bucket=null;this.updateMapQuadrant(this._map,f,n);this._reverseGeocoder&&!s.disableReverseGeocode&&(this._reverseGeocodingRequestId=this._reverseGeocoder.reverseGeocodeWithNetworkId(f,function(n){return h._processGeocodeResponse(n)}))},e.prototype._cleanup=function(){this._primitive.entity.dispose()},e.prototype._update=function(n,t){this._primitive.mapTypeClass=e._getMapTypeClass(this._map,this._mapQuadrant);this._getDirectionsProcessData(n,t);tt&&tt.isEditable&&this._getTravelProcessData(n,t)},e.prototype._updateEntityData=function(){var n=t("#transientLens");this._buttonGroupViewModel.setEntityData(this._primitive.entity,this._options);this._buttonGroupViewModel.setAddToRouteMode(n.select(".directionsAddToRoute"),!0)},e.prototype._buildDirectionsAction=function(t,i,r,u){if(this.actionList.indexOf(i)!==-1){var f=this._primitive.entity,e={AN:n[i],CP:t,ID:f.id,EP:y.ContextMenu},o=this._buildLogData("C",e);return this._buildActionEventHandlers(t,i,o,r,u)}return null},e.prototype._buildTravelMoveToAction=function(t,i){if(this.actionList.indexOf(i)!==-1){var r=this._primitive.entity,u={AN:n[i],CP:t,ID:r.id,EP:y.ContextMenu},f=this._buildLogData("C",u),e=w.L_OverlayEntity_MoveToDay;return this._buildActionEventHandlers(t,i,f,e,"addToItinerary moveTo")}return null},e.prototype._buildAddToItineraryAction=function(t,i,r){if(this.actionList.indexOf(i)!==-1){var u=this._primitive.entity,f={AN:n[i],CP:t,ID:u.id,EP:y.ContextMenu},e=this._buildLogData("C",f),o=r.data.title,s=r.processorId,h=w.L_OverlayEntity_AddToItineraries.replace("{0}",o);return this._buildActionEventHandlers(t,i,e,h,"addToItinerary",s)}return null},e.prototype._buildSaveToRecentAction=function(t,i,r){var f,e=window.$MicrosoftMaps8&&window.$MicrosoftMaps8.CloudGraphDataManager,h,c,v,p;if(o.useJsonApiForFavorites&&e&&e.Utilities&&!r.IsItinerary&&e.Utilities.isDefaultCollectionId((f=r.Collection)===null||f===void 0?void 0:f.id))return null;if(this.actionList.indexOf(i)!==-1){var w=this._primitive.entity,b={AN:n[i],CP:t,ID:w.id,EP:y.ContextMenu},l="",u="",s="",a=!1;return r.IsItinerary?(a=!0,r.IsOpenTask?(u=r.TaskTitle,l=r.TaskId):(h=r.Itinerary,u=h.getName(),s=h.collectionId)):(c=r.Collection,u=c.name,s=c.id),v=this._buildLogData("C",b),p=this._buildActionEventHandlers(t,i,v,u,"saveToRecent",l,s,a),p}return null},e.prototype._buildLocalSearchAction=function(t){return s.disableReverseGeocode?null:(this._primitive&&this._primitive.entity&&this._primitive.entity.isRecommendationEntity)?null:this._buildBasicActions(t,n.Search)},e.prototype.buildLocalDetailAction=function(){return null},e.prototype.buildNearbyAction=function(t){if(this.actionList.indexOf(n.Nearby)!==-1)return this._buildActionEventHandlers(t,n.Nearby,null)},e.prototype._isCardInFocus=function(){return!1},e.prototype.buildStreetsideAction=function(t){var i=this._buildBasicActions(t,n.Streetside);return i&&(this._streetsideBubbleInfo=null),i},e.prototype._buildBasicActions=function(t,i){if(this.actionList.indexOf(i)!==-1){var r=this._buildLogData("C",{AN:n[i],CP:t,ID:this._primitive.entity.id,EP:y.ContextMenu});return this._buildActionEventHandlers(t,i,r)}return null},e.prototype.buildEditActions=function(){return null},e.prototype._buildZoomAction=function(t){return this._sourcePrimitive?null:this._buildBasicActions(t,n.Zoom)},e.prototype.buildCoordinatesAction=function(t){var r=this,u,f,e,o,i;return pt.hideCoordinates?null:this.actionList.indexOf(n.Coordinates)!==-1&&this._map.getMapType().id!==g.birdseye?(u=t.latitude.toLocaleString(s.dynamicProperties.market,{minimumFractionDigits:6,maximumFractionDigits:6})+", "+t.longitude.toLocaleString(s.dynamicProperties.market,{minimumFractionDigits:6,maximumFractionDigits:6}),pt.enableCopyLinkInContextMenu?(f=u,e="secTextLink"):(f=w.L_OverlayEntity_Coordinates,e="secText"),o=function(n){r._isKeyHandler(n)&&(n.preventDefault&&n.preventDefault(),pt.enableCopyLinkInContextMenu&&n.keyCode&&r._copyToClipboardClickEventBuilder(n,t,r._primitive.entity.id))},i=this._primitive.entity.getGenericAction(f,"coordinates",o),i.showSecText=!0,i.secText=pt.enableCopyLinkInContextMenu?w.L_OverlayEntity_Copy_Coordinates:u,i.secTextClass=e,i.secTextLinkHandler=pt.enableCopyLinkInContextMenu?function(n){return r._copyToClipboardClickEventBuilder(n,t,r._primitive.entity.id)}:null,i):null},e.prototype._buildMenuAction=function(){return null},e.prototype._processMouseOverEvent=function(t,i,r){var u=this,o,s,h,c,f,e;t.preventDefault&&t.preventDefault();t.stopPropagation&&t.stopPropagation();switch(r){case n.AddToRoute:this._directionsListCount>1&&!this._isDirectionsPopOutVisible&&(o=this._buildLogData("F",{AN:n[n.AddToRoute],CP:i,ID:this._primitive.entity.id,EP:y.ContextMenu}),s=this._primitive.entity.getDirectionTaskOptions(i,y.ContextMenu),this._directionsProcessData.inData.requestorState.instData=o,this._isDirectionsPopOutVisible=!0,this._isCollectionsPopOutVisible=!1,this._isTravelPopOutVisible=!1,this._isNearbyPopOutVisible=!1,this._secondaryMenuOpen=!0,this._buttonGroupViewModel.processDirectionsData(this._directionsProcessData,s));break;case n.moveToAnotherDay:this._isTravelPopOutVisible||(h=this._buildLogData("F",{AN:n[r],CP:i,ID:this._primitive.entity.id,EP:y.ContextMenu}),this._isDirectionsPopOutVisible=!1,this._isCollectionsPopOutVisible=!1,this._isTravelPopOutVisible=!0,this._isNearbyPopOutVisible=!1,this._secondaryMenuOpen=!0,this._processTravelEvent(t,i,h,r));break;case n.MoveTo:this._isCollectionsPopOutVisible||(this._isDirectionsPopOutVisible=!1,this._isCollectionsPopOutVisible=!0,this._isTravelPopOutVisible=!1,this._isNearbyPopOutVisible=!1,this._secondaryMenuOpen=!0,c=this._buildLogData("C",{AN:n[n.MoveTo],CP:i,ID:this._primitive.entity.id,EP:y.ContextMenu}),this._processCollectionsEvent(t,i,c,!0,!0));break;case n.Nearby:this._isNearbyPopOutVisible||(this._isDirectionsPopOutVisible=!1,this._isCollectionsPopOutVisible=!1,this._isTravelPopOutVisible=!1,this._isNearbyPopOutVisible=!0,this._secondaryMenuOpen=!0,f=this._primitive.mapTypeClass.indexOf("Dark")!==-1?!0:!1,e=this._primitive.entity.getTitle(),this._templateSelector?this._buttonGroupViewModel.nearbyButtonClicked(t,i,this._categories,this._templateSelector,f,e):this.selectorReady().then(function(){u._buttonGroupViewModel.nearbyButtonClicked(t,i,u._categories,u._templateSelector,f,e)}));break;default:this._hidePopOut(t)}},e.prototype._processMouseOutEvent=function(n){n&&n.preventDefault&&n.preventDefault();window.clearTimeout(e._mouseoverDelayHandle)},e.prototype._openCardButtonClicked=function(n){var e,s,o,v;n&&n.preventDefault();var i=this._sourcePrimitive&&this._sourcePrimitive.entity,h=k.getYpid(i),l=k.getTransitJson(i),a=u.taskDataHandlerKey,t,r;h?(t={id:h,taskTitle:k.getDisplayName(i),entryPoint:y.ContextMenu},r=c.localDetailsTask):l?(e=JSON.parse(l),e.stops&&e.stops.length&&(s=this._primitive.getLocation(),t={id:e.stops[0].id,title:e.stops[0].name,location:s},r=c.transitStopTask)):k.isTransitEntity(i)&&(s=this._primitive.getLocation(),o=parseInt(i.id),o=isNaN(o)?0:o,t={id:o,title:i.title,location:s},r=c.transitStopTask);t||(v=this._primitive.geometry.y+","+this._primitive.geometry.x,a=u.taskProcessDataHandlerKey,t={query:v,taskTitle:this._primitive.entity.getTitle(),entryPoint:y.ContextMenu},r=c.localSearchTask);this.hide();f.invokeHandler(a,{requestState:t,state:t,type:r})},e.prototype.updateMapQuadrant=function(n,t,i,r){var h=n.getViewport(),u=n.getViewportPadding(),c=h.pixelWidth-u.left-u.right,a=h.pixelHeight-u.top-u.bottom,l=this.getRightClickPoint(n,t,i),f,e=l.x-u.left,s,o;r?f=this._isRtl?e-r<0:e+r>c:(s=c/2,f=this._isRtl?e<s:e>s);o=l.y-u.top<a/2;this._mapQuadrant=o&&f?b.TopRight:o&&!f?b.TopLeft:!o&&f?b.BottomRight:b.BottomLeft},e.prototype.getRightClickPoint=function(n,t){return n.getMode().tryLocationToPoint(t)},e.prototype._getVectorImage=function(){return{hitTest:1,hotspotX:0,hotspotY:0,records:[{centerX:0,centerY:0,radiusX:20,radiusY:20,style:{},vectorType:2}]}},e.prototype._buildLogData=function(n,t){return{logData:{feature:"CM",action:n,data:t}}},e.prototype.initializeCollections=function(){if(this.signInStateHandler.getIsSignedIn()){var n={action:h.GetAllCollectionNamesAndIds},t={requestorType:"TransientLens",type:c.collectionsTask,requestState:n};f.invokeHandler(u.taskProcessDataHandlerKey,t)}},e._getMapTypeClass=function(n,t){var i;switch(n.getMapType().id){case g.road:i="Light";break;case g.aerial:case g.birdseye:i="Dark";break;default:i="Light"}return i+(" "+b[t])},e.prototype.buildOverlaySearchAction=function(n){var t=this,i=this._primitive.entity,u=this._sourcePrimitive&&this._sourcePrimitive.entity,r=function(i){t._isKeyHandler(i)&&(window.clearTimeout(e._mouseoverDelayHandle),t._openCardButtonClicked(i,n))};return u?i.getLocalListingAction(!1,r):i.getAddPushpinAction(!1,r)},e.prototype._updateOverlayPosition=function(n,i){var r=t("#transientLens");if(r.length!==0){var it=r.select(".transientLensActions"),w=r.select(".directionsPopOut"),c=r.select(".travelPopOut"),y=r.select(".collectionsPopOut"),k=r.select(".nearbyPopOut"),rt=r.select("a.nearby").length>0,l=w.get_size().width,p=c.length&&c.get_size().width,a=y.get_size().width,v=k.get_size().width,ut=Math.max(l,a,v),ft=this._overwriteMapQuadrantUsingMenuWidth(ut,n,i),d=e._defaultDirectionPopOutTop,u=r.get_size(),o,s,f,h;this._isRtl?(o=-l,s=-p,f=-a,h=-v):o=s=f=h=u.width;this._mapQuadrant===b.TopRight||this._mapQuadrant===b.BottomRight?this._isRtl?o=s=f=h=u.width*2-e._leftPaddingForActions:(o=e._leftPaddingForActions-l-u.width,c.length&&(s=e._leftPaddingForActions-p-u.width),f=e._leftPaddingForActions-a-u.width,h=e._leftPaddingForActions-v-u.width):ft||(this._isRtl?o=s=f=h=u.width-e._leftPaddingForActions:(o=e._leftPaddingForActions-l,c.length&&(s=e._leftPaddingForActions-p),f=e._leftPaddingForActions-a,h=e._leftPaddingForActions-v));var et=tt&&tt.isEditable&&!this.signInStateHandler.getIsSignedIn(),g=r.select("a.nearby").get_relative_pos().y-20,nt=r.select("a.savefavorite").get_relative_pos().y-20;(this._mapQuadrant===b.BottomLeft||this._mapQuadrant==b.BottomRight)&&(d-=u.height-e._bottomPaddingForActions,g-=u.height,nt-=u.height);this._updateContextMenuPosition(r,it,i);w.set_style({top:d+this._adjustmentValueForTop+"px",left:o+"px"});c.length&&c.set_style({left:s+"px"});et?y.set_style({top:nt+this._adjustmentValueForTop+"px",left:f+"px"}):y.set_style({left:f+"px"});rt&&k.set_style({top:g+this._adjustmentValueForTop+"px",left:h+"px"})}},e.prototype._updateContextMenuPosition=function(n,t,i){var f=n.get_size(),u=e._topPaddingForBottomQuadrants,r;this._mapQuadrant===b.TopRight?r=-f.width:this._mapQuadrant===b.BottomLeft?u=-f.height+e._topPaddingForBottomQuadrants:this._mapQuadrant===b.BottomRight&&(u=-f.height+e._topPaddingForBottomQuadrants,r=-f.width);this._isRtl&&r&&(r=-r);t.set_style({position:"relative",top:u+"px",left:r+"px"});this._adjustmentValueForTop=this._getAdjustmentForTop();this._adjustmentValueForTop!==0&&(u+=this._adjustmentValueForTop,t.set_style({position:"relative",top:u+"px",left:r+"px"}),this._updateBucketId(i));n.set_style({visibility:"visible"})},e.prototype._getAdjustmentForTop=function(){var o=t("#transientLens"),i=o.select(".transientLensActions");if(this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.TopRight){var s=i.get_absolute_pos(),r=this._map.getViewportPadding(),u=this._map.getViewport().pixelHeight-(r.top+r.bottom),n=s.y+i.get_size().height;if(n>u)return u-n}else{var n=i.get_absolute_pos().y,f=t(".taskBar"),e=f.get_absolute_pos().y+f.get_size().height;if(e>n)return e-n}return 0},e.prototype._overwriteMapQuadrantUsingMenuWidth=function(n,i,r){var s=this._primitive.getLocation(),u=t("#transientLens").get_size().width,f=this._mapQuadrant,h;this.updateMapQuadrant(this._map,s,i,u);h=t("."+b[f]);f!==this._mapQuadrant&&(h.swap_class(b[f],b[this._mapQuadrant]),this._primitive.mapTypeClass=e._getMapTypeClass(this._map,this._mapQuadrant),this._updateBucketId(r));var l=this._map.getViewport(),o=this._map.getViewportPadding(),a=l.pixelWidth-o.left-o.right,v=this.getRightClickPoint(this._map,s,i),c=v.x-o.left;return this._isRtl?c-u-n>0:c+u+n<a},e.prototype._populateActions=function(t){var i,b,ct,e,o,r,s,k,d,h,c,l,a,lt,v,g,nt,y,u,f,tt,it,rt,ut,ft,et,ot,p,st,ht;if(this._primitive.entity&&t){if(i=[],this._mostRecentlyUsedList){if(this._mostRecentlyUsedList.getLength()>0)for(b=this._mostRecentlyUsedList.getList(),r=0;r<b.length;r++)ct=b[r],e=this._buildSaveToRecentAction(t,n.saveToRecent,ct),e&&(r===0&&(e.cssClass+="Icon"),r===b.length-1&&(e.showSeparator=!0),i.push(e))}else if(this._travelProcessData)for(o=this._travelProcessData.outData,this._buttonGroupViewModel.openItineraryTaskInfo=o,r=0;r<o.length;r++)s=this._buildAddToItineraryAction(t,n.addToItinerary,o[r]),r===o.length-1&&s&&(s.showSeparator=!0),s&&i.push(s);k=this._buildDirectionsAction(t,n.DirectionsTo,w.L_OverlayEntity_DirectionsTo,"directionsTo");k&&i.push(k);d=this._buildDirectionsAction(t,n.DirectionsFrom,w.L_OverlayEntity_DirectionsFrom,"directionsFrom");d&&i.push(d);this._directionsProcessData&&(h=this._buildDirectionsAction(t,n.AddToRoute,w.L_OverlayEntity_AddToRoute,"directionsAddToRoute"),h&&(this._directionsListCount>1&&(h.showArrow=!0),i.push(h)));(k||d||h)&&(i[i.length-1].showSeparator=!0);c=this.buildNearbyAction(t);c&&(c.showSeparator=!0,c.showArrow=!0,i.push(c));l=this._buildTravelMoveToAction(t,n.moveToAnotherDay);l&&(l.showArrow=!0,l.showSeparator=!0,i.push(l));this._primitive.entity.isRecommendationEntity||(a=this._buildBasicActions(t,n.SaveWithTempCollection),a&&(a.showSeparator=!0,lt=this.signInStateHandler.getIsSignedIn(),a.showArrow=!1,i.push(a)));v=this._buildBasicActions(t,n.MoveTo);v&&(v.showSeparator=!0,v.showArrow=!0,i.push(v));g=this.buildEditActions(n.Edit);g&&i.push(g);nt=this.buildEditActions(n.editName);nt&&i.push(nt);y=this.buildEditActions(n.editDescription);y&&i.push(y);u=this.buildEditActions(n.deleteName);u&&i.push(u);f=this.buildEditActions(n.deleteDescription);f&&i.push(f);tt=this.buildEditActions(n.hideHomeWork);tt&&i.push(tt);it=this.buildEditActions(n.editHomeWork);it&&i.push(it);rt=this.buildEditActions(n.Remove);rt&&i.push(rt);u||f||!y?f?f.showSeparator=!0:u&&(u.showSeparator=!0):y.showSeparator=!0;ut=this._buildLocalSearchAction(t);ut&&i.push(ut);ft=this.buildLocalDetailAction(t);ft&&i.push(ft);et=this.buildStreetsideAction(t);et&&i.push(et);ot=this._buildBasicActions(t,n.BirdseyeV2);ot&&i.push(ot);p=this._buildZoomAction(t);p&&i.push(p);st=this._buildBasicActions(t,n.Measure);st&&i.push(st);ht=this.buildCoordinatesAction(t);ht&&(p&&(p.showSeparator=!0),i.push(ht));this._primitive.entity.setActions(i)}},e.prototype._populateNearbyCategories=function(){var t=this,n;nt.contextMenuNearbyCategories.length>0&&(this._categories=[],nt.contextMenuNearbyCategories.forEach(function(n){var i=n.split(":");i&&i.length===2&&t._categories.push({Name:i[0],Id:i[1]})}),n=s.features,n&&n.transit&&n.transit.isEnabled&&this._categories.push({Name:r.L_Nearby_Transit,Id:cr.nearbyTransitCategoryId}))},e.prototype._buildActionEventHandlers=function(t,i,r,u,f,o,s,h){var c=this,l,a=this._primitive.entity,v;switch(i){case n.Zoom:l=a.getZoomAction(!1,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._zoomButtonClicked(n,t,r))});v=this._map.getMercatorZoomLevel();v<e._streetZoomLevel?l.cssClass="zoomEnabled":v>=e._streetZoomLevel&&(l.cssClass="zoomout",l.text=w.L_OverlayEntity_ZoomOut);break;case n.Measure:l=a.getGenericAction(w.L_OverlayEntity_Measure,"measure",function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._measureActionClicked(n,t,r))});break;case n.SaveWithTempCollection:l=a.getMyPlacesAction(!1,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processCollectionsEvent(n,t,r,c.signInStateHandler.getIsSignedIn()?!0:!1))},!0);break;case n.MoveTo:l=a.getMyPlacesAction(!1,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processCollectionsEvent(n,t,r,!0,!0))},!0,!0);break;case n.addToItinerary:case n.moveToAnotherDay:l=a.getGenericAction(u,f,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processTravelEvent(n,t,r,i,o))});break;case n.saveToRecent:l=a.getGenericAction(u,f,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processSaveToRecentEvent(n,t,r,o,s,h))});break;case n.Directions:case n.DirectionsTo:case n.DirectionsFrom:case n.AddToRoute:l=a.getGenericAction(u,f,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processDirectionsEvent(n,t,r,i))});break;case n.Search:l=this.buildOverlaySearchAction(r);break;case n.Streetside:l=a.getStreetsideAction(!0,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._streetsideButtonClicked(n,t,r))});break;case n.BirdseyeV2:l=a.getBirdseyeV2Action(!0,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._birdseyeV2ButtonClicked(n,t,r))});break;case n.Nearby:l=a.getNearbyAction(!1,function(n){c._isKeyHandler(n)&&(window.clearTimeout(e._mouseoverDelayHandle),c._processNearbyEvent(n,t))});break;case n.Menu:default:return null}return this.addMouseHoverHandlers(l,t,i)},e.prototype.addMouseHoverHandlers=function(n,t,i){var r=this;return n?(n.mouseoverHandler=function(n){window.clearTimeout(e._mouseoverDelayHandle);e._mouseoverDelayHandle=Microsoft.Maps.setTimeout(function(){r._processMouseOverEvent(n,t,i)},e._mouseoverTimeout)},n.mouseoutHandler=function(n){return r._processMouseOutEvent(n)},n):null},e.prototype._isKeyHandler=function(n){var t=n;return t&&t.type==="keydown"&&t.keyCode!==13?(this._onKeyDown(n),!1):!0},e.prototype._processDirectionsEvent=function(t,i,r,e){var o,s,h,l,c;t&&t.preventDefault&&t.preventDefault();l=this._primitive.entity.getTitle();switch(e){case n.DirectionsTo:o=2;s=this._activeDirectionTaskId;h=this._activeDirectionTaskId?"focus":"activate";break;case n.DirectionsFrom:o=1;s=this._activeDirectionTaskId;h=this._activeDirectionTaskId?"focus":"activate";break;case n.AddToRoute:if(this._directionsListCount===1)o=3,s=this._addToRouteDirectionTaskId,h="focus";else{if(this._isDirectionsPopOutVisible)return;this._processMouseOverEvent(t,i,e);return}break;default:throw new Error("Error action type");}c=d.getDirectionTaskOptions(l,i,y.ContextMenu,l,this._primitive.entity.id,o);c.id=s;c.action=h;this.hide();f.invokeHandler(u.taskDataHandlerKey,c)},e.prototype._processTravelEvent=function(i,r,o,s,h){var c,v,p;if(i&&i.preventDefault&&i.preventDefault(),s===n.addToItinerary&&(c=this._primitive.entity,c.getImageUrl()&&c.getImageUrl().length>0&&(v=c.getImageUrl()),p=d.getItineraryAddItemOptions(c.getTitle(),r,c.id,v,h,c.categoryId,c.interests,c.stayDuration),f.invokeHandler(u.taskProcessDataHandlerKey,p),this.hide()),s===n.moveToAnotherDay){var l=t("#transientLens"),w=l.select(".transientLensActions"),k=l.select(".travelPopOut"),a,g=l.select(".addToItinerary");a=g.get_relative_pos().y-20;this._buttonGroupViewModel.travelMoveToButtonClicked(i,r,o,y.ContextMenu);(this._mapQuadrant===b.BottomLeft||this._mapQuadrant===b.BottomRight)&&(a-=w.get_size().height+e._bottomPaddingForActions);k.set_style({top:a+this._adjustmentValueForTop+"px"})}},e.prototype._processSaveToRecentEvent=function(n,t,i,r,e,o){var s,h;n&&n.preventDefault&&n.preventDefault();s=this._primitive.entity;s.getImageUrl()&&s.getImageUrl().length>0&&(h=s.getImageUrl());var c=s,a=c.getDescription&&c.getDescription(),v=c.getAddress&&c.getAddress(),l;l=o?e&&!r?d.getItineraryAddItemFromSaveOptions(s.getTitle(),t,s.id,h,e,s.categoryId,s.interests,s.stayDuration):d.getItineraryAddItemOptions(s.getTitle(),t,s.id,h,r,s.categoryId,s.interests,s.stayDuration):d.getSaveToCollectionOptions(s.getTitle(),t,e,s.id,a,v,h,s.categoryId);f.invokeHandler(u.taskProcessDataHandlerKey,l);this.hide()},e.prototype._processNearbyEvent=function(t,i){this._processMouseOverEvent(t,i,n.Nearby)},e.prototype._processCollectionsEvent=function(n,i,r,u,f){var o=t("#transientLens"),l=o.select(".transientLensActions"),a=o.select(".collectionsPopOut"),s,h,c;u?(h=o.select(".saveas"),s=h.get_relative_pos().y-20,this._buttonGroupViewModel.collectionMenuButtonClicked(n,i,r,y.ContextMenu,f)):(c=o.select(".savefavorite"),s=c.get_relative_pos().y-20,this._buttonGroupViewModel.collectionButtonClicked(n,i,r,y.ContextMenu));(this._mapQuadrant===b.BottomLeft||this._mapQuadrant===b.BottomRight)&&(s-=l.get_size().height+e._bottomPaddingForActions);a.set_style({top:s+this._adjustmentValueForTop+"px"})},e.prototype._reset=function(){this._reverseGeocodingRequestId&&ot.abortRequest(this._reverseGeocodingRequestId);this._primitive&&(this._directionsProcessData=null,this._activeDirectionTaskId=null,this._travelProcessData=null,this._directionsProcessed=!1,this._travelProcessed=!1,this._addToRouteDirectionTaskId=null,this._adjustmentValueForTop=0,this._cleanup(),this._primitive=null,this._sourcePrimitive=null,this.invalidateLayer.invoke())},e.prototype._hidePopOut=function(n){(this._isDirectionsPopOutVisible||this._isCollectionsPopOutVisible||this._isTravelPopOutVisible||this._isNearbyPopOutVisible)&&(n&&n.preventDefault&&n.preventDefault(),this._ignoreHideEventOnce=!0,this._isDirectionsPopOutVisible=!1,this._isCollectionsPopOutVisible=!1,this._isTravelPopOutVisible=!1,this._isNearbyPopOutVisible=!1,this._buttonGroupViewModel.hidePopout(),this._ignoreHideEventOnce=!1)},e.prototype._streetsideButtonClicked=function(n,t){var i=this;n&&n.preventDefault();n&&n.stopPropagation();this._streetsideBubbleInfo&&(this.hide(),this._map.getContainer().instanceAsync("StreetsideMiniBootstrapper",function(n){n.show(i._streetsideBubbleInfo,{locationToLookAt:t,entryPoint:y.ContextMenu,perfClickToImmersionTimeSource:iu.ContextMenuClickToImmersionTime})}))},e.prototype._birdseyeV2ButtonClicked=function(n,t){var i=this;n&&n.preventDefault();n&&n.stopPropagation();ni.setMapCenter(this._map,t,null,null,new dr(this._map.getView(),new kr(fu.toLocation(t,this._map.getMercatorZoomLevel(),!0))),null,null,{top:0,right:0,bottom:0,left:0});this._map.getFrameManager().frameRendered.addOne(function(){i._map.setMapType(i._map.createMapType(g.birdseyeV2));i._addContextPoiForBirdseyeV2(t)});this.hide()},e.prototype._addContextPoiForBirdseyeV2=function(n){var t=this;this._map.getBirdseyeV2Manager().then(function(i){var r,u;t._map.getMapType().id===g.birdseyeV2&&(r=t._primitive&&t._primitive.entity&&t._primitive.entity.getTitle(),r?i&&i.addContextPoi(n,r,1):t._reverseGeocoder?t._reverseGeocoder.reverseGeocodeWithNetworkId(n,function(n){u(n)}):t._map.getContainer().instanceAsync("ReverseGeocoder",function(t){t.reverseGeocodeWithNetworkId(n,function(n){u(n)})}),u=function(r){if(t._map.getMapType().id===g.birdseyeV2&&r&&r.success&&r.location&&r.addressList){var u=r.addressList[0].formattedAddress;i&&i.addContextPoi(n,u,1)}})})},e.prototype._measureActionClicked=function(n,t){n&&n.preventDefault();this.hide();var i={location:t},r={type:c.measureMap,state:i};f.invokeHandler(u.taskDataHandlerKey,r)},e.prototype._zoomButtonClicked=function(n,t){n&&n.preventDefault();var i=this._map.getMercatorZoomLevel();i<=e._cityZoomLevel-1?(this.hide(),ni.setMapCenter(this._map,t,e._cityZoomLevel)):i>=e._cityZoomLevel&&i<e._streetZoomLevel?(this.hide(),ni.setMapCenter(this._map,t,e._streetZoomLevel)):i>=e._streetZoomLevel&&(this.hide(),ni.setMapCenter(this._map,t,e._cityZoomLevel))},e.prototype._processGeocodeResponse=function(n){var t,i,u,r;(this._reverseGeocodingRequestId=null,t=this._primitive,t)&&(n&&n.success&&n.location&&n.addressList?i=n.addressList[0].formattedAddress:(u=t.geometry,i=l._formatLatLonString(u.y,u.x)),r=t.entity,r.getTitle()||r.setTitle(i),r.setAddress(i),this._updateBucketId())},e.prototype._updateBucketId=function(n){var t=this._primitive;t.bucket=this._adjustmentValueForTop!==0?this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.BottomLeft?rt.bucketIdForTransientLensLeft:rt.bucketIdForTransientLensRight:this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.TopRight?rt.bucketIdForTransientLensTop:rt.bucketIdForTransientLensBottom;t.revision=t.revision||1;n||this.invalidateLayer.invoke()},e.prototype._isStreetsideAvailable=function(n,t){var r=this,i;n&&this._primitive&&this._primitive.geometry.y===t.latitude&&this._primitive.geometry.x===t.longitude&&(this._streetsideBubbleInfo=n,i=this._primitive.entity.getActions(),i.forEach(function(n,t){if(n.getCssClass&&n.getCssClass()==="streetside"){r._primitive.entity.getActions()[t].setCssClass("streetsideEnabled");return}}))},e.prototype._isBirdseyeV2Available=function(n){var i=this,t;n&&this._primitive&&(t=this._primitive.entity.getActions(),t.some(function(n,t){var r=!1;return n.getCssClass&&n.getCssClass()==="birdseyeV2"&&(i._primitive.entity.getActions()[t].setCssClass("birdseyeV2Enabled"),r=!0),r}))},e.prototype._getDirectionsProcessData=function(n,t){this._directionsProcessed=!1;var i=this._primitive.getLocation(),r={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.directionsTask,requestState:{action:0},requestorState:{location:i,args:n,preventInvalidate:t},useActiveTasks:!0};f.invokeHandler(u.taskProcessDataHandlerKey,r)},e.prototype._getTravelProcessData=function(n,t){this._travelProcessed=!1;var i=this._primitive.getLocation(),r={requestorType:this._options.requestorType,requestorId:this._options.requestorId,type:c.itineraryDetailsTask,requestState:{action:0},requestorState:{location:i,args:n,preventInvalidate:t},useActiveTasks:!0};f.invokeHandler(u.taskProcessDataHandlerKey,r)},e.prototype._onClick=function(n){n.target&&t(n.target.parentElement).has_class("ms-composite")||this.hide()},e.prototype._onKeyDown=function(n){var o,f,s,h,c,u,r,i,l;if(n.type==="keydown"){if(o=[13,27,32,37,39,61,65,66,72,79,82,107,109,173,187,189],n.target.classList.contains("nameEditBox")&&(o=[13,27,37,39,61,173,107,109,173,187,189]),o.indexOf(n.keyCode)>=0){if(n.keyCode===37&&(f=n.srcElement&&t(n.srcElement),f&&f.length>0&&(s=f.getParent(),s.length>0&&s.select(".bm_dropdownEntry").length>0)))return;this.hide();e._parentElement&&e._parentElement.length>0&&n.keyCode===27?e._parentElement[0].focus():(h=t(n.target).get_ancestor(3),h.length>0&&h[0].classList.contains("transientLensActions")&&(c=t("#mapFocus"),c.length>0&&c[0].focus(),n.preventDefault(),n.stopImmediatePropagation()));return}if(u=document.activeElement,r=this._primitive&&ti.getOverlay()&&ti.getOverlay().getOverlayElement(),r&&r.length!==0||(r=t("#transientLens")),i=u&&r&&r.length>0&&r.has(u)&&u.tagName&&u.tagName.toLowerCase()==="a"&&u.parentElement,!i)return;if(n.keyCode===38)if(i&&i.previousElementSibling)n.preventDefault(),n.stopImmediatePropagation(),t("a",i.previousElementSibling)[0].focus();else{this.hide();return}if(n.keyCode===40)if(i&&i.nextElementSibling)n.preventDefault(),n.stopImmediatePropagation(),t("a",i.nextElementSibling)[0].focus();else{this.hide();return}if(n.keyCode===9)if(l=n,l.shiftKey){if(i&&!i.previousElementSibling){this.hide();return}}else if(i&&!i.nextElementSibling){this.hide();return}}},e.prototype._copyToClipboardClickEventBuilder=function(){var r=document.querySelector("#transientLens .coordinates .actionText"),u,n,i;if(window.getSelection&&document.createRange&&pt.enableAutoCopyToClipboard){n=document.createRange();n.selectNodeContents(r);window.getSelection().removeAllRanges();window.getSelection().addRange(n);try{u=document.execCommand("copy")}catch(f){}window.getSelection().removeAllRanges()}i=t("#transientLens .coordinates .secTextLink");i.swap_class("secTextLink","secText");u?(i.set_text(w.L_OverlayEntity_Copy_Succeeded),window.clearTimeout(e._copyToClipboardHandle),e._copyToClipboardHandle=Microsoft.Maps.setTimeout(function(){var n=t("#transientLens .coordinates .secText");n.swap_class("secText","secTextLink");n.set_text(w.L_OverlayEntity_Copy_Coordinates)},e._copyToClipboardTimeout)):(n=document.createRange(),n.selectNodeContents(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(n),i.set_text("Ctrl + C"))},e._convertToRGBA=function(n,t){var i=n.replace("#",""),r=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),f=parseInt(i.substring(4,6),16);return"rgba("+r+","+u+","+f+","+t+")"},e.prototype._setFocusOnFirstElement=function(){window.clearTimeout(e._focusDelayHandle);e._focusDelayHandle=Microsoft.Maps.setTimeout(function(){var n=t(".transientLensActions li");n.length&&t("a",n[0])[0].focus()},e._focusTimeout)},e._copyToClipboardTimeout=1e3,e._cityZoomLevel=11,e._streetZoomLevel=16,e._topPaddingForBottomQuadrants=-8,e._bottomPaddingForActions=-6,e._mouseoverTimeout=350,e._leftPaddingForActions=15,e._defaultDirectionPopOutTop=50,e._focusTimeout=100,e}(),ai=function(t){function i(n,i,r){var u=t.call(this,n,null,i,r)||this;return u.updateActionList(),u.poiSelected=new p,u._buildMode=!1,u}return a(i,t),i.prototype.buildMenu=function(n,t,i){this._buildMode=!0;this._buildCallback=i;this.show({primitive:n,item:t},!0)},i.prototype.showOverlay=function(){if(this._buildMode&&this._buildCallback){var n=this._controlTemplate.applyDataTemplate({primitive:this._primitive});this._buildCallback(n)}else t.prototype.showOverlay.call(this);this._buildMode=!1;this._buildCallback=null},i.prototype.populatePrimitive=function(n){var r;if(this._primitive&&this._cleanup(),n.primitive&&n.primitive.geometryType&&n.primitive.geometryType!==1){t.prototype.populatePrimitive.call(this,n);return}var f=n.primitive.geometry,e=new wt(f.y,f.x),u=n.primitive.entity,i=null;u instanceof vt?(r=u,i=new fi(r.getTitle(),r.getDescription(),n.primitive.taskDisplayState,r.getMenuUrl(),r.getAddress(),r.getSelectedCategoryForIcon&&r.getSelectedCategoryForIcon()),i.collisionBehavior=2,i.setImageUrl(r.getImageUrl()),i.addressFields=r.addressFields,i.setSegmentTypes(r.getSegmentTypes()),i.setPrimaryCategoryName(r.getPrimaryCategoryName()),i.searchEntity=u):i=new fi(u.title,u.subtitle,n.primitive.taskDisplayState);i.id=u.id;i.isRecommendationEntity=u instanceof tu;this._primitive=new si(e,i,this._getVectorImage());this.updateMapQuadrant(this._map,e,n);this._primitive.bucket=this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.TopRight?rt.bucketIdForTransientLensTop:rt.bucketIdForTransientLensBottom;this._primitive.taskDisplayState=n.primitive.taskDisplayState},i.prototype.getRightClickPoint=function(n,i,r){if(r&&r.item){var u=r.item.get_absolute_pos();return new nu(u.x,u.y)}return t.prototype.getRightClickPoint.call(this,n,i,r)},i.prototype.updateActionList=function(){this.actionList.push(n.OpenNewCard)},i.prototype._openCardButtonClicked=function(n){n&&n.preventDefault();var t={entryPoint:y.ContextMenu,id:this._primitive.entity.id,flippingCard:!0,taskTitle:this._primitive.entity.getTitle(),selectedCategoryId:this._primitive.entity.categoryId};l._updateSearchTaskStateWithAdsData(t,this._primitive.entity.searchEntity);this.poiSelected.invoke(this._primitive);this.hide();f.invokeHandler(u.taskDataHandlerKey,{type:c.localDetailsTask,state:t,activateOptions:{parentId:this._options.requestorId}})},i.prototype._buildLocalSearchAction=function(n){var i=t.prototype._buildLocalSearchAction.call(this,n);return i&&(i.cssClass=this._isCardInFocus()?"flipcard":"flipcardEnabled"),i},i.prototype.buildLocalDetailAction=function(t){var u=this,i,r;return this.actionList.indexOf(n.OpenNewCard)!==-1||this._primitive&&this._primitive.entity&&this._primitive.entity.isRecommendationEntity?(i=this._buildLogData("C",{AN:n[n.OpenNewCard],CP:t,ID:this._primitive.entity.id,EP:y.ContextMenu}),r=this._primitive.entity.getLocalDetailsAction(!1,function(n){window.clearTimeout(et._mouseoverDelayHandle);u.openNewCardButtonClicked(n,i)}),this.addMouseHoverHandlers(r,t,n.OpenNewCard)):null},i.prototype.buildStreetsideAction=function(n){return this._buildMode?null:t.prototype.buildStreetsideAction.call(this,n)},i.prototype._buildZoomAction=function(n){return this._buildMode?null:t.prototype._buildZoomAction.call(this,n)},i.prototype.buildOverlaySearchAction=function(n){var i=this,t=this._primitive.entity;return t.id&&t.id.length>0?t.getLocalListingAction(!1,function(t){window.clearTimeout(et._mouseoverDelayHandle);i._openCardButtonClicked(t,n)}):null},i.prototype.openNewCardButtonClicked=function(n){var t,i;n&&n.preventDefault();t={entryPoint:y.ContextMenu,listingTaskId:this._options.requestorId,id:this._primitive.entity.id,openingNewCard:!0,taskTitle:this._primitive.entity.getTitle(),selectedCategoryId:this._primitive.entity.categoryId};l._updateSearchTaskStateWithAdsData(t,this._primitive.entity.searchEntity);i=this._primitive.taskDisplayState&&this._primitive.taskDisplayState.colorIndex;this.hide();f.invokeHandler(u.taskDataHandlerKey,{type:c.localDetailsTask,state:t,activateOptions:{taskColorIndex:i,groupName:this._options.requestorId}})},i}(et),se=function(i){function r(n,t,r){var u=i.call(this,n,t,r)||this;return u.editEvent=new p,u}return a(r,i),r.prototype.updateActionListWithMoveTo=function(){var i,t;if(this.signInStateHandler.getIsSignedIn()&&this.actionList){for(i=!1,t=0;t<this.actionList.length;t++)this.actionList[t]===n.MoveTo&&(i=!0);i||this.actionList.push(n.MoveTo)}},r.prototype.updateActionListWithEdits=function(){this.updateActionList();this.actionList.push(n.Edit)},r.prototype.updateActionListWithHomeWorkEdit=function(){this.actionList=[];this.actionList.push(n.DirectionsTo);this.actionList.push(n.DirectionsFrom);this.actionList.push(n.AddToRoute);this.actionList.push(n.OpenNewCard);this.actionList.push(n.editHomeWork);this.actionList.push(n.hideHomeWork);this.actionList.push(n.Remove)},r.prototype.updateActionListForEvent=function(){this.actionList=[];this.actionList.push(n.DirectionsTo);this.actionList.push(n.DirectionsFrom);this.actionList.push(n.AddToRoute);this.actionList.push(n.OpenNewCard)},r.prototype.updateActionList=function(){this.actionList=[];tt&&tt.isEditable&&this.actionList.push(n.addToItinerary);this.actionList.push(n.DirectionsTo);this.actionList.push(n.DirectionsFrom);this.actionList.push(n.AddToRoute);this.actionList.push(n.OpenNewCard);this.signInStateHandler.getIsSignedIn()&&this.actionList.push(n.MoveTo);this.actionList.push(n.Remove)},r.prototype.openNewCardButtonClicked=function(n){var i;if(this.isNotEnterOrClickHandler(n)){n&&n.preventDefault();var t=this._primitive.entity,r=t.getTitle(),o="",e=t.getNickname();e&&Microsoft.Maps.ResourceManager.Collections&&e!==Microsoft.Maps.ResourceManager.Collections.L_HomeFavorite_Text&&e!==Microsoft.Maps.ResourceManager.Collections.L_WorkFavorite_Text&&(o=r,r=t.getNickname());i={entryPoint:y.ContextMenu,listingTaskId:this._options.requestorId,id:t.id,openingNewCard:!0,taskTitle:r,originalName:o,selectedCategoryId:t.categoryId};i.hideBackButton=!0;!i.id&&this._primitive.geometry&&(i.query=this._primitive.geometry.y.toFixed(6)+", "+this._primitive.geometry.x.toFixed(6));this.hide();f.invokeHandler(u.taskDataHandlerKey,{type:c.localDetailsTask,state:i,activateOptions:{groupName:this._options.requestorId}})}},r.prototype.populatePrimitive=function(n){var c,l,r,e,u;this._primitive&&this._cleanup();this.collectionPrimitive=n.primitive;var o=n.primitive.geometry,s=new wt(o.y,o.x),t=n.primitive.entity,i=n.primitive.entity,h=t.getTitle(),f="";t.originalName?f=t.originalName:i.getOriginalName&&(f=i.getOriginalName());c=t.getDescription();l=t.getAddress();t.businesslistingid?r=t.businesslistingid:i.getBusinesslistingid&&(r=i.getBusinesslistingid(),r.indexOf("ypid:")===-1&&r.indexOf("sid:")===-1&&(r=""));t.photoUrl?e=t.photoUrl:i.getPhotoUrl&&(e=i.getPhotoUrl());u=new fi(f||h,c,n.primitive.taskDisplayState,null,l,n.primitive.entity.getSelectedCategoryForIcon&&n.primitive.entity.getSelectedCategoryForIcon());f&&u.setNickname(h);e&&u.setImageUrl(e);u.collisionBehavior=2;u.id=r;this._primitive=new si(s,u,this._getVectorImage());this.updateMapQuadrant(this._map,s,n);this._primitive.bucket=this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.TopRight?rt.bucketIdForTransientLensTop:rt.bucketIdForTransientLensBottom;this._buildMode&&(this._primitive.taskDisplayState=n.primitive.taskDisplayState)},r.prototype.buildEditActions=function(t){var u=this,i,r,f,e,o;if(this.actionList.indexOf(t)===-1)return null;i="";r=!1;switch(t){case n.Edit:i=w.L_EditEntityOption;r=!0;break;case n.editName:i=this.actionList.indexOf(n.deleteName)===-1?w.L_AddNickNameOption:w.L_EditNickNameOption;break;case n.editDescription:i=this.actionList.indexOf(n.deleteDescription)===-1?w.L_AddNoteOption:w.L_EditNoteOption;break;case n.Remove:i=w.L_DeleteEntityOption;r=!0;break;case n.deleteName:i=w.L_DeleteNickNameOption;break;case n.deleteDescription:i=w.L_DeleteNoteOption;break;case n.editHomeWork:i=w.L_EditHomeWorkOption;r=!0;break;case n.hideHomeWork:this.collectionPrimitive&&this.collectionPrimitive.entity.getIsHomeOrWork&&(f=this.collectionPrimitive,i=f.entity.getShowOnMap()?w.L_HideHomeWorkOption:w.L_DisplayHomeWorkOption)}return e=function(n){u.isNotEnterOrClickHandler(n)&&(window.clearTimeout(et._mouseoverDelayHandle),u.editEvent.invoke(t),n.stopPropagation(),n.preventDefault(),u.hide(),u._collectionFocus())},o={text:i,cssClass:t===n.Remove?"remove":"edit",handler:e,mouseoverHandler:null,showSeparator:r,showSecText:!1,secText:null},o},r.prototype.isNotEnterOrClickHandler=function(n){var t=n;return!t.keyCode||t.keyCode===13?!0:!1},r.prototype._collectionFocus=function(){var f,i,n,r,u;et._parentElement&&et._parentElement.length>0&&(f=et._parentElement,i=f.get_ancestor(2),i.length>0?i.has_class("homeContents")?(n=i.select(".bm_editHomeAddress"),n.length>0&&n.parent().get_style("display")!=="none"&&n.select("input")[0].focus()):i.has_class("workContents")?(n=i.select(".bm_editWorkAddress"),n.length>0&&n.parent().get_style("display")!=="none"&&n.select("input")[0].focus()):(r=t(".editEntryRow",i[0]),r.length>0&&r.get_style("display")!=="none"?(u=r.select("input"),u.length>0&&u[0].focus()):et._parentElement[0].focus()):et._parentElement[0].focus())},r}(ai),he=function(n){function t(t,i,r){return n.call(this,t,i,r)||this}return a(t,n),t.prototype.updateActionList=function(){},t.prototype._isCardInFocus=function(){var n=this._primitive.entity.getTaskDisplayState();return n&&n.activationState&&n.activationState===1?!0:!1},t.prototype._openCardButtonClicked=function(n){(n&&n.preventDefault(),this._isCardInFocus())||(this.hide(),f.invokeHandler(u.taskDataHandlerKey,{action:"focus",id:this._options.requestorId}))},t}(ai),ce=function(i){function r(n,t,r){var u=i.call(this,n,t,r)||this;return u.editable=tt&&tt.isEditable,u.editable&&(u._buttonGroupViewModel.isItineraryContextMenu=!0),u.editEvent=new p,u}return a(r,i),r.prototype.updateActionList=function(){tt&&tt.isEditable?this.actionList=[n.DirectionsTo,n.DirectionsFrom,n.AddToRoute,n.moveToAnotherDay,n.OpenNewCard]:i.prototype.updateActionList.call(this)},r.prototype.updateActionListWithEdits=function(t,i){this.updateActionList();tt&&tt.isEditable&&(this.actionList.push(n.editName),this.actionList.push(n.editDescription),t&&this.actionList.push(n.deleteName),i&&this.actionList.push(n.deleteDescription))},r.prototype.populatePrimitive=function(n){var o,s,r,t;this._primitive&&this._cleanup();this.travelEntity=n.primitive.entity;var u=n.primitive.geometry,f=new wt(u.y,u.x),e=this.travelEntity.getTitle(),i="";this.travelEntity.originalName&&(i=this.travelEntity.originalName);o=this.travelEntity.getDescription();s=this.travelEntity.getAddress();this.travelEntity.imageUrl&&(r=this.travelEntity.imageUrl);t=new fi(i||e,o,n.primitive.taskDisplayState,null,s,n.primitive.entity.getSelectedCategoryForIcon&&n.primitive.entity.getSelectedCategoryForIcon());i&&t.setNickname(e);r&&t.setImageUrl(r);t.collisionBehavior=2;t.id=this.travelEntity.id;this._primitive=new si(f,t,this._getVectorImage());this.updateMapQuadrant(this._map,f,n);this._primitive.bucket=this._mapQuadrant===b.TopLeft||this._mapQuadrant===b.TopRight?rt.bucketIdForTransientLensTop:rt.bucketIdForTransientLensBottom;this._buildMode&&(this._primitive.taskDisplayState=n.primitive.taskDisplayState)},r.prototype._updateEntityData=function(){if(this.editable){var n=t("#transientLens");this._buttonGroupViewModel.setEntityData(this.travelEntity,this._options);this._buttonGroupViewModel.setAddToRouteMode(n.select(".directionsAddToRoute"),!0)}else i.prototype._updateEntityData.call(this)},r.prototype.processTravelData=function(n){var t;if(this.editable){this._travelProcessed=!0;var r=n.inData.requestState&&n.inData.requestState.action,u=n.inData.requestorId,f=n.outData.length&&n.outData[0].days;r===2?(t=d.getItineraryDayOptions(this.travelEntity,u,f),this._buttonGroupViewModel.processTravelMoveToData(n,t)):this.updateTransientLens(n.inData)}else i.prototype.processTravelData.call(this,n)},r.prototype.buildEditActions=function(t){var r=this,i,u,f,e;if(this.actionList.indexOf(t)===-1)return null;i="";u=!1;switch(t){case n.editName:i=this.actionList.indexOf(n.deleteName)===-1?w.L_AddNickNameOption:w.L_EditNickNameOption;break;case n.editDescription:i=this.actionList.indexOf(n.deleteDescription)===-1?w.L_AddNoteOption:w.L_EditNoteOption;break;case n.deleteName:i=w.L_DeleteNickNameOption;break;case n.deleteDescription:i=w.L_DeleteNoteOption}return f=function(n){window.clearTimeout(et._mouseoverDelayHandle);r.editEvent.invoke(t);n.stopPropagation();n.preventDefault();r.hide()},e={text:i,cssClass:"edit",handler:f,mouseoverHandler:null,showSeparator:u,showSecText:!1,secText:null},e},r.prototype.openNewCardButtonClicked=function(n){var t,i,r;n&&n.preventDefault();t=this._primitive.entity;i={entryPoint:y.ContextMenu,listingTaskId:this._options.requestorId,id:t.id,openingNewCard:!0,taskTitle:t.getNickname()||t.getTitle(),selectedCategoryId:this._primitive.entity.categoryId};t.getNickname()&&(i.originalName=t.getTitle());!i.id&&this._primitive.geometry&&(i.query=this._primitive.geometry.y.toFixed(6)+", "+this._primitive.geometry.x.toFixed(6));r=this._primitive.taskDisplayState&&this._primitive.taskDisplayState.colorIndex;this.hide();f.invokeHandler(u.taskDataHandlerKey,{type:c.localDetailsTask,state:i,activateOptions:{taskColorIndex:r,groupName:this._options.requestorId}})},r}(ai),le=function(){function n(n,t,i){var r=this;this._events=[];this._map=n;this._templateSelector=t;this.invalidated=new p;this._events.push(this._map.contextMenuInvoked.add(function(n){return r._onContextMenuInvoked(n)}));this._transientLensViewModel=i;this._transientLensViewModel.setOptions({requestorType:"TransientLens"});this._events.push(this._transientLensViewModel.invalidateLayer.add(function(){r._layer&&r._layer.setVisible(!!r._transientLensViewModel.getPrimitive());r.invalidated.invoke()}))}return n.prototype.getPrimitives=function(n,t){var i=this._transientLensViewModel.getPrimitive();i?(i.layer=this._layer,t&&t({primitives:[i]})):t&&t({primitives:[]})},n.prototype.getViewModel=function(){return this._transientLensViewModel},n.prototype.dispose=function(){this._layer&&(this._map.getLayers().remove(this._layer),this._layer.dispose(),this._layer=null);this._map=null;this._templateSelector=null;for(var n=this._events.length-1;n>=0;n--)this._events[n].dispose();this._events=[];this._transientLensViewModel.dispose()},n.prototype.processCallback=function(n){n&&n.inData&&n.processorType&&n.outData&&(n.processorType===c.directionsTask&&n.inData.requestorState?this._transientLensViewModel.processDirectionsData(n):n.processorType===c.collectionsTask&&n.inData.requestorState?this._transientLensViewModel.processCollectionsData(n):n.processorType===c.itineraryDetailsTask&&n.inData.requestorState&&this._transientLensViewModel.processTravelData(n))},n.prototype.hide=function(){this._transientLensViewModel.hide()},n.prototype._onContextMenuInvoked=function(n){this._map.getMode().mapModeType===0&&(l._isSmallMapShownOnSerp()||(this._layer||(this._layer=new ru("TransientLens",this,this._templateSelector,1e4),this._layer.setRenderTarget(1),this._map.getLayers().insert(this._layer)),this._transientLensViewModel.hide(),n.primitive&&n.exclusiveHitTest)||(!n.location||n.primitive&&(n.layer||n.layer.hasCustomContextMenu)?n.layer.getId&&n.layer.getId()==="TransientLens"&&this._transientLensViewModel.show(n):this._transientLensViewModel.show(n)))},n}();v.AdsScenario=ci;i.CalendarSyncTemplate=tr;i.CalendarSync=pr;i.CalendarSyncViewModel=wi;i.FiltersBarModuleViewModel=bf;i.FiltersBarViewModel=ur;i.FiltersStatusBarViewModel=fr;i.FiltersBar=wf;i.FiltersBarItem=pf;i.FiltersBarItemData=yf;i.SignInState=bt;i.CollectionsTaskResponseProcessor=lr;i.ButtonGroupViewModel=ar;i.MobileSettingsPage=gf;i.TabControlRequester=af;i.TransientLensViewModel=et;i.PoiTransientLensViewModel=ai;i.DetailsPoiTransientLensViewModel=he;i.CollectionsPoiTransientLensViewModel=se;i.ItineraryPoiTransientLensViewModel=ce;i.TransientLens=le;i.MapsInfobox=df;i.PoiOverlayEntity=fi;v.TransientLensActions=n;i.CommonControls=i.CommonControls||{};i.CommonControls.ServerSideAds=pi;i.CommonControls.TnAAds=du;i.CommonControls.AutosuggestViewModel=nf;i.CommonControls.AutosuggestV2=ir;i.CommonControls.MobileAutosuggestV2=rf;i.CommonControls.ListDropdownViewModel=ht;i.CommonControls.SuggestionViewModelV2=li;i.CommonControls.CollectionsListDropdownViewModel=ki;i.CommonControls.DirectionsAutosuggestDataModel=ui;i.CommonControls.DirectionsListDropdownViewModel=or;i.CommonControls.SelectionListDropdownViewModel=sr;i.CommonControls.ItineraryDaysDropdownViewModel=hr;i.CommonControls.ModalDialogViewModel=vf;i.CommonControls.PopOutButtonViewModel=di;i.CommonControls.PopOutMessageViewModel=er;i.CommonControls.AutosuggestDataModel=ri;i.CommonControls.SearchBoxAutosuggestDataModel=uf;i.CommonControls.CollectionsAutosuggestDataModel=tf;i.CommonControls.CollectionPopOutMessageViewModel=bi;i.CommonControls.SearchHistoryLocalStorageHelper=rr;i.CommonControls.TaskBarDropdownViewModel=ee;i.CommonControls.DropdownItem=ne}catch(vr){if(i.logger)i.logger.logCriticalError(vr);else throw vr;}}).call(window)