var AutoSuggest;(function(n){var t;(function(t){function c(n){return n.toLocaleLowerCase().replace(a,"").trim()}function l(n,t,i,r,u){if(!n)return i;if(typeof n!="string")try{return{content:URL.createObjectURL(n),type:0,bgColor:r}}catch(f){return SharedLogHelper.LogError("convertToHtmlImage "+t,u,f),i}else return{content:n,type:0,bgColor:r}}function o(n,t){var i=parseInt(n.substr(1),16),r=i>>16&255,u=i>>8&255,f=i&255;return"rgba("+r+","+u+","+f+","+t+")"}function y(n,t){var i=parseInt(n.substr(1),16),r=Math.max(0,(i>>16)-t),u=Math.max(0,(i>>8&255)-t),f=Math.max(0,(i&255)-t);return"#"+String("000000"+(f|u<<8|r<<16).toString(16)).slice(-6)}function s(n,t){var i=parseInt(n.substr(1),16),r=Math.max(0,(i>>16)*t),u=Math.max(0,(i>>8&255)*t),f=Math.max(0,(i&255)*t);return"#"+String("000000"+(f|u<<8|r<<16).toString(16)).slice(-6)}var i,e,r,u,f,a=/[\.,:;?!¿¡]/g,h=-933981677285477,v=400;t.toIcon=l;var p={"action://Help/Launch":t.config.htmlHelpCanvas?"Help":"SpeechHelp","ms-cortana://navigate/Notebook":"Notebook"},w={"ms-cortana://navigate/Settings":t.config.settingsUri},b=function(){function a(o){var s=this;this._accessTokenManager=o;this._queryParamsCache={};this._locStrings=[];this._enUsLocStrings=[];this._modifierKeyState={altKey:!1,ctrlKey:!1,shiftKey:!1};this._appVisibleEventHandlers=[];this._shownEventHandlers=[];this._conversationStartEventHandlers=[];this._dismissedEventHandlers=[];this._appHiddenEventHandlers=[];this._searchBoxGotFocusEventHandlers=[];this._searchBoxLostFocusEventHandlers=[];this._onSubmitHandlers=[];this._onSearchBoxGlyphIconClick=[];this._onSearchBoxClick=[];this._onButtonRightOfSearchBoxClick=[];this._queryChangedHandlers=[];this._rawQueryChangedHandlers=[];this._keyDownHandlers=[];this._keyUpHandlers=[];this._accessTokenAvailableHandlers=[];this._state=0;this._pinnedApps={};this._paneCloseCount=0;this._qfDismissCount=0;this._currentPaneHeight=0;this._root=_ge("root");this.usedImpressionIds={};this.getEdgeIcon=function(n,t){return s._edgeIconCache(n,t)};this._suggestionsContainer=_ge("suggestionsList");n.safeExecute(function(){var c,o;i=SearchAppWrapper.CortanaApp;e=i.queryFormulationView;r=i.launcher;u=i.searchBox;f=n.Service.QueryParams;n.refreshBingEnabledCache(i.isBingEnabled,t.getMarketForBingAvailability());s._currentCVID=n.cleanGuid(s.createGuid());s._randomPrivacyNumber=s.getNewPrivacyNumber();s.initLanguage();c=n.safeExecute(function(){return+e.perfMetrics.lookup(32)},"perfMetricsFallbackLookup",h);s._hasFallbackHappened=c!=h;o=e.searchHistory;o?o.addEventListener("cleardevicehistoryrequested",function(){n.log("clearDeviceHistoryRequested");var t=function(t){return n.safeExecute(function(){n.log(t?"clearDeviceHistory succeded":"clearDeviceHistory failed");o.signalClearDeviceHistoryCompleted(t)},"signalClearDeviceHistoryCompleted")};s._clearStorageRequestedEventHandler?(n.log("calling clearDeviceHistoryRequested handler"),n.safeExecute(function(){return s._clearStorageRequestedEventHandler(t),!0},"clearDeviceHistoryRequested")||t(!1)):(n.log("no handler for clearDeviceHistoryRequested"),t(!1))}):n.log("searchHistory not available");i.addEventListener("statechanged",function(n){return s.updateState(s._state,n.newState,!1)});u.addEventListener("querytextchanged",function(n){var t=n.queryText;s._queryPropertiesOverrides&&s._queryPropertiesOverrides.query!=t&&(s._queryPropertiesOverrides=null);s.updateState(s._state,2,!0);s._queryToIgnoreOnQueryTextChangedEvent!=n.queryText&&(s._queryToIgnoreOnQueryTextChangedEvent=null);s.callQueryChangedHandlers(n,!1,s._queryToIgnoreOnQueryTextChangedEvent!=null,n.impressionId)});u.addEventListener("keydown",function(i){var f=i.keyCode,e={shiftKey:i.isShiftKeyPressed,ctrlKey:i.isControlKeyPressed,altKey:!1},r,u;t.config.searchBoxFocusEvents||(r=n.getCurrentActiveElement(),r&&!t.isBodyOrSuggestion(r)&&r.blur());u=i.isHandled;s._keyDownHandlers.forEach(function(t){return n.safeExecute(function(){return t(f,e,u)},"keyDown")})});sj_b.addEventListener("keydown",function(i){var u=i.keyCode,f=i.target,h=t.alwaysWide||t.config.enableLocalPreviewPaneInSingleColumn,e,o,r;if(i.target){if(e=_ge("fbpgdg"),e&&e.contains(f))return;if(u==13&&f.classList.contains("dropDownButton"))return;if(f.classList.contains("menuItem")){sj_pd(i);return}if(!h&&t.previewPaneAvailable&&(r=_ge("qfPreviewPane"),r&&r.contains(f)))if(u==37)sj_pd(i);else return}if(n.contains([38,40],u)&&sj_pd(i),s.isRequestFocusAvailable()&&!t.config.allowUpForScopes){if(u==13)return;n.contains([38,40],u)&&(o=!0,h&&(r=_ge("qfPreviewPane"),o=!r||!r.contains(f)),o&&s.setFocusInSearchBox("keyDown"))}s._keyDownHandlers.forEach(function(t){return n.safeExecute(function(){return t(i.keyCode,i)},"body.keyDown")})});u.addEventListener("keyup",function(t){var i=t.keyCode,r={shiftKey:t.isShiftKeyPressed,ctrlKey:t.isControlKeyPressed,altKey:!1},u=t.isHandled;s._keyUpHandlers.forEach(function(t){return n.safeExecute(function(){return t(i,r,u)},"keyUp")})});sj_b.addEventListener("keyup",function(t){return s._keyUpHandlers.forEach(function(i){return n.safeExecute(function(){return i(t.keyCode,t)},"keyUp")})});u.addEventListener("gotfocus",function(){return s._searchBoxGotFocusEventHandlers.forEach(function(t){return n.safeExecute(function(){return t()},"gotfocus")})});u.addEventListener("lostfocus",function(){return s._searchBoxLostFocusEventHandlers.forEach(function(t){return n.safeExecute(function(){return t()},"lostfocus")})});u.addEventListener("submitbuttonclick",function(){var r=n.getCurrentTime(),i=s.getFeatureString("SubmitButtonGlyph").featureValue;i&&i!=""||t.qfMode==2?s._onButtonRightOfSearchBoxClick.forEach(function(t){return n.safeExecute(function(){return t(i)},"submitbuttonclick.custom")}):s._onSubmitHandlers.forEach(function(t){return n.safeExecute(function(){return t(r,!0,null)},"submitbuttonclick")})});u.addEventListener("searchboxglyphclick",function(){return s._onSearchBoxGlyphIconClick.forEach(function(t){return n.safeExecute(function(){return t()},"searchboxglyphclick")})});u.addEventListener("searchboxtapped",function(){return s._onSearchBoxClick.forEach(function(t){return n.safeExecute(function(){return t()},"searchboxtapped")})});u.addEventListener("searchboxclick",function(){return s._onSearchBoxClick.forEach(function(t){return n.safeExecute(function(){return t()},"searchboxclick")})});sj_evt.bind("ajax.feedback.initialized",function(){return s.registerFeedbackDebugCallback},!0)},"WindowsHostInit");this.bindAppVisible(function(){return s.appVisibleInit()});this.bindShown(function(){n.safeFireEvent("ajax.threshold.pageStart",n.getCurrentTime());s.shownInit();var t=s.getNewConversationId();s._currentCVID!=t&&(s._currentCVID=t,s._randomPrivacyNumber=s.getNewPrivacyNumber(),s._conversationStartEventHandlers.forEach(function(t){return n.safeExecute(function(){return t()},"conversationStart")}));s._lastKeyWasEnter=!1});this.bindDismissed(function(){s._qfDismissCount+=1;n.safeFireEvent("WindowsFeedback.Form.Hide");n.safeFireEvent("threshold.pageUnload");s.dismissCleanup()});this.bindAppHidden(function(){s._paneCloseCount+=1;s.appHiddenCleanup();s.uploadClientErrorLog()});this.bindKeyDown(function(r,f){var e,o;s._modifierKeyState=f;e=r==13;e&&!s._lastKeyWasEnter&&(o=n.getCurrentTime(),s._onSubmitHandlers.forEach(function(t){return n.safeExecute(function(){return t(o,!1,f)},"onSubmit handlers")}));s._lastKeyWasEnter=e;r==27&&(t.qfMode==3||t.qfMode==2)&&(u.getQueryText().queryText?n.safeExecute(function(){return u.setQueryText("",!0)},"setQueryText"):n.safeExecute(function(){return i.dismissApp()},"dismissApp"))});this.bindKeyUp(function(n){s._lastKeyWasEnter=!1;switch(n){case 16:s._modifierKeyState.shiftKey=!1;break;case 17:s._modifierKeyState.ctrlKey=!1}});_G.PN="QF";this._edgeIconCache=t.Promise.safeChainWithGlobalCaching("edgeIcon",function(n){return e.deviceSearch.findAppsAsync([t.EdgeAppId]).then(function(i){var r=i[t.EdgeAppId];return r.getImageAsync(t.getImageSizeValue(n)).then(function(n){return l(n,"edgeIcon",null,r.logoBackgroundColor)})})},function(n){return n+"_edgeIcon"});!t.isMobileCache&&i.setDefaultUriLaunchPolicy&&i.setDefaultUriLaunchPolicy(2);sj_evt.bind("onFeedbackStarting",function(){s._feedbackFormIsVisible=!0;s.adjustHeight()});sj_evt.bind("onFeedbackClosing",function(){s._feedbackFormIsVisible=!1;s.adjustHeight()});this.enumerateAccountAuthority(this._qfDismissCount)}return a.prototype.uploadClientErrorLog=function(){var o,u,e,t,f,r;if(i.getFlightingLogsAndDelete)for(o=n.safeExecute(function(){return i.getFlightingLogsAndDelete()},"getFlightingLogsAndDelete",""),u=0,e=o.split("\r\n");u=t.config.minLengthFor3SonL1||t.isL2(f._currentQuery))&&f._currentQuery.originalQuery==u.getQueryText().queryText&&t.ScopeConfig[f._currentQuery.scope].enabledDataSources.some(s)&&f.refreshCurrentPane())},t.getAuthAccountForCloudContent())},a.prototype.appHiddenCleanup=function(){t.Promise.clearGlobalCache();this._locStrings=[];t.cleanScopePrefixes();this.cleanTaskBarPinnedItems();t.clearPathExpansionCache()},a.prototype.initLanguage=function(){var r,u,e;t.uiLanguageCache=i.systemLanguage||i.uiLanguage;this.initCortanaEnabledAndRegion();t.homeGeographicRegionCache=i.homeGeographicRegion;this._queryParamsCache[n.Service.QueryParams.SetLang]=t.uiLanguageCache;var o=this._enUsLocStrings.length==0,s=function(i){var r={uiCulture:"en-US",name:i,namespace:"AutoSuggest"},u;o&&f._enUsLocStrings.push(LocStringManager.getLocString(r));t.uiLanguageCache.toLowerCase()!="en-us"&&(r.uiCulture=t.uiLanguageCache,u=n.safeExecute(function(){return LocStringManager.getLocString(r)},"getLocString",null,r.uiCulture),u&&f._locStrings.push(u))},f=this;for(r=0,u=t.config.locStrings;r1.25,u,f;try{u=i.isWideSearch}catch(o){}f=u!==!1&&!!this.getFeatureDWORD("WideAtStartupDelta").featureValue;t.isAndromedaCache?(t.previewPaneAvailable=!1,t.qfMode=4,t.alwaysWide=!1,t.searchBoxOnTop=!0,t.scopesAvailable=!1,t.flatListWithoutGroups=!0,t.flatListWithoutGroupsZeroInput=!1,t.maxSuggestionsWhenFlatList=t.config.maxSuggestionsWhenFlatList,t.previewPaneAvailable=!1,t.zeroInputAvailable=!0,t.setZeroInputDataSourcesForL1(!0)):i.hostingEnvironment==1||t.config.tabShellInCoss&&i.isCenterScreen?(t.previewPaneAvailable=!1,t.qfMode=3,t.alwaysWide=!1,t.searchBoxOnTop=!0,t.scopesAvailable=!1,t.flatListWithoutGroups=!0,t.flatListWithoutGroupsZeroInput=!0,t.maxSuggestionsWhenFlatList=t.config.maxSuggestionsWhenFlatList,t.zeroInputAvailable=!0,t.setZeroInputDataSourcesForL1(!0)):i.isCenterScreen?(t.previewPaneAvailable=!0,t.qfMode=2,t.alwaysWide=!0,t.searchBoxOnTop=!0,t.scopesAvailable=t.config.scopesOrderBeginAlwaysWide.length>0,t.flatListWithoutGroups=!1,t.flatListWithoutGroupsZeroInput=t.config.enableFlatListImmersiveSearchZeroInput,t.maxSuggestionsWhenFlatList=t.config.maxSuggestionsImmersiveSearchZeroInput,t.zeroInputAvailable=!0,t.setZeroInputDataSourcesForL1(!0)):f&&!e?(t.previewPaneAvailable=!0,t.qfMode=1,t.alwaysWide=!0,t.searchBoxOnTop=!1,t.scopesAvailable=t.config.scopesOrderBeginAlwaysWide.length>0,t.flatListWithoutGroups=!1,t.flatListWithoutGroupsZeroInput=!1,t.maxSuggestionsWhenFlatList=0,t.zeroInputAvailable=!0,t.setZeroInputDataSourcesForL1(!1)):(t.previewPaneAvailable=t.PreviewPane&&!f&&u!==!1,t.qfMode=t.previewPaneAvailable?0:4,t.alwaysWide=!1,t.searchBoxOnTop=!1,t.scopesAvailable=t.config.scopesOrderBegin.length>0,t.flatListWithoutGroups=!1,t.flatListWithoutGroupsZeroInput=!1,t.maxSuggestionsWhenFlatList=0,t.zeroInputAvailable=!1,t.setZeroInputDataSourcesForL1(!1));t.isCloudSearchEnabledCache=i.isCloudSearchEnabled!==!1;this.initLanguage();n.refreshBingEnabledCache(i.isBingEnabled,t.getMarketForBingAvailability());t.initScopePrefixes(function(n){return r.getLocString(n)},function(n){return r.getEnUsLocString(n)});t.scopeListRequiresUpdate=!0;this.populateTaskbarPinnedItemsAsync();this._suggestionsContainer.setAttribute("aria-label",this.getLocString("ResultsList"));this._elToken=null;ThresholdUtilities.getThemeColor(function(n){n!=r._accentColor&&(r._accentColor=n,r.applyAccentColor(n))});ThresholdUtilities.setBodyLangAttributes(t.uiLanguageCache)},a.prototype.shownInit=function(){var r=this,u=this._qfDismissCount,e;this.initCortanaEnabledAndRegion();e=i.isBingEnabled;e!=n.isBingEnabled()&&(n.refreshBingEnabledCache(e,t.getMarketForBingAvailability()),t.initScopePrefixes(function(n){return r.getLocString(n)},function(n){return r.getEnUsLocString(n)}),t.scopeListRequiresUpdate=!0);this._queryParamsCache[f.CountryCode]=t.regionCache;t.homeGeographicRegionCache&&t.homeGeographicRegionCache!=t.regionCache&&(this._queryParamsCache[f.HomeGeographicRegion]=t.homeGeographicRegionCache);t.isCortanaEnabledCache&&i.getVcdKeywordsAsync&&t.Promise.safeChain("vcdKeywords",function(){return i.getVcdKeywordsAsync()},function(n){u==r._qfDismissCount&&(r._vcdKeywords=n)});this.enumerateAccountAuthority(u);this.initHeadersOverrides(u);t.config.keepCortanaOpened&&i.changeExplicitDismissMode&&i.changeExplicitDismissMode(!0)},a.prototype.initCortanaEnabledAndRegion=function(){if(t.qfMode==3)t.isCortanaEnabledCache=!1,t.regionCache=t.homeGeographicRegionCache;else{var n=SearchAppWrapper.CortanaApp;t.isCortanaEnabledCache=n.isCortanaEnabled;t.regionCache=n.region}},a.prototype.enumerateAccountAuthority=function(n){var r=this;t.config.wamSupported&&t.Promise.safeChain("enumerateAccountAuthorityAsync",function(){return i.authenticationManager.enumerateAccountAuthorityAsync()},function(i){var u,f;t.windowsAccountType==0&&(u=i.Windows,t.windowsAccountType=u=="organizations"?1:u=="consumers"?2:3,t.initScopePrefixes(function(n){return r.getLocString(n)},function(n){return r.getEnUsLocString(n)}),t.scopeListRequiresUpdate=!0,t.windowsAccountType!=3&&r._accessTokenManager&&(f=t.accountTypeToAuthType(t.windowsAccountType),r._accessTokenManager.getAccount(f,t.getBingResourceOrScope(f),!1,!0,function(n){return t.windowsIdentity=n&&n.UserName?n.UserName:""},"Windows")));n==r._qfDismissCount&&(u=t.qfMode==3?null:i.Cortana,t.cortanaAccountType=u=="organizations"?1:u=="consumers"?2:3,t.config.useCortanaAccountFor3S&&(t.initScopePrefixes(function(n){return r.getLocString(n)},function(n){return r.getEnUsLocString(n)}),t.scopeListRequiresUpdate=!0));t.isCloudSearchEnabledCache&&t.substrateProvidersEnabled()&&(u=t.getAccountTypeForCloudContent(),u==1?r.tryConnect(1,n):u==2&&t.qfMode!=3&&r.tryConnect(0,n));t.windowsAccountType==t.cortanaAccountType&&t.windowsAccountType!=3&&r._accessTokenManager&&(f=t.accountTypeToAuthType(t.cortanaAccountType),r._accessTokenManager.getAccount(f,t.getBingResourceOrScope(f),!1,!0,function(n){return t.cortanaIdentity=n&&n.UserName?n.UserName:""},"Cortana"));r.initHeadersOverrides(n)})},a.prototype.dismissCleanup=function(){delete this._queryParamsCache[f.HomeGeographicRegion];t.config.wamSupported||(t.windowsAccountType=0);t.cortanaAccountType=0;t.cortanaIdentity=null;this._queryToIgnoreOnQueryTextChangedEvent=null;this._currentQuery=null;this._vcdKeywords=null;t.regionCache=null;typeof WindowsFeedbackForm!="undefined"&&WindowsFeedbackForm.Remove()},a.prototype.getAccentColor=function(){return this._accentColor},a.prototype.initHeadersOverrides=function(r){var f=this,u=[],e,o;this._headersCache={};i.systemRAMInMB&&i.systemRAMInMB<=512&&u.push("LowMemoryDevice");u.push("FontV21");u.push("LightAnswers");t.previewPaneAvailable&&u.push("PreviewPaneAvailable");t.isSmallerAnswersUX()&&u.push("SmallerAnswers");this.getFeatureEnabled("UseQFAsHomeExperience").featureEnabled&&u.push("UseQFAsHomeExperience");u.length>0&&(this._headersCache["X-BM-ClientFeatures"]=u.join());t.qfMode==3&&(this._headersCache["X-Device-isOptin"]="false",this._headersCache["X-Search-CortanaAvailableCapabilities"]="",this._headersCache["X-BM-UserDisplayName"]="",e=i.newTabPage.location,this._headersCache["X-Search-Location"]=e,this._shouldRequestEltoken=!!e,t.cortanaAccountType!=3&&(this._headersCache["X-Search-RPSToken"]="NA",this._headersCache.Authorization="Bearer NA",o=this._headersCache,t.windowsAccountType==2?this._accessTokenManager.getAccount(0,t.getBingResourceOrScope(0),!1,!0,function(n){return o["X-Search-RPSToken"]=n&&n.Token?n.Token:""},"Windows"):t.windowsAccountType==1&&this._accessTokenManager.getAccount(1,t.getBingResourceOrScope(1),!1,!0,function(n){return o.Authorization=n&&n.Token?"Bearer "+n.Token:""},"Windows")));ThresholdUtilities.getCortanaHeaders(function(e){if(e&&r==f._qfDismissCount){t.qfMode!=3&&(f._shouldRequestEltoken=!!e["X-Search-Location"]);var o=e["X-BM-ClientFeatures"];o&&(Array.prototype.push.apply(u,o.split(",")),f._headersCache["X-BM-ClientFeatures"]=u.join());f._safeSearchSetting=e["X-Search-SafeSearch"];f._isEducationEnvironment=e["X-Device-EnableRegulatoryPsm"]=="1";f._isWindowsS=e["X-Device-EnableCPsm"]=="1";f._partnerSearchCode=e["X-Device-PSC"];t.config.cortanaCapabilitiesAvailable?(t.availableCortanaCapabilities=t.isCortanaEnabledCache?n.safeExecute(function(){return i.getCortanaCapabilities()},"getCortanaCapabilities","").split(","):[],t.isCortanaPersonalized=n.contains(t.availableCortanaCapabilities,"Personalization")):(t.availableCortanaCapabilities=[],t.isCortanaPersonalized=!!e["X-Search-RPSToken"]&&t.isCortanaEnabledCache);t.config.wamSupported||(t.isCortanaPersonalized?e["X-Search-RPSToken"]?t.cortanaAccountType=2:e.Authorization&&(t.cortanaAccountType=1):(t.cortanaAccountType=3,e["X-Search-RPSToken"]?t.windowsAccountType=2:e.Authorization&&(t.windowsAccountType=1)));t.substrateProvidersEnabled()||(t.scopeListRequiresUpdate=!0)}})},a.prototype.applyAccentColor=function(t){var u,f="accent-style",r=_ge(f),i;r||(r=_d.createElement("style"),r.setAttribute("id",f),r.type="text/css",u=!0);i=".icon svg { fill: {0} } .gridLayout .suggestion.sa_hv, .gridLayout .suggestion.sa_hv:hover { border-color: {1}; }";n.isHighContrastEnabled()||(i+=".action .annotation, .accentColor, .accentColor:visited { color: {0}; } .sa_hv, .scr .sa_hv:hover, .scr .sa_hv.selectable:active { background-color: {1}; } .sa_hv.action .annotation { color: {7}; }",i+="#footer { background-color: {8}; }",i+="#footer:hover { background-color: {9}; }",i+="#footer:active { background-color: {10}; }",i+=".topHitConnectedToGroup:not(.sa_hv):not(.previewPaneOpened) { background: {2}; }",i+="#root .selectedScope { background-color: {3}; }",i+="#root .selectedScope:hover { background-color: {4}; }",i+="#root .selectedScope:active { background-color: {5}; }",i+="#root.wideByDefault .selectedScope { border-color: {0}; }",i+="#root.immersiveSearch .selectedScope { border-color: {0}; }",i+="#startMenu .icon { background-color: {5}; }",i+=".accentButtonBackground { background-color: {6}; }",i+=".accentButtonBackground:focus { background-color: {1}; }",i+=".scopeOptions input[type='button'], .topOptions input[type='button'] { background-color: {0}; border-color: {0} }",i+=".scopeOptions input[type='button']:hover, .topOptions input[type='button']:hover { border-color: {3} }",i+=".expanderInnerCircle { background-color: {0}; }",i+="#previewContainer .hr-expander.selectedExpander hr, #previewContainer .hr-expander:hover hr { border-color: {0} }");r.innerHTML=n.formatString(i,[t,o(t,.3),o(t,.1),o(t,.4),o(t,.6),o(t,.7),o(t,.15),y(t,35),s(t,.65),s(t,.8),s(t,.9),]);u&&_d.head.appendChild(r)},a.prototype.createGuid=function(){return n.safeExecute(function(){return i.createGuid()},"createGuid","")},a.prototype.getLocString=function(t){for(var i,u,e,o,f=[],r=1;r0&&(i=n.formatString(i,f)),i},a.prototype.getEnUsLocString=function(n){for(var u,r,t=0,i=this._enUsLocStrings;t=0&&((f=this._vcdKeywords[r],f&1)||f&2&&u==0||f&4&&(u==t.length-i.length||(e=t.lastIndexOf(i),e==t.length-i.length))))))return!0;return!1},a.prototype.isRequestFocusAvailable=function(){return!!u.requestFocus},a.prototype.setFocusInSearchBox=function(t){if(this.isRequestFocusAvailable()){n.safeExecute(function(){return u.requestFocus()},"requestFocus",null,t);var i=n.getCurrentActiveElement();i&&i.blur()}},a.prototype.getFeatureEnabled=function(t){var r={validFeature:!1,featureEnabled:!1};return i.getFeatureEnabled?n.safeExecute(function(){return i.getFeatureEnabled(t)},"getFeatureEnabled",r,t):r},a.prototype.getFeatureDWORD=function(t){var r={validFeature:!1,featureValue:0};return i.getFeatureDWORD?n.safeExecute(function(){return i.getFeatureDWORD(t)},"getFeatureDWORD",r,t):r},a.prototype.getFeatureString=function(t){var r={validFeature:!1,featureValue:""};return i.getFeatureString?n.safeExecute(function(){return i.getFeatureString(t)},"getFeatureString",r,t):r},a.prototype.launchInApp=function(i,r,f){this.updateQueryWithoutRefetching(r);n.safeExecute(f,i);t.isMobileCache&&u.requestUnfocus&&n.safeExecute(function(){return u.requestUnfocus()},"requestUnfocus",null,i)},a.prototype.launchVoiceFlow=function(n){var t=this;this.launchInApp("launchVoiceFlow",n,function(){return r.launchRAFAsync(n,t.getFormCode(),t.getInstrumentationParameters())})},a.prototype.launchSearch=function(n,u,f){var e=this;f?this.launchVoiceFlow(n):t.isMobileCache?this.launchInApp("launchSearch",n,function(){var t=r.createSearchLaunchOptions();t.searchQuery=n;var i=u.indexOf("/search"),f=u.indexOf("/",u.indexOf("//")+2),e=f==i?"":u.substring(f+1,i);e&&(t.pivot=e);t.mode=1;t.uriContext=u.substr(u.indexOf("&")+1);r.launchSearchAsync(t)}):i.setDefaultUriLaunchPolicy?t.Promise.safeChain("launchSearch",function(){return r.launchUriAsync(u)},function(n){n&&e.manuallyDismissApp()}):t.Promise.safeChain("launchSearchTH1",function(){return r.launchUriAsync("microsoft-edge:"+u)})},a.prototype.launchCat1=function(n,u,f){var s=this,o=p[u],e;o?this.launchInApp("launch"+o,n,function(){return i.launchExperienceByName(o,null)}):(e=w[u],e?t.Promise.safeChain("launchCat1 "+e,function(){return r.launchUriAsync(e)},function(n){n&&s.manuallyDismissApp()}):this.launchInApp("launchCat1",n,function(){return r.launchCat1Async(n,f,s.getInstrumentationParameters())}))},a.prototype.launchCat2or3a=function(n,t){var i=this;this.launchInApp("launchCat2",n,function(){return r.launchCat2Async(n,i.getFormCode(),t,i.getInstrumentationParameters())})},a.prototype.launchStorePdp=function(i){var u=this,f="ms-windows-store:pdp?ProductId="+n.encodeQueryParameter(i)+"&ocid="+n.encodeQueryParameter(t.config.storeHandoffTag);t.Promise.safeChain("launchStorePdp",function(){return r.launchUriAsync(f)},function(n){n&&u.manuallyDismissApp()})},a.prototype.launchStoreSearch=function(i){var u=this,f="ms-windows-store:search?query="+n.encodeQueryParameter(i)+"&ocid="+n.encodeQueryParameter(t.config.storeHandoffTag)+"&type=apps";t.Promise.safeChain("launchStoreSearch",function(){return r.launchUriAsync(f)},function(n){n&&u.manuallyDismissApp()})},a.prototype.launchFolder=function(t){var i=this;n.safeExecute(function(){return r.startLaunchFolder(t)},"launchFolder");sb_st(function(){return i.manuallyDismissApp()},0)},a.prototype.launchWindowsCortanaSettings=function(){this.launchUrl("ms-settings:cortana")},a.prototype.launchWindowsIndexingOptions=function(){t.LocalDataProvider.launchIndexingOptions(this,!1)},a.prototype.launchCortanaSignIn=function(){this.launchUrl("ms-cortana://CapabilitiesPrompt/?RequestedCapabilities=Personalization")},a.prototype.launchCortanaHome=function(){this.launchUrl("ms-cortana://StartMode=Coobe")},a.prototype.launchCortanaNotebook=function(){this.launchUrl("ms-cortana://StartMode=Notebook")},a.prototype.launchCortanaDevices=function(){this.launchUrl("ms-cortana://StartMode=Devices")},a.prototype.launchWindowsAccountSettings=function(){this.launchUrl("ms-settings:emailandaccounts")},a.prototype.getErrorCodeToIgnoreOnLaunch=function(n){return t.isIndexerBasedDataSource(n)||n=="PT"?-2147467263:undefined},a.prototype.launchDeviceItem=function(i,u){var s=this,f=i.id,e=u,o;t.localDataSourceMayContainPII(u)||(e+="\n"+f);f.startsWith("shell:")?n.safeExecute(function(){return r.startLaunchFolder(f)},"launchDeviceItem",null,e):(o=i.originalDeviceItem||i,t.Promise.safeChain("launchDeviceItem",function(){return r.launchSearchItemAsync(o)},function(){return s.manuallyDismissApp()},null,null,e,this.getErrorCodeToIgnoreOnLaunch(u)))},a.prototype.launchAppItem=function(i,u,f){var h=this,e=i.id,o=u+"\n"+e,s;f&&o+"\n"+f;e.startsWith("shell:")?n.safeExecute(function(){return r.startLaunchFolder(e)},"launchAppItem",null,o):(s=i.originalDeviceItem||i,t.Promise.safeChain("launchAppItem",function(){var n;return f&&(n=r.createAppLaunchOptions(),n.appContext=f),r.launchSearchItemAsync(s,n)},function(){return h.manuallyDismissApp()},null,null,o,this.getErrorCodeToIgnoreOnLaunch(u)))},a.prototype.launchWebContent=function(n,t,i){this.launchInApp("launchWebContent",t,function(){var t=r.createWebContentLaunchOptions();t.uri=n;i&&t.setAuthorization("Bearer",i);r.launchWebContent(t)})},a.prototype.getCustomUrlParameters=function(i){var r=Object.assign({},this._queryParamsCache),u=i.scope;return u==t.Scope.All?delete r[f.Scope]:r[f.Scope]=t.Scope[u].toLowerCase(),t.searchHistoryAllowed()||(r[n.Service.QueryParams.NoHistory]="1"),r},a.prototype.getCustomHeaders=function(){return Object.assign({},this._headersCache)},a.prototype.reloadWebView=function(n){var r=this;n?t.Promise.safeChain("repopulateAppCacheAsync",function(){return i.repopulateAppCacheAsync()},function(){return r.reloadWebView(!1)}):t.Promise.safeChain("reloadWebViewAsync",function(){return i.reloadWebViewAsync()})},a.prototype.throwIfResourcesMissing=function(){var t=_ge("cssCanary"),n=_w.getComputedStyle(t).fontFamily;if(n!="CANARY"&&n!='"CANARY"')throw new Error("Missing CSS Bundle");},a.prototype.getFormCode=function(){if(t.qfMode==3)switch(i.newTabPage.pageInfo.pageType){case 2:return"TSPEAA";case 3:return"TNTEAA";default:return"TNTAAA"}return"WNSGPH"},a.prototype.getRegion=function(){return t.regionCache},a.prototype.getLanguage=function(){return t.uiLanguageCache},a.prototype.dataSourceDependencies=function(t){return t==n.WebDataSource?["OSTMA","QS"]:[]},a.prototype.getPaneCloseCount=function(){return this._paneCloseCount},a.prototype.hasFallbackHappened=function(){return this._hasFallbackHappened},a.prototype.getSafeSearchSetting=function(){return this._safeSearchSetting},a.prototype.isEducationEnvironment=function(){return this._isEducationEnvironment},a.prototype.isWindowsS=function(){return this._isWindowsS},a.prototype.getPartnerSearchCode=function(){return this._partnerSearchCode},a.prototype.getMSNRefIg=function(){return t.qfMode==3?i.newTabPage.pageInfo.pageId:null},a.prototype.setSearchBoxGlyphIcon=function(t){var i,r,f;u.setSearchBoxGlyphIcon&&(t?(i=t.content||"",i.startsWith("&#x")&&(r=parseInt(i.substr(3),16),i=r?String.fromCharCode(r):""),f=t.type==2?"/Assets/Fonts/CortMDL2.ttf#Cortana MDL2 Assets":"",n.safeExecute(function(){return u.setSearchBoxGlyphIcon(i,f)},"setSearchBoxGlyphIcon custom")):n.safeExecute(function(){return u.setSearchBoxGlyphIcon("","")},"setSearchBoxGlyphIcon default"))},a.prototype.promptAutheticateDialog=function(i,r,u,f){var e=this,o=function(r){var o=!!r;i==1?t.isSubstrateO365AccountConnected=o:t.isSubstrateOutlookAccountConnected=o;o?(u(),e._accessTokenAvailableHandlers.forEach(function(t){return n.safeExecute(function(){return t(i)},"promptAccessTokenAvailable",null,i.toString())})):f()};this._accessTokenManager.getAccount(i,r,!1,!1,o,t.getAuthAccountForCloudContent())},a.prototype.adjustHeightWithoffset=function(){},a.prototype.adjustHeight=function(){var u=this,n,r;t.qfMode==3&&i.setWebViewHeight&&(this._pendingAdjustHeightTimer&&(sb_ct(this._pendingAdjustHeightTimer),this._pendingAdjustHeightTimer=null),t.config.th&&ClientTestHooks.isTesthookParamSet("searchbox")&&(this._root.style.height=""),n=this._feedbackFormIsVisible?v:this._root.offsetHeight,r=function(){i.isCenterScreen&&i.setCenterScreenAcrylicBackgroundHeight(n+2);i.setWebViewHeight(n);u._currentPaneHeight=n;u._pendingAdjustHeightTimer=null},!t.config.paneResizeDelay||n>=this._currentPaneHeight?r():this._pendingAdjustHeightTimer=sb_st(r,t.config.paneResizeDelay))},a.prototype.isClientLocationAvailable=function(){return this._shouldRequestEltoken||!!this._elToken},a}();t.Host=b})(t=n.WSB||(n.WSB={}))})(AutoSuggest||(AutoSuggest={}))