| Server IP : 123.56.80.60 / Your IP : 216.73.216.78 Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586 User : SYSTEM ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Windows/SystemApps/Microsoft.Windows.Cortana_cw5n1h2txyewy/cache/Mobile/ |
Upload File : |
var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},AutoSuggest;(function(n){var i=function(){function t(n,t){t===void 0&&(t=0);this._config=n;this._delay=t}return t.prototype.getDataSource=function(){return undefined},t.prototype.getBaseUrl=function(){return undefined},t.prototype.getPostBody=function(){return undefined},t.prototype.onBeforeFetchUrl=function(){},t.prototype.fetch=function(t,i,r,u,f,e,o,s){var c=this,h,l,a;if(n.isDataSourceEnabled(this.getDataSource(),t,this._config)){if(h=decodeURIComponent(this.getBaseUrl())+encodeURIComponent(t.queryToFetch.toLowerCase()),e)for(l in e)h+="&"+l+"="+e[l];if(a=this.getPostBody(t),this._timer&&(sb_ct(this._timer),this._timer=null),this._delay>0&&!t.isFormulatedQuery)this._timer=sb_st(function(){return n.safeExecute(function(){sb_ct(c._timer);c._timer=null;c.onBeforeFetchUrl(r,h);c.fetchUrl(h,o,a,i,u,f,s)},"fetchDelay")},this._delay);else{this.onBeforeFetchUrl(r,h);this.fetchUrl(h,o,a,i,u,f,s)}}},t.prototype.fetchUrl=function(t,i,r,u,f,e,o){var h=this,s=sj_gx(),c;if(s.open(r?"POST":"GET",t,!0),i)for(c in i)s.setRequestHeader(c,i[c]);s.onreadystatechange=function(){var r,i;e()&&s.readyState==4&&(s.onreadystatechange=function(){},u&&((s.status==200||s.status===401||s.status===403)&&(i=s.responseText,h._config.th&&i&&(i=i.replace(new RegExp("<!--[^]*?-->","gm"),"")),r=i?n.safeExecute(function(){return JSON.parse(i)},"parseWebProviderResponse",null,i.substr(0,200)):null),u(h.getDataSource(),r,null)),o&&s.status!=200&&SharedLogHelper.LogError("fetchUrl",h._config.th?null:"url: "+t,"statusCode: "+s.status))};s.withCredentials!==undefined&&(s.withCredentials=!0);s.send(r)},t}(),t,r;n.JsonDataProvider=i;t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.getResources=function(){return undefined},t.prototype.fetch=function(t,i,r,u,f,e,o){var s=this,h=function(n,t,r){var u,f,e,o;if(t&&(u=s.getResources(t),u)){if(s._downloadedStylesResources)for(f in u.Styles)for(e in u.Styles[f])s._downloadedStylesResources[f][e]?delete u.Styles[f][e]:s._downloadedStylesResources[f][e]=u.Styles[f][e];else s._downloadedStylesResources=u.Styles;o={Styles:u.Styles,Scripts:null};JsonInject.WriteHeadAndBeforeContentResources(o)}i(n,t,r)};n.prototype.fetch.call(this,t,h,r,u,f,e,o)},t}(i);n.ResourcesDataProvider=t;r=function(t){function i(n,i,r,u){var f=this;t.call(this,n);this._instrumentationHelper=i;this._config.suppnores&&r.bindConversationStart(function(){f._isSuppressNoResultsSupported=!f._config.suppressNoResultQueryUnsupportedMarkets[u()]})}return __extends(i,t),i.prototype.getDataSource=function(){return n.WebDataSource},i.prototype.getBaseUrl=function(){return this._config.u},i.prototype.onBeforeFetchUrl=function(n,t){this._instrumentationHelper.instrumentSnRProviderFetchUrl(n,t)},i.prototype.getResources=function(n){return n.Resources},i.prototype.fetch=function(n,i,r,u,f,e,o){var h=this,s;this._isSuppressNoResultsSupported&&n.queryToFetch.length<=1&&(this._lastQueryWithNoResults=null);this._isSuppressNoResultsSupported&&this.shouldSuppressFetch(n.queryToFetch)?i(this.getDataSource(),null,null):(s=i,this._isSuppressNoResultsSupported&&(s=function(t,r,u){h.setLastQueryWithNoResults(r,n.queryToFetch);i(t,r,u)}),t.prototype.fetch.call(this,n,s,r,u,f,e,o))},i.prototype.shouldSuppressFetch=function(n){return this._lastQueryWithNoResults&&n.startsWith(this._lastQueryWithNoResults)},i.prototype.setLastQueryWithNoResults=function(n,t){!n||n.RankingSignals&&n.RankingSignals.HADI||n.Suggestions&&!n.Suggestions.length&&(this._lastQueryWithNoResults=t)},i}(t);n.AsSuggestionsDataProvider=r})(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function e(n,t,i,r,f){typeof indexedDB!="undefined"&&new u(n,f,t,i,r)}function o(n,t,i,r,f){typeof indexedDB!="undefined"&&new u(n,f,t,i,r)}function s(n,t,i,r,f,e){typeof indexedDB!="undefined"&&new u(n,e,t,i,r,f)}function h(n,t,i,r,f,e){typeof indexedDB!="undefined"&&new u(n,e,t,i,r,f)}function c(n,t,u){i(n,"deleteDatabase requested");try{var f=indexedDB.deleteDatabase(n);f.onsuccess=function(){i(n,"deleteDatabase completed");t&&t()};f.onerror=r("deleteDatabase.onError",function(t){SharedLogHelper.LogError("deleteDB",n,t);u&&u(t)})}catch(e){u(e)}}function r(n,t){return function(i){var r=n;try{r+=" "+i.target.error.name}catch(u){}t(new Error(r))}}var f=function(){function n(){}return n.StorageNotAvailable="X",n.TimedOut="T",n.ErrorWhenQueryingDb="E",n.QuerySucceeded="R",n}(),i,u;t.StorageState=f;t.instanceWithNumberKeys=e;t.instanceWithStringKeys=o;t.instanceWithNumberKeysAndSecondaryKey=s;t.instanceWithStringKeysAndSecondaryKey=h;i=sa_config.th&&ClientTestHooks.isTesthookParamSet("dbTrace")?function(t,i){return n.log("["+t+"] "+i)}:function(){};t.deleteDatabase=c;t.handleErrorEvent=r;u=function(){function t(n,u,f,e,o,s){var h=this,c;this.databaseName=n;this.onClosed=o;this.secondaryIndex=s;this.closePending=!1;this.storeName=n+"Store";i(this.databaseName,"open requested");try{c=indexedDB.open(n,u||1)}catch(l){e(new Error("IndexedDbClientSideStorage.const: Could not open database"));return}c.onsuccess=function(n){h.database=n.target.result;t.allInstances.push(h);i(h.databaseName,"open completed");f(h)};c.onupgradeneeded=function(n){var t,r;i(h.databaseName,"upgrading");t=n.target.result;t.objectStoreNames.contains(h.storeName)&&t.deleteObjectStore(h.storeName);r=t.createObjectStore(h.storeName);h.secondaryIndex&&r.createIndex(h.secondaryIndex,h.secondaryIndex,{unique:!1})};c.onerror=r("open.onError",e);c.onblocked=r("open.onBlocked",e)}return t.prototype.put=function(n,t,i,r){this.safeDbOperation("put",n.toString(),"readwrite",i,function(i,r,u){var f=i.put(t,n);f.onsuccess=r;f.onerror=u},r)},t.prototype.putMultiple=function(n,t,i){this.safeDbOperation("putMultiple",n.length.toString(),"readwrite",t,function(t,i,r){var u=0,f=function(){if(u<n.length){var e=t.put(n[u].value,n[u].key);u+=1;e.onsuccess=u==n.length?i:f;e.onerror=r}};f()},i)},t.prototype.getValue=function(n,t,i){this.safeDbOperation("getValue",n.toString(),"readonly",function(n){return t(n.target.result)},function(t,i,r){var u=t.get(n);u.onsuccess=i;u.onerror=r},i)},t.prototype.getRange=function(n,t,i,r){var u=this;this.safeDbOperation("getRange","["+n+", "+t+")","readonly",i,function(i,r,f){var e=IDBKeyRange.bound(n,t,!1,!0);u.queryFromCursor(i.openCursor(e),r,f)},r)},t.prototype.getRangeOnSecondaryKey=function(n,t,i,r){var u=this;this.secondaryIndex?this.safeDbOperation("getRangeOnSecondaryKey","["+n+", "+t+")","readonly",i,function(i,r,f){var e=i.index(u.secondaryIndex),o=IDBKeyRange.bound(n,t,!1,!0);u.queryFromCursor(e.openCursor(o),r,f)},r):r(new Error("getRangeOnSecondaryKey: Index name is missing"))},t.prototype.removeRange=function(n,t,i,r){var u=this;this.safeDbOperation("removeRange","["+n+","+t+"]","readwrite",i,function(i,r,f){var e=IDBKeyRange.bound(n,t,!1,!0);u.removeFromCursor(i.openCursor(e),r,f)},r)},t.prototype.removeRangeOnSecondaryKey=function(n,t,i,r){var u=this;this.secondaryIndex?this.safeDbOperation("removeRangeOnSecondaryKey","["+n+","+t+"]","readwrite",i,function(i,r,f){var e=i.index(u.secondaryIndex),o=IDBKeyRange.bound(n,t,!1,!0);u.removeFromCursor(e.openCursor(o),r,f)},r):r(new Error("removeRangeOnSecondaryKey: Index name is missing"))},t.prototype.getAll=function(n,t){var i=this;this.safeDbOperation("getAll",null,"readonly",n,function(n,t,r){return i.queryFromCursor(n.openCursor(),t,r)},t)},t.prototype.close=function(){i(this.databaseName,"close requested");this.innerClose()},t.prototype.innerClose=function(){var r=this;t.requestsInProgress>0?(i(this.databaseName,"delaying close because of "+t.requestsInProgress+" requests in progress"),this.closePending=!0):t.allInstances.forEach(function(t){t.database&&(n.safeExecute(function(){return t.database.close()},r.databaseName+".close"),i(t.databaseName,"close completed"),t.database=null,t.onClosed())})},t.prototype.queryFromCursor=function(n,t,i){var r=[];n.onsuccess=function(n){var i=n.target.result;i&&r.push({key:i.primaryKey,value:i.value});i&&r.length!=sa_config.maxIndexedDBCursorIterations?i.continue():t(r)};n.onerror=i},t.prototype.removeFromCursor=function(n,t,i){var r=0;n.onsuccess=function(n){var i=n.target.result;i&&(i.delete(),r+=1);i&&r!=sa_config.maxIndexedDBCursorIterations?i.continue():t(null)};n.onerror=i},t.prototype.safeDbOperation=function(n,u,f,e,o,s){var h=this,l,c,a;i(this.databaseName,n+" requested"+(u?" "+u:""));t.requestsInProgress+=1;l=function(r){i(h.databaseName,n+" completed "+(u?u+" ":""));t.requestsInProgress-=1;e(r);h.closePending&&t.requestsInProgress==0&&h.innerClose()};c=function(n){t.requestsInProgress-=1;s(n);h.closePending&&t.requestsInProgress==0&&h.innerClose()};try{this.database?(a=this.database.transaction(this.storeName,f).objectStore(this.storeName),o(a,l,r(n+".onError",c))):c(new Error(n+" Database not initialized"))}catch(v){c(v)}},t.requestsInProgress=0,t.allInstances=[],t}()})(t=n.ClientSideStorage||(n.ClientSideStorage={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=function(){function i(n,t,i,r,u,f,e,o){var s=this;this._config=n;this._storageFactory=t;this._createResponse=i;this._dataPopulated=r;this._getDataSourceState=u;this._dataSource=f;this._queryType=e;this._storageOpenInProgress=!1;this._pendingQueries=[];o&&(o.bindAppVisible(function(){return s.initStorage()}),o.bindDismissed(function(){return s._pendingQueries=[]}),o.bindAppHidden(function(){return s.teardownStorage()}))}return i.prototype.teardownStorage=function(){this._storage&&this._storage.close()},i.prototype.initStorage=function(){var n=this;!this._storageOpenInProgress&&this._dataPopulated()&&(this._storageOpenInProgress=!0,this._storageFactory(function(t){n._storage=t;n._storageOpenInProgress=!1;n._pendingQueries.forEach(function(n){return n()});n._pendingQueries=[]},function(t){n.onError(t,"open storage");n._storageOpenInProgress=!1;n._pendingQueries.forEach(function(n){return n()});n._pendingQueries=[]},function(){return n._storage=null}))},i.prototype.onError=function(n,t){SharedLogHelper.LogError(t,this._dataSource,n);this.teardownStorage()},i.prototype.reloadStorage=function(){this.teardownStorage();this.initStorage()},i.prototype.isReady=function(){return!!this._storage},i.prototype.getKey=function(n){return n.queryToFetch?n.queryToFetch.toLocaleLowerCase():""},i.prototype.fetch=function(i,r,u,f,e){var s=this,o;n.isDataSourceEnabled(this._dataSource,i,this._config)&&(o=function(n,u){var f=u==t.StorageState.QuerySucceeded;e()&&r(s._dataSource,s._createResponse(i,n,f),s._getDataSourceState(u))},this.innerQueryStorage(this._queryType,this.getKey(i),function(n){return o(n,t.StorageState.QuerySucceeded)},function(){return o(null,t.StorageState.ErrorWhenQueryingDb)},function(){return o(null,t.StorageState.StorageNotAvailable)},function(){return o(null,t.StorageState.TimedOut)}))},i.prototype.withStorage=function(n){return this._storage?(n(this._storage),!0):!1},i.prototype.getMaxKey=function(n){return n.slice(0,n.length-1)+String.fromCharCode(n.charCodeAt(n.length-1)+1)},i.prototype.queryStorage=function(n,t,i,r,u){this.innerQueryStorage(0,n,t,i,r,u)},i.prototype.innerQueryStorage=function(t,i,r,u,f,e){var h=this,s=null,o=!1,c=!0,a=function(){if(c)if(c=!1,h._storage){var n=function(n){s&&sb_ct(s);h.onError(n,"query");o||(o=!0,u())};t==0?h._storage.getValue(i,function(n){s&&sb_ct(s);o||(o=!0,r(n))},n):i?h._storage.getRange(i,h.getMaxKey(i),function(n){s&&sb_ct(s);o||(o=!0,r(n))},n):h._storage.getAll(function(n){s&&sb_ct(s);o||(o=!0,r(n))},n)}else s&&sb_ct(s),o||(o=!0,u())},l;if(this._storage)a();else if(this.initStorage(),this._storageOpenInProgress)this._pendingQueries.push(a);else{f();return}l=i?this._config.indexedDBTimeout:this._config.latencyTimeoutForZeroInput;l&&(s=sb_st(function(){return n.safeExecute(function(){c=!1;o||(o=!0,e())},"innerQueryStorage")},l))},i}();t.StorageBasedDataProvider=i})(t=n.ClientSideStorage||(n.ClientSideStorage={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=function(){function i(n,t,i,r){this._config=n;this._host=t;this._instrumentationHelper=i;this._temporaryMessageHandler=r}return i.prototype.parse=function(i,r,u,f,e,o,s){var h=this,c=[];if(this._config.mruCandidatesEnabled){var l=[],a=[],v=[],y=[],p=[],w=[];f&&f.Suggestions&&f.Suggestions.forEach(function(u){var f,e;u.handoffType==2?t.isApp(u.type)?(f=u,l.push(f.id),y.push(f)):t.isSetting(u.type)?(f=u,a.push(f.id),p.push(f)):t.isFileOrFolder(u.type)&&(f=u,v.push(f.id),w.push(f)):n.isBrowserOnline()&&(e=n.safeExecute(function(){return h.parseMRUWebSuggestion(i,u,r)},"parseMRUWebSuggestion"),e&&c.push(e))});t.lookupById(i,t.DataSources.MRUApps,null,l,y,function(n){return[n.id]},t.DataSources.MRUSettings,null,a,p,function(n){return n.id},e,r,o,s,function(n,t,u,f){return h.parseIdLookupResponse(i,r,n,t,u,f)},t.DataSources.MRUFilesAndFolders,v,w,function(n){return n.id},this._config,this._instrumentationHelper)}o(n.MRUDataSource,c,f)},i.prototype.parseIdLookupResponse=function(i,r,u,f,e,o){var s=this,h;e.length==1&&(h=function(n){return s.setupRemoveFromHistoryContextMenu(n,u,s._host),u.appContextData&&(n.appContext=u.appContextData.appContext,n.query=u.appContextData.query,n.text=i.queryToFetch?HitHighlightingParser.addMarkers(u.appContextData.textWithoutHH,i.queryToFetch):u.appContextData.textWithoutHH),s.setRankingSignals(n,u),!0},n.safeExecute(function(){return t.parseLocalSuggestion(i,e[0],f,r,s._host,s._config,s._temporaryMessageHandler,u.type,s._instrumentationHelper,o,h)},"parseLocalSuggestion "+f))},i.prototype.setRankingSignals=function(n,t){n.hc=t.hc;n.highConfidenceMetaSuggestionScore=t.highConfidenceMetaSuggestionScore;n.prefetchConfidenceScore=t.prefetchConfidenceScore;n.fromHistory=!0},i.prototype.parseMRUWebSuggestion=function(i,r,u){var f=t.createSuggestion(i.queryToFetch?HitHighlightingParser.addMarkers(r.textWithoutHH,i.queryToFetch):r.textWithoutHH,null,r.icon,r.type,r.query,n.InstrumentedItem.createInstrumentedItem(u),r.handoffType,u,null,null),e,s,o;f.secondaryText=r.secondaryText;f.secondaryTextClass=t.CssClass_Annotation;this.setRankingSignals(f,r);switch(f.handoffType){case 5:case 4:if(!t.isCortanaEnabledCache)return null;e=r;t.setCat1SuggestionProperties(f,i,u,e.actionUri,e.taskFrame,e.confidence,e.source,this._host);break;case 1:s=r;t.setDnavSuggestionProperties(f,i,u,s.url,this._host);break;case 2:if(f.type==t.OnlineSuggestionTypes.Person_Consumer){o=r;t.setPeopleSuggestionProperties(f,i,u,o.contactName,o.peopleScenario,this._host);break}default:return SharedLogHelper.LogError("parseMruWebSuggestion",null,new Error("Unexpected handoff type: "+r.handoffType)),null}return t.isValidSuggestion(f,"parseMruWebSuggestion",!1)?(this.setupRemoveFromHistoryContextMenu(f,r,this._host),f):null},i.prototype.setupRemoveFromHistoryContextMenu=function(n,i,r){i.remove&&t.setExtraVerbs(n,function(){if(!i.remove)return[];if(n.duplicates&&n.duplicates.some(function(n){return!n.fromHistory}))return[];var u={verb:t.Verbs.RemoveFromDeviceHistory,displayName:r.getLocString(t.Verbs.RemoveFromDeviceHistory),executeAsync:function(){return i.remove(function(){return r.setQuery(null,!1,!0)}),delete i.remove,t.createVoidPromise()}};return[u]})},i}();t.MruParser=i})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i="LastUpdated",r=function(t){function r(r,u,f,e,o,s,h,c,l,a){var v=this;this._candidatesEnabled=l;this._loggingEnabled=a;this._rankingSignalKeyGenerator=o;this._suggestionKeyGenerator=s;this._lightweightStorage=h;this._pendingWrites=[];u&&u.bindItemLaunch(function(n,t,i){return v.onLaunch(n,t,i)});r.th&&ClientTestHooks.isTesthookParamSet("clearMru")&&n.ClientSideStorage.deleteDatabase(c);var y,p=!0,w=function(t,r,u){return f(c,function(i){p&&(p=!1,y=n.safeExecute(function(){return new Date(Number(v._lightweightStorage().LastMruPruneDate))},"getLastMruPruneDate"));t(i);(!n.isValidDate(y)||n.getTimeDiffInDays(y)>=1)&&(y=new Date,n.safeExecute(function(){return v._lightweightStorage().LastMruPruneDate=String(y.getTime())},"storeLastMruPruneDate"),v.prune())},r,u,i)},b=function(n,t,i){return v.createResponse(n,t,i)},k=function(){return!0},d=function(t){return t==n.ClientSideStorage.StorageState.QuerySucceeded?undefined:t};e.bindClearMRURequested(function(t){v.teardownStorage();n.ClientSideStorage.deleteDatabase(c,function(){return t(!0)},function(){return t(!1)})});t.call(this,r,w,b,k,d,n.MRUDataSource,1,e)}return __extends(r,t),r.prototype.shouldStoreSuggestions=function(){return this._config.mruCandidatesEnabled&&(!this._candidatesEnabled||this._candidatesEnabled())},r.prototype.createResponse=function(n,t,i){var o=this,f,s,u,e,h;return t=t||[],f=this.getKey(n),this._lastKey=i?f:null,s=t.filter(function(n){return n.key==f})[0],this._valueForLastKey=s?s.value:null,u={},this._config.mruSignalsEnabled&&this._valueForLastKey&&(u.RankingSignals=this._valueForLastKey.RankingSignals,u.WebRankingSignalsCache=this._valueForLastKey.WebRankingSignalsCache,u.EngagementSignalsCache=this._valueForLastKey.EngagementSignalsCache,u.SuppressedGroupsCache=this._valueForLastKey.SuppressedGroupsCache),this.shouldStoreSuggestions()&&(e=[],h=this.getOldestDateToKeep(),t.forEach(function(n){var i=n.key,t=n.value;t.Suggestions&&t.Suggestions.forEach(function(n){var u=r.getLastLaunchTime(t,n,o._suggestionKeyGenerator);u&&u>=h&&(e.push({lastLaunchTime:u,suggestionData:n}),n.remove=function(t){return o.remove(i,n,t)})})}),e.length>0&&(u.Suggestions=[],e.sort(function(n,t){return t.lastLaunchTime-n.lastLaunchTime}),e.forEach(function(n){return o.addIfNotPresent(u.Suggestions,n.suggestionData,!0)}),f?f.length<=this._config.mruLengthA?u.Suggestions.splice(this._config.maxMruA):f.length<=this._config.mruLengthB&&u.Suggestions.splice(this._config.maxMruB):u.Suggestions.splice(this._config.maxMruZeroInput))),u},r.removeRankerSignals=function(n,t){return n=="highConfidenceMetaSuggestionScore"||n=="prefetchConfidenceScore"?undefined:t},r.prototype.addIfNotPresent=function(n,t,i){var e=JSON.stringify(t,r.removeRankerSignals),u=n.filter(function(n){return JSON.stringify(n,r.removeRankerSignals)==e})[0],f;u?i&&(f=u.remove,u.remove=function(n){return f(function(){return t.remove(n)})}):n.push(t)},r.prototype.onAfterWrite=function(){if(this._writing=!1,this._pendingWrites.length>0){var n=this._pendingWrites.shift();n()}else this._tearDownPending&&this.teardownStorage()},r.prototype.teardownStorage=function(){this._writing?this._tearDownPending=!0:(this._tearDownPending=!1,t.prototype.teardownStorage.call(this))},r.prototype.onLaunch=function(t,i,r){var u=this,e,f;if(!this._loggingEnabled||this._loggingEnabled()){if(this._writing){this._pendingWrites.push(function(){return u.onLaunch(t,i,r)});return}this._writing=!0;e=r?r[n.WebDataSource]:null;f=this.getKey(i);this._lastKey==f?this.updateAndSaveLaunchData(f,this._valueForLastKey,t,e):this.queryStorage(f,function(n){return u.updateAndSaveLaunchData(f,n,t,e)},function(){return u.onAfterWrite()},function(){return u.onAfterWrite()},function(){return u.onAfterWrite()})}},r.prototype.remove=function(n,t,i){var r=this;if(this._writing){this._pendingWrites.push(function(){return r.remove(n,t,i)});return}this._writing=!0;this._lastKey==n?this.removeAndSaveLaunchData(n,this._valueForLastKey,t,i):this.queryStorage(n,function(u){return r.removeAndSaveLaunchData(n,u,t,i)},function(){return r.onAfterWrite()},function(){return r.onAfterWrite()},function(){return r.onAfterWrite()})},r.getUnixTime=function(n){return n||(n=new Date),Math.round(n.getTime()/1e3)},r.prototype.createOrUpdateDbEntry=function(n,t,i,u){var f,e;return t?(t.LastUpdated=r.getUnixTime(),t.RankingSignals=t.RankingSignals||{}):t={LastUpdated:r.getUnixTime(),RankingSignals:{}},f=this._rankingSignalKeyGenerator(i),t.RankingSignals[f]?(t.RankingSignals[f].prefixLaunchCount+=1,t.RankingSignals[f].lastLaunchTime=t.LastUpdated):t.RankingSignals[f]={prefixLaunchCount:1,lastLaunchTime:t.LastUpdated},this._config.mruSignalsEnabled&&u&&(t.WebRankingSignalsCache=u.rankingSignals,t.EngagementSignalsCache=u.engagementSignals,t.SuppressedGroupsCache=u.suppressedGroups),this.shouldStoreSuggestions()&&(e=i.getMruData(),e&&n&&(t.Suggestions||(t.Suggestions=[]),this.addIfNotPresent(t.Suggestions,e,!1)),t.Suggestions&&t.Suggestions.forEach(function(n){return delete n.remove})),t},r.prototype.getOldestDateToKeep=function(){var n=new Date;return n.setDate(n.getDate()-this._config.mruMaxAgeInDays),r.getUnixTime(n)},r.prototype.updateAndSaveLaunchData=function(n,t,i,u){var f=this;t=this.createOrUpdateDbEntry(n,t,i,u);this._suggestionKeyGenerator&&r.removeOldLaunches(t,this.getOldestDateToKeep(),this._suggestionKeyGenerator);this._lastKey=n;this._valueForLastKey=t;this.withStorage(function(i){return i.put(n,t,function(){return f.onAfterWrite()},function(n){f.onError(n,"updateAndSaveLaunchData");f.onAfterWrite()})})||this.onAfterWrite()},r.prototype.removeAndSaveLaunchData=function(t,i,r,u){var f=this,o,e;if(!i){SharedLogHelper.LogError("removeAndSaveLaunchData",null,new Error("MRU entry not present"));this.onAfterWrite();return}if(o=JSON.stringify(r),e=n.indexOf(i.Suggestions||[],function(n){return JSON.stringify(n)==o}),e==-1){SharedLogHelper.LogError("removeAndSaveLaunchData",null,new Error("Suggestion not present in MRU"));this.onAfterWrite();return}i.Suggestions.splice(e,1);i.Suggestions.forEach(function(n){return delete n.remove});this._lastKey=t;this._valueForLastKey=i;this.withStorage(function(n){return n.put(t,i,function(){u&&u();f.onAfterWrite()},function(n){f.onError(n,"removeAndSaveLaunchData");f.onAfterWrite()})})||this.onAfterWrite()},r.getLastLaunchTime=function(n,t,i){if(n.RankingSignals){var r=n.RankingSignals[i(t)];if(r)return r.lastLaunchTime}},r.removeOldLaunches=function(n,t,i){var f,e,o,u;if(n.Suggestions)for(f=n.Suggestions.length-1;f>=0;--f)u=r.getLastLaunchTime(n,n.Suggestions[f],i),(!u||u<t)&&n.Suggestions.splice(f,1);if(n.RankingSignals)for(e in n.RankingSignals)o=n.RankingSignals[e],o&&(u=o.lastLaunchTime,(!u||u<t)&&delete n.RankingSignals[e])},r.prototype.prune=function(n){var t=this;if(this._writing){this._pendingWrites.push(function(){return t.prune(n)});return}this._writing=!0;this.withStorage(function(i){return i.removeRangeOnSecondaryKey(0,t.getOldestDateToKeep(),function(){n&&n();t.onAfterWrite()},function(n){t.onError(n,"MRUDataProvider prune");t.onAfterWrite()})})||this.onAfterWrite()},r}(n.ClientSideStorage.StorageBasedDataProvider);t.MRUDataProvider=r})(t=n.MRU||(n.MRU={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function o(n,i,r,u,f,e){var o=u?r+" "+i:r;return t.Promise.safeChainWithGlobalCaching("getIcon",function(i){return n.getImageAsync(t.getImageSizeValue(i))},function(n){return n+"_"+i},function(n){return t.toIcon(n,"getIcon",f,e,o)},f,o)}function i(n,i,r,u,f,e,s){return{deviceItem:i,getIcon:o(i,i.id,u,!t.dataSourceMayContainPII(u)||n.th,f,e),icon:s?f:null,suggestionType:r}}function u(n,t,i){return{deviceItem:n,icon:i,suggestionType:t}}function e(i,r,u,f,e,o,s,h,c){n.safeExecute(function(){var n,l,v,a,y;if(i.length==0)r({});else{if(n={},l=i.slice(0),h)for(v=i.length-1;v>=0;--v)a=i[v],h.hasOwnProperty(a)&&(n[a]=h[a],c&&n[a]&&(n[a].suggestionType=c),l.splice(v,1));l.length==0?r(n):(y=t.dataSourceMayContainPII(f)?f:f+" "+l,t.Promise.safeChain(e,function(){return o(l)},function(u){var e=t.Map.map(l,u,function(n){return s(n)}),f;if(h&&l.forEach(function(n){return h[n]=e[n]}),l.length!=i.length)for(f in n)n.hasOwnProperty(f)&&(e[f]=n[f]);r(e)},function(){return r({})},u,y))}},"resolveIdsWithCache "+f,null,null,function(){r({})})}function nt(n,i){if(!i.launchArguments||k.test(n.query))return!0;var r=i.id.toLowerCase();return t.BlacklistedSystemCommandsWhenNoArgs.some(function(n){return r.includes(n)})?!0:!1}function d(i,r,u,f){var h,o,y,e,c,p,b,w,s,v,a,l;if(t.isMobileCache)return!1;if(t.isApp(f))return(e=u.id,n.contains(it,e))?!0:(h=u.kind,h&&(h=h.toLowerCase(),h!="program"&&h!="unknown"))?!0:!i.allowUrlsInAppsGroup&&((e=e.toLowerCase(),e.startsWith("http:")||e.startsWith("https:")||e.startsWith("file:"))||(o=u.filePath,o&&(o=o.toLowerCase(),o.startsWith("http:")||o.startsWith("https:")||o.startsWith("file:"))))?!0:(y=u.extension,y&&y.toLowerCase()==".chm")?!0:!1;if(t.isSetting(f))return(e=u.id,n.contains(tt,e))?!0:!1;if(f==t.LocalSuggestionTypes.BrowsingHistory)return(c=u,n.olderThan2Weeks(c.dateVisited)||n.isBingSearchUrl(c.url))?!0:r.queryToFetch?r.isMultiWord&&(p=c.title?HitHighlightingParser.addMarkers(c.title,r.queryToFetch):null,b=p&&p.includes(HitHighlightingParser.startMarker),b)?!1:!n.matchesOnDomain(c.url,r):!1;if(t.isItemWithFileMetadata(f)){if((w=u,s=w.id,s&&(s.includes("\\.")||s.includes("/.")||(s=s.toLowerCase(),ut.some(function(n){return s.includes(n)}))))||(v=w.extension,v&&!r.queryToFetch.toLowerCase().includes(v.toLowerCase())&&n.contains(rt,v.toLowerCase())))return!0;if(f==t.LocalSuggestionTypes.CommandLine){if(a=u,l=a.displayName.split(" ")[0].toLowerCase(),l.includes("\\")||l.indexOf(":")==1)return!1;var e=a.id.toLowerCase(),k=e.lastIndexOf("."),d=e.lastIndexOf("\\"),g=a.kind=="folder"||k<0||k<d;if(g&&!l.includes("%")||![".exe",".com"].some(function(n){return l.includes(n)})&&(t.BlacklistedSystemCommands.some(function(n){return e.includes(n)})||!a.launchArguments&&t.BlacklistedSystemCommandsWhenNoArgs.some(function(n){return e.includes(n)})||n.contains(t.BlacklistedCommands,l)))return!0}return!1}return!1}var k,g,f;t.getIcon=o;var s={getQueryResults:function(n){return n.apps},dataSource:t.DataSources.LocalApps,getSuggestionType:function(){return t.LocalSuggestionTypes.App},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[1].icon,r.isImmersive?r.logoBackgroundColor:undefined)}},h={getQueryResults:function(n){return n.settings},dataSource:t.DataSources.LocalSettings,getSuggestionType:function(){return t.LocalSuggestionTypes.Setting},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,customCreateLocalResponseSuggestion:function(n,r,f,e){if(t.isModernSetting(r)){var o=r.glyph,s=o?{content:o,type:1}:t.ScopeConfig[2].icon;return u(r,f,s)}return i(n,r,f,e,t.ScopeConfig[2].icon)}},c=[s,h,{getQueryResults:function(n){return n.media},dataSource:t.DataSources.LocalMedia,getSuggestionType:function(n,i){return t.getSuggestionTypeFromKindAndExtension(n.kind,n.extension,i)},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8chars:20},{getQueryResults:function(n){return n.files},dataSource:t.DataSources.LocalDocumentsAndFolders,getSuggestionType:function(n,i){return t.getSuggestionTypeFromKindAndExtension(n.kind,n.extension,i)},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8chars:20},{getQueryResults:function(n){return n.powerBi},dataSource:t.DataSources.PowerBi,getSuggestionType:function(){return t.LocalSuggestionTypes.PowerBi},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,customCreateLocalResponseSuggestion:function(n,i,r){return u(i,r,{content:t.CortanaFontIcons.PowerBILogo,type:2})}},{getQueryResults:function(n){return n.browsingHistory},dataSource:t.DataSources.EdgeBrowsingHistory,getSuggestionType:function(){return t.LocalSuggestionTypes.BrowsingHistory},maxUpTo3chars:3,maxAfter3chars:3,maxAfter8chars:3,customCreateLocalResponseSuggestion:function(n,t,i){return u(t,i,null)}},],l=[{getQueryResults:function(n){return n.files},dataSource:t.DataSources.MyStuffDocuments,getSuggestionType:function(){return t.LocalSuggestionTypes.Document},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,supportsOEM:!0,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[6].icon,null,!0)}},{getQueryResults:function(n){return n.folders},dataSource:t.DataSources.MyStuffFolders,getSuggestionType:function(){return t.LocalSuggestionTypes.Folder},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[8].icon,null,!0)}},{getQueryResults:function(n){return n.pictures},dataSource:t.DataSources.MyStuffPhotos,getSuggestionType:function(){return t.LocalSuggestionTypes.Photo},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,supportsOEM:!0,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[3].icon,null,!0)}},{getQueryResults:function(n){return n.video},dataSource:t.DataSources.MyStuffVideos,getSuggestionType:function(){return t.LocalSuggestionTypes.Video},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,supportsOEM:!0,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[4].icon,null,!0)}},{getQueryResults:function(n){return n.music},dataSource:t.DataSources.MyStuffMusic,getSuggestionType:function(){return t.LocalSuggestionTypes.Music},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,supportsOEM:!0,customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[5].icon,null,!0)}},{getQueryResults:function(n){return n.windowsDeviceSearchEmails},dataSource:t.DataSources.MyStuffEmails,getSuggestionType:function(){return t.LocalSuggestionTypes.Email},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8chars:15,supportsOEM:!0,customCreateLocalResponseSuggestion:function(n,i,r){return u(i,r,t.ScopeConfig[11].icon)}},],a=[{getQueryResults:function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.startPathCompletionQuery(n.originalQuery,"")},dataSource:t.DataSources.PathCompletion,getSuggestionType:function(){return t.LocalSuggestionTypes.PathCompletion},maxUpTo3chars:15,maxAfter3chars:15,maxAfter8chars:15,customCancellation:function(){return SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastPathCompletionQuery()}},],v=[{getQueryResults:function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.startCommandLineQuery(n.originalQuery,"")},dataSource:t.DataSources.CommandLine,getSuggestionType:function(){return t.LocalSuggestionTypes.CommandLine},customCancellation:function(){return SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastCommandLineQuery()}},],y={dataSource:t.DataSources.LocalRecentApps,getSuggestionType:function(){return t.LocalSuggestionTypes.App},customCreateLocalResponseSuggestion:function(n,r,u,f){return i(n,r,u,f,t.ScopeConfig[1].icon,r.isImmersive?r.logoBackgroundColor:undefined)}};t.LocalDataProviderDataSources=c.concat(l).concat(a).concat(v).concat(y).map(function(n){return n.dataSource});var r={suggestions:[]},p={},w={},b={};t.BlacklistedSystemCommands=["\\system32\\user.exe","\\system32\\sidebar.exe","\\system32\\at.exe","\\system32\\change.exe","\\system32\\control.exe","\\system32\\find.exe","\\system32\\net.exe","\\system32\\share.exe","\\system32\\rundll32.exe","\\system32\\append.exe","\\system32\\choice.exe","\\system32\\clip.exe","\\system32\\comp.exe","\\system32\\compact.exe","\\system32\\consent.exe","\\system32\\convert.exe","\\system32\\format.exe","\\system32\\graphics.com","\\system32\\label.exe","\\system32\\mem.exe","\\system32\\mode.com","\\system32\\more.com","\\system32\\recover.exe","\\system32\\replace.exe","\\system32\\reset.exe","\\system32\\shadow.exe","\\system32\\sort.exe","\\system32\\tree.com","\\system32\\webcam.exe","\\system32\\systemsettings.exe","\\system32\\command.com","\\system32\\tabtip.exe","\\system32\\services.exe","\\system32\\help.exe","\\system32\\where.exe","\\system32\\skydrive.exe","\\system32\\calc.exe","\\system32\\fc.exe","\\accessories\\wordpad.exe",];t.BlacklistedSystemCommandsWhenNoArgs=["\\system32\\finger.exe","\\system32\\ping.exe","\\system32\\print.exe","\\system32\\shutdown.exe","\\system32\\expand.exe","\\system32\\tskill.exe","\\system32\\reg.exe","\\system32\\sc.exe",];t.BlacklistedCommands=["uninstall","outlook","excel","skype","nero","onenote","lync","vmware","firefox","itunes","photoshop","print","opera","visio","thunderbird","smartscreen"];k=/[\/\.\-\\]/;t.isRealCommand=nt;var tt=["Classic_{E9C71548-B580-43B2-ACDB-1BA924002754}","ControlPanel","NameSpace_Classic_{D8559EB9-20C0-410E-BEDA-7ED416AECC2A}","Classic_{7D13A5DB-6081-48BD-8EA3-A9D7FE67A335}","Classic_{17cd9488-1228-4b2f-88ce-4298e93e0966}","Classic_{17468BC4-3ACB-4D2A-98C2-B0B7B4EF29E6}","Classic_{55E51B6E-7D17-4C80-859E-3007A1F2B6AA}","AAA_SettingsPageLockScreen-2","Classic_{B98AD935-426A-482B-9383-ED7D8BB99A6F}","AAA_SystemSettings_Users_PicturePassword","Classic_{DAF32862-EF3D-4D61-AB92-47AEB51DDC80}",],it=["Microsoft.Cortana_8wekyb3d8bbwe!CortanaUI","Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI",],rt=[".dll",".pdb",".obj",".bin",".etl",".bak",".config",".resx",".manifest",".ini",".searchconnector-ms",".settingcontent-ms",".vstx",".vssx",],ut=["/visio content/",];t.isSuppressed=d;g=function(){function u(n,t){this._config=n;t.bindAppHidden(function(){p={};w={};b={}})}return u.prototype.fetch=function(i,u,e,o,s){var h=this,k=c.filter(function(t){return n.isDataSourceEnabled(t.dataSource,i,h._config)}),d,p,w,b;if(k.length>0&&(o&&o.register(function(){t.Promise.clearPendingItemsFromCache();SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastDeviceQuery()},!1),d=n.safeExecute(function(){return SearchAppWrapper.CortanaApp.queryFormulationView.startDeviceQuery(i.queryToFetch)},"startDeviceQuery"),d?k.forEach(function(n){return h.searchFolderWithMultipleResults(i,n,d,u,s)}):this.emptyFetch(k,u)),p=l.filter(function(t){return n.isDataSourceEnabled(t.dataSource,i,h._config)}),p.length>0){if(!i.queryToFetch)throw new Error(f);t.Promise.safeChain("executeSearchAsync",function(){return SearchAppWrapper.CortanaApp.searchResultsView.executeSearchAsync(i.queryToFetch,i.taskFrame)},function(n){n?p.forEach(function(t){return h.searchFolderWithMultipleResults(i,t,n,u,s)}):h.emptyFetch(p,u)},function(){return h.emptyFetch(p,u)})}if(w=a.filter(function(t){return n.isDataSourceEnabled(t.dataSource,i,h._config)}),w.length>0){if(!i.queryToFetch)throw new Error(f);o&&w.forEach(function(n){return o.register(function(){return n.customCancellation()},!0)});w.forEach(function(n){return h.searchFolderWithMultipleResults(i,n,i,u,s)})}if(b=v.filter(function(t){return n.isDataSourceEnabled(t.dataSource,i,h._config)}),b.length>0){if(!i.queryToFetch)throw new Error(f);o&&b.forEach(function(n){return o.register(function(){return n.customCancellation()},!0)});b.forEach(function(n){return h.searchFolderWithSingleResult(i,n,i,u,s)})}n.isDataSourceEnabled(t.DataSources.LocalRecentApps,i,this._config)&&t.Promise.safeChain("getRecentAppsAsync",function(){return SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getRecentAppsAsync()},function(n){var r=[];n.forEach(function(n){var t=h.toLocalResponseSuggestion(i,n,y);t!=null&&r.push(t)});u(t.DataSources.LocalRecentApps,{suggestions:r},null)},function(){return u(t.DataSources.LocalRecentApps,r,null)});i.taskFrame&&n.safeExecute(function(){return SearchAppWrapper.CortanaApp.searchResultsView.setTaskFrame(i.originalQuery,"")},"reset task frame")},u.prototype.emptyFetch=function(n,t){var i=this;n.forEach(function(n){i.logProviderFailure(n.dataSource);t(n.dataSource,r,u.getDataSourceState(0))})},u.prototype.getMax=function(n,t){var i=t.maxUpTo3chars;return n.queryToFetch.length>8||n.scope!=0?i=t.maxAfter8chars:n.queryToFetch.length>3&&(i=t.maxAfter3chars),n.scope!=0&&n.queryToFetch&&(i*=2),i},u.prototype.toLocalResponseSuggestion=function(n,t,r){var u=r.getSuggestionType(t,this._config);return d(this._config,n,t,u)?null:r.customCreateLocalResponseSuggestion?r.customCreateLocalResponseSuggestion(this._config,t,u,r.dataSource):i(this._config,t,u,r.dataSource)},u.prototype.toLocalResponse=function(n,t,i){var u=this,r=[];return t.forEach(function(t){var f=u.toLocalResponseSuggestion(n,t,i);f!=null&&r.push(f)}),{suggestions:r}},u.prototype.getProvider=function(n,t,i){if(i.supportsOEM&&n.useOemDataSources)for(var u=t,r=u.getProviders().first();r.hasCurrent;){if(r.current.key==1)return 1;r.moveNext()}return 0},u.prototype.getResults=function(t,i,r,u){var f=this,e=n.safeExecute(function(){return f.getProvider(t,r,u)},"getProvider",0);return e==1?r.getItemsAsync(0,i,1,[]):r.getItemsAsync(0,i)},u.prototype.searchFolderWithMultipleResults=function(i,f,e,o){var h=this,s=f.dataSource,c=n.safeExecute(function(){return f.getQueryResults(e)},"getQueryResults "+s),l;c?(l=this.getMax(i,f),t.Promise.safeChain("getItemsAsync "+s,function(){return h.getResults(i,l,c,f)},function(n){var t=n.resultSet,r;t?r=n.state:(t=n,r=3);o(s,h.toLocalResponse(i,t,f),u.getDataSourceState(r))},function(t){n.isCancellation(t)||h.logProviderFailure(s);o(s,r,null)})):o(s,r,null)},u.prototype.searchFolderWithSingleResult=function(i,u,f,e){var s=this,o=u.dataSource,h=n.safeExecute(function(){return u.getQueryResults(f)},"getQueryResults "+o);h?t.Promise.safeChain("tryGetResultAsync "+o,function(){return h.tryGetResultAsync()},function(n){return e(o,s.toLocalResponse(i,n?[n]:[],u),null)},function(t){n.isCancellation(t)||s.logProviderFailure(o);e(o,r,null)}):e(o,r,null)},u.prototype.logProviderFailure=function(i){var r=t.providerFailureLogName(i);r&&SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure&&n.safeExecute(function(){return SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure(r,"ErrorForTopHit")},"logProviderFailure")},u.getDataSourceState=function(n){switch(n){case 0:return t.LocalProviderIndexerState.Unknown;case 1:return t.LocalProviderIndexerState.NotIndexed;case 2:return t.LocalProviderIndexerState.PartiallyIndexed}return undefined},u.getApps=function(n,t,i,r,u,f,o){e(i,r,u,f,"findAppsAsync",function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findAppsAsync(n)},function(t){return s.customCreateLocalResponseSuggestion(n,t,o,f)},n.cacheAppItems?p:null,o)},u.getSettings=function(n,t,i,r,u,f,o){e(i,r,u,f,"findSettingsAsync",function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findSettingsAsync(n)},function(t){return h.customCreateLocalResponseSuggestion(n,t,o,f)},w,o)},u.getFiles=function(n,r,u,f,o,s){e(u,f,o,s,"findFilesAsync",function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findFilesAsync(n)},function(r){var u=t.getSuggestionTypeFromKindAndExtension(r.kind,r.extension,n);return i(n,r,u,s)},b,null)},u}();t.LocalDataProvider=g;f="Local provider doesn't support empty query"})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function u(n,t){!n.query.includes(t.queryToFetch)&&n.query.toLowerCase().startsWith(t.queryToFetch.toLowerCase())&&(n.query=t.queryToFetch+n.query.substr(t.queryToFetch.length),n.text=HitHighlightingParser.addMarkers(n.query,t.queryToFetch))}function i(n,i,r,f,e,o,s,h){if(n.actionUri=f,n.confidence=o,n.source=s,n.handoffType==4){var c=n.query.toLowerCase()==i.queryToFetch.toLowerCase();n.updateFromQuery=function(i){return c?(n.query=i.queryToFetch,n.text=HitHighlightingParser.addMarkers(n.query,i.queryToFetch),n.narratorText=t.getNarratorText(n),!0):!1};n.click=function(){return h.launchCat1MyStuff(n.query,e)}}else n.secondaryTextClass=t.CssClass_Action,n.click=function(){return h.launchCat1(n.query,f,e)};n.getIcon||t.isValidIcon(n.icon)||(n.icon={type:4});u(n,i);n.narratorText=t.getNarratorText(n);n.getMruData=function(){return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionScore:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfidenceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),secondaryText:n.secondaryText,icon:n.getIcon?null:n.icon,actionUri:f,taskFrame:e,confidence:o,source:s}}}function r(n,i,r,u,f,e){n.contactName=u;n.peopleScenario=f;n.icon=t.ScopeConfig[13].icon;n.click=function(){return e.launchUrl("ms-people:search?SearchString="+encodeURIComponent(u))};n.mayContainPII=!0;n.narratorText=t.getNarratorText(n,e.getLocString("SearchPeople"));n.getMruData=function(){return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionScore:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfidenceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),secondaryText:n.secondaryText,icon:n.icon,contactName:n.contactName,peopleScenario:n.peopleScenario}}}function f(n,i,r,u,f){n.url=u;t.isValidIcon(n.icon)||(n.getIcon=f.getBrowserIcon);n.click=function(){return f.launchUrl(u)};n.narratorText=t.getNarratorText(n,f.getLocString("DirectNavSuggestion"));n.getMruData=function(){return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionScore:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfidenceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),secondaryText:n.secondaryText,icon:n.getIcon?null:n.icon,url:u}}}var e=function(){function e(n,t,i,r,u){this._config=n;this._host=t;this._instrumentationHelper=i;this._navigationHelper=r;this._temporaryMessageHandler=u}return e.prototype.parse=function(n,t,i,r,u,f,e){this.parseOnlineSuggestions(n,t,r,u,f,e)},e.prototype.parseOnlineSuggestions=function(i,r,u,f,e,o){var s=this,c,l,w;if(!u){n.isDataSourceEnabled(n.WebDataSource,i,this._config)&&e(n.WebDataSource,[],null);n.isDataSourceEnabled(t.DataSources.BingApps,i,this._config)&&e(t.DataSources.BingApps,[],null);n.isDataSourceEnabled(t.DataSources.BingSettings,i,this._config)&&e(t.DataSources.BingSettings,[],null);return}u.ELToken&&this._host.setElToken(u.ELToken);var a=[],v=[],y=[],h=[],p=[];n.safeExecute(function(){u.Suggestions.forEach(function(t){var o=t.Attributes,l=t.Attributes.stype,c=o.appId,f,e;if(c){v.push(t);c.split(";").forEach(function(t){n.contains(h,t)||h.push(t)});return}if(f=o.settingId,f){y.push(t);p.push(f);return}e=n.safeExecute(function(){return s.parseOnlineSuggestion(i,t,r,u.Resources)},"parseOnlineSuggestion");e&&a.push(e)})},"parseOnlineSuggestions");n.isDataSourceEnabled(n.WebDataSource,i,this._config)&&(c=null,l=null,u.RankingSignals&&(c=n.safeExecute(function(){return n.parseWebEngagementSignals(u.RankingSignals,s._config)},"parseWebEngagementSignals"),l=n.safeExecute(function(){return t.parseWebSuppresionSignals(u.RankingSignals,i,s._config)},"parseWebSuppressionSignals")),w={rankingSignals:u.RankingSignals,engagementSignals:c,suppressedGroups:l,webTopResultRoutingType:u.PrefixRoutingType},e(n.WebDataSource,a,w));t.lookupById(i,t.DataSources.BingApps,null,h,v,function(n){return n.Attributes.appId.split(";")},t.DataSources.BingSettings,null,p,y,function(n){return n.Attributes.settingId},f,r,e,o,function(n,t,f,e){return s.parseIdLookupResponse(u,i,r,n,t,f,e)},null,null,null,null,this._config,this._instrumentationHelper)},e.prototype.parseIdLookupResponse=function(u,f,e,o,s,h,c){var l=this,a,v;if(o.Attributes.stype!=t.OnlineSuggestionTypes.Store||!(h.length>0)){if(h.length!=1){a=n.safeExecute(function(){return l.parseOnlineSuggestion(f,o,e,u.Resources)},"parseOnlineSuggestion "+s);a&&c.push(a);return}v=function(u){var s=o.Attributes;return l.compliesWithMinVersion(s.appMinVersion,u.deviceItem.version)?(s&&s.k&&s.appNS&&(u.instItem=new n.InstrumentedItem(parseInt(s.k),s.appNS,!0)),u.appContext=s.appContext,l.setRankingSignals(u,o),o.Text&&s.query&&(!t.isApp(u.type)||u.appContext)&&(u.text=o.Text,u.query=s.query),o.SecondaryText&&(u.secondaryText=o.SecondaryText),u.handoffType==5&&i(u,f,e,s.actionUri,s.taskFrame,parseFloat(s.confidence),parseInt(s.source),l._host),u.type==t.OnlineSuggestionTypes.Person_Consumer&&r(u,f,e,s.contactName,s.peopleScenario,l._host),!0):!1};n.safeExecute(function(){return t.parseLocalSuggestion(f,h[0],s,e,l._host,l._config,l._temporaryMessageHandler,o.Attributes.stype,l._instrumentationHelper,c,v)},"parseLocalSuggestion "+s)}},e.prototype.parseOnlineSuggestion=function(u,o,s,h){var c=o.Attributes,v=c.stype,y,l,a;if(c.appId&&v!=t.OnlineSuggestionTypes.Store||c.settingId)return null;if(y=c&&c.k&&c.appNS?new n.InstrumentedItem(parseInt(c.k),c.appNS,!0):n.InstrumentedItem.createInstrumentedItem(s),l=t.createSuggestion(o.Text,null,e.getIcon(o),v,c.query,y,null,s,null,null),l.secondaryText=o.SecondaryText,l.secondaryTextClass=t.CssClass_Annotation,this.setRankingSignals(l,o),c.isAnswer==="1"){if(!c.url&&!t.isCortanaEnabledCache)return null;l.handoffType=6;this.setCat2or3SuggestionProperties(l,u,s,o.InstantAnswer,c.url,c.taskFrame,h)}else if(c.taskFrame){if(!t.isCortanaEnabledCache)return null;l.handoffType=c.actionUri.startsWith("action://FindMyStuff/")?4:5;i(l,u,s,c.actionUri,c.taskFrame,parseFloat(c.confidence),parseInt(c.source),this._host)}else if(l.type==t.OnlineSuggestionTypes.Store)l.handoffType=3,this.setStoreSuggestionProperties(l,u,s,c);else if(l.type==t.OnlineSuggestionTypes.Person_Consumer)l.handoffType=2,r(l,u,s,c.contactName,c.peopleScenario,this._host);else{if(!c.url)return null;l.type==t.OnlineSuggestionTypes.DirectNav||l.type==t.OnlineSuggestionTypes.Deeplink?(a=n.prettyPrintUrl(c.query,u.queryToFetch),a!=l.query&&(l.query=a,l.text=u.queryToFetch?HitHighlightingParser.addMarkers(a,u.queryToFetch):a),l.handoffType=1,f(l,u,s,c.url,this._host)):(l.handoffType=0,this.setWebSearchSuggestionProperties(l,u,s,c.url))}return t.isValidSuggestion(l,"parseOnlineSuggestion",!1)?l:null},e.prototype.setCat2or3SuggestionProperties=function(n,i,r,f,e,o,s){var c=this,h;n.secondaryTextClass=t.CssClass_Action;n.answerHtml=f&&f.Content?f.Content.HTML:null;n.answerHtml&&(h=JsonInject.GetResourceKeys([f]),h&&(n.executeScript=function(){return JsonInject.WriteAfterContentResources(JsonInject.FilterResources(s,h))}));u(n,i);e?(n.click=function(){return c.launchSearch(n.query,i,n.type,e,r,n.useRaf)},n.miniAnswerOnly=!0):(t.isValidIcon(n.icon)||(n.icon={type:4}),n.click=function(){return c._host.launchCat2or3a(n.query,o)});n.narratorText=t.getNarratorText(n)},e.prototype.setStoreSuggestionProperties=function(n,i,r,u){var e=this,f;n.icon.bgColor=u.bgColor=="transparent"?this._host.getAccentColor():u.bgColor;n.secondaryTextClass=t.CssClass_Action;f=parseFloat(u.avgRating);n.stars=this.getStars(f);n.catalogScore=parseFloat(u.catalogScore);n.avgRating=f;n.ratingCount=parseInt(u.ratingCount);n.click=function(){return e._host.launchStorePdp(u.productId)};n.narratorText=t.getNarratorText(n)},e.prototype.getStars=function(n){for(var r="",i=1;i<=5;++i)if(n>=i-.25)r+=t.CortanaFontIcons.FavoriteStarFill;else if(n>=i-.75){r+=t.CortanaFontIcons.HalfStarLeft;break}return r},e.getIcon=function(n){var t=n.IconContent;return t?t[0]=="B"?{content:t.slice(1),type:3}:t[0]=="S"?{content:t.slice(1),type:1}:{content:t,type:2}:{content:n.Icon,type:0}},e.prototype.launchSearch=function(n,t,i,r,u,f){r=this._navigationHelper.getSearchUrl(t.fullPartialQuery,n,i,r);this._host.launchSearch(n,r,f)},e.prototype.setRankingSignals=function(n,t){var i=t.Attributes;n.hc=i.hc==="1";n.highConfidenceMetaSuggestionScore=t.HighConfidenceMetaSuggestionScore;n.prefetchConfidenceScore=t.PrefetchConfidenceScore},e.prototype.compliesWithMinVersion=function(n,t){var r,u,i,f,e;if(!n)return!0;if(!t)return!1;for(r=n.split("."),u=t.split(".");r.length>u.length;)u.push("0");for(i=0;i<r.length;++i){if(f=u[i],e=r[i],f<e)return!1;if(f>e)return!0}return!0},e.prototype.setWebSearchSuggestionProperties=function(n,i,r,u){var f=this;t.isValidIcon(n.icon)||(n.icon={content:n.type==t.OnlineSuggestionTypes.SearchHistory?t.CortanaFontIcons.History:t.CortanaFontIcons.Search,type:2});n.secondaryText||(n.secondaryText=this._host.getLocString("SearchTheWeb"));n.click=function(){return f.launchSearch(n.query,i,n.type,u,r,n.useRaf)};n.narratorText=t.getNarratorText(n);n.type==t.OnlineSuggestionTypes.SearchHistory&&t.setExtraVerbs(n,function(){var n={verb:"ManageSearchHistory",displayName:f._host.getLocString("ManageSearchHistory"),executeAsync:function(){return SearchAppWrapper.CortanaApp.launcher.launchUriAsync("https://www.bing.com/profile/history?fsi=1&FORM=WNSHIS")}};return[n]})},e}();t.OnlineSuggestionsParser=e;t.setCat1SuggestionProperties=i;t.setPeopleSuggestionProperties=r;t.setDnavSuggestionProperties=f})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function e(n){return n?[n]:[]}function d(n){if(n){var t=n.lastIndexOf(".");if(t>=0)return n.substring(t)}return""}function o(t){var i;return(t&&(i=typeof t=="string"||typeof t=="number"?new Date(t):t()),n.isValidDate(i))?i:null}function i(i,r,u,f,e,s,h,c){var a=r||i.type,l;f=="System.ItemTypeText"&&(f=null);l=o(u);t.isMedia(a)?(i.secondaryText=a==t.LocalSuggestionTypes.Photo?c.getLocString("ViewPhotoPrompt"):a==t.LocalSuggestionTypes.Video?c.getLocString("PlayVideoPrompt"):c.getLocString("PlaySongPrompt"),i.additionalInfoTextForTopResult=f,i.secondaryTextClass=t.CssClass_Action,i.narratorText=t.getNarratorText(i,i.secondaryText)):(l?(i.secondaryText=n.formatString(c.getLocString("LastModifiedAnnotation"),[l.toLocaleDateString()]),i.additionalInfoTextForTopResult=f):i.secondaryText=f,i.secondaryTextClass=t.CssClass_Annotation,i.narratorText=t.getNarratorText(i));i.tooltip=rt(i.path,e,s,h,l,c)}function s(n,i,r,u,f,e){n.additionalInfoText=i;n.additionalInfoTextClass="dark";n.text=r;n.query=HitHighlightingParser.removeMarkers(r);n.textLabel=e>1?"("+e+")":null;n.primaryTextClass="singleLine";n.template=1;n.secondaryText=u;n.secondaryTextClass=t.CssClass_Annotation;var s=o(f);s&&(n.rightAlignedText=s.toLocaleDateString());n.tooltip=HitHighlightingParser.removeMarkers(r+(r&&i?"\n":"")+i);n.narratorText=t.getNarratorText(n)}function g(n,i,r,u,f){return n?t.Promise.safeChainWithGlobalCaching("getImageWithLiveTokenAsync",function(){return SearchAppWrapper.CortanaApp.getImageWithLiveTokenAsync(r)},function(){return f},function(n){return t.toIcon(n,"getImageWithLiveTokenAsync",i)},i,null,3):h(i,u,f)}function h(n,i,r){return t.Promise.safeChainWithGlobalCaching("getIconForTypeAsync",function(n){return SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getIconForTypeAsync(i,t.getImageSizeValue(n))},function(n){return n+"_"+r},function(i){return t.toIcon(i,"getIconForTypeAsync",n)},n)}function c(n){return n!=null&&(n.type==4||!!n.content)}function u(n,t,i){if(!n.text)return SharedLogHelper.LogError(t,i?"":n.deviceItem?n.deviceItem.id:"",new Error("Missing text")),!1;if(!n.query)return SharedLogHelper.LogError(t,i?"":n.text,new Error("Missing query")),!1;if(!n.handoffType&&n.handoffType!==0)return SharedLogHelper.LogError(t,i?"":n.text,new Error("Missing handoff type")),!1;if(!n.type)return SharedLogHelper.LogError(t,i?"":n.text,new Error("Missing suggestion type")),!1;var r=!n.miniAnswerOnly;return r&&!n.getIcon&&!c(n.icon)?(SharedLogHelper.LogError(t,i?"":n.text,new Error("Missing icon")),!1):!0}function r(n,i){var r=n.getExtraVerbs;n.getExtraVerbs=function(){var n=r?r():[],u=i();return t.joinVerbsWithSeparator(n,u)}}function nt(n,i){var r=n.getExtraVerbsAsync;n.getExtraVerbsAsync=r?function(){return ThresholdUtilities.createPromise(function(n){r().then(function(r){i().then(function(i){n(t.joinVerbsWithSeparator(r,i))})})})}:i}function l(n){return SearchAppWrapper.CortanaApp.launcher.launchUriAsync(n)}function tt(n,t){var r=n.propertyHits?n.propertyHits:[],i=r.indexOf(t);return typeof i=="object"&&typeof i.returnValue!="undefined"?i.returnValue:i>=0}function it(n){var i,t;if(n&&typeof n=="object"&&n.length){for(i="",t=0;t<n.length;t++)i+=n[t],t!=n.length-1&&(i+=", ");return i}return n}function rt(t,i,r,u,f,e){var o=t;return i&&(o+="\n\n"+i),r&&u&&(o=r+" - "+u+"\n\n"+o),n.isValidDate(f)&&(o+="\n\n"+n.formatString(e.getLocString("LastModifiedAnnotation"),[f.toLocaleDateString()])),o}function ut(i,r,u,f,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt){r&&n.isDataSourceEnabled(r,i,it)&&t.LocalDataProvider.getApps(it,y,f,function(t){if(y()){rt.instrumentResponseReceived(p,r,null);var i=[];o.forEach(function(u){return n.safeExecute(function(){return k(u,r,s(u).map(function(n){return t[n]}).filter(function(n){return!!n}),i)},"parseApp "+r)});w(r,i,null)}},b,r,u);h&&n.isDataSourceEnabled(h,i,it)&&t.LocalDataProvider.getSettings(it,y,l,function(t){if(y()){rt.instrumentResponseReceived(p,h,null);var i=[];a.forEach(function(u){return n.safeExecute(function(){return k(u,h,e(t[v(u)]),i)},"parseSetting "+r)});w(h,i,null)}},b,h,c);d&&n.isDataSourceEnabled(d,i,it)&&t.LocalDataProvider.getFiles(it,y,g,function(t){if(y()){rt.instrumentResponseReceived(p,d,null);var i=[];nt.forEach(function(r){return n.safeExecute(function(){return k(r,d,e(t[tt(r)]),i)},"parseFile "+d)});w(d,i,null)}},b,d)}function ft(n,i){return t.isMobileCache?null:n.id=="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"?i.getLocString("MicrosoftRecommendedBrowser"):n.isImmersive?n.isTrustedApp?i.getLocString("TrustedWindowsAppAnnotation"):i.getLocString("WindowsAppAnnotation"):n.isTrustedApp?i.getLocString("TrustedDesktopAppAnnotation"):i.getLocString("DesktopAppAnnotation")}function et(n,i){return t.isModernSetting(n)?i.getLocString("SystemSettingsAnnotation"):i.getLocString("ControlPanelAnnotation")}function ot(r,u,f,e,o){var ut=t.getAppItem(u),v,p,w,h,ht,ct,at,vt,d,l,b,g,nt,rt,k,a,c;if(ut){u.secondaryText=ft(ut,o);u.secondaryTextClass=t.CssClass_Annotation;u.narratorText=t.getNarratorText(u);return}if(t.isSetting(u.type)){u.secondaryText=et(u.deviceItem,o);u.secondaryTextClass=t.CssClass_Annotation;u.narratorText=t.getNarratorText(u);return}if(v=t.getBrowsingHistoryItem(u),v){p=v.url;w=n.prettyPrintUrl(p,r.queryToFetch);u.text=r.queryToFetch?HitHighlightingParser.addMarkers(w,r.queryToFetch):w;u.query=w;u.narratorText=t.getNarratorText(u,o.getLocString("DirectNavSuggestion"));u.secondaryText=v.title;u.additionalInfoText=" - "+u.secondaryText;u.tooltip=u.secondaryText+"\n\n"+p;u.handoffType=1;u.url=p;return}if(h=t.getFileItem(u),h){var ot=n.safeExecute(function(){return h.getProperty("System.ItemFolderPathDisplay")},"getPath"),yt=ot?ot+"\\"+u.deviceItem.displayName:u.deviceItem.displayName,l=u;l.path=yt;f==t.DataSources.MyStuffDocuments&&tt(h,"System.Search.Contents")?ht=n.safeExecute(function(){return h.getProperty("System.Search.Contents")},"getTextContent"):u.type==t.LocalSuggestionTypes.Music&&(vt=n.contains(e.enabledDataSources,t.DataSources.MyStuffDocuments),vt&&(ct=it(n.safeExecute(function(){return h.getProperty("System.Music.Artist")},"getArtist")),at=n.safeExecute(function(){return h.getProperty("System.Music.AlbumTitle")},"getTitle")),f==t.DataSources.MyStuffMusic&&(d=n.safeExecute(function(){return h.getProperty("System.Title")},"getTitle"),d&&(u.text=d)));i(l,null,function(){return h.lastModifiedDate},h.itemTypeDisplayName,ht,ct,at,o);lt(u,o);return}if(u.type==t.LocalSuggestionTypes.PathCompletion||u.type==t.LocalSuggestionTypes.CommandLine){if(l=u,u.type!=t.LocalSuggestionTypes.PathCompletion&&u.deviceItem.launchArguments||(l.path=u.deviceItem.id),b=u.deviceItem,g=b.kind,g=="program"){y(u,o);return}if(nt=t.getSuggestionTypeFromKindAndExtension(g,b.extension,e),t.isMedia(nt)){i(l,nt,null,null,null,null,null,o);return}if(rt=st(b),rt){i(l,null,null,rt,null,null,null,o);return}u.type==t.LocalSuggestionTypes.CommandLine&&y(u,o);return}if(k=t.getPowerBiItem(u),k){switch(k.resultType){case 1:a=o.getLocString("PowerBIDashboard");break;case 3:a=o.getLocString("PowerBIContentPack");break;default:a=k.modelDisplayName}u.additionalInfoTextForTopResult=a;u.additionalInfoText=n.formatString(o.getLocString("InSourceLabel"),[a]);u.narratorText=t.getNarratorText(u);return}if(c=t.getEmailItem(u),c){var pt=n.safeExecute(function(){return c.senderName},"getEmailSenderName",null,null,null,!0)||n.safeExecute(function(){return c.senderAddress},"getEmailSenderAddress",null,null,null,!0),wt=n.safeExecute(function(){return c.accountName},"getEmailAccount",null,null,null,!0),bt=function(){return n.safeExecute(function(){return c.dateSent},"getEmailDate",null,null,null,!0)};s(u,c.displayName,pt,wt,bt,null);return}}function st(n){if(n.launchArguments)return null;var t=n.itemTypeDisplayName;return t&&t[0]!="."?t:null}function v(i,r,u,f){for(var o,c,h,l,s=[],e=0;e<r.length-1;++e)if(!t.useGridLayout(u,i,r[e].type))for(o=e+1;o<r.length;++o)r[e].type==r[o].type&&r[e].text.toLowerCase()==r[o].text.toLowerCase()&&(s[e]=!0,s[o]=!0);(c=r.filter(function(n,t){return s[t]}),s.length!=0)&&(h=f.getLocString("InfoTextWithSource"),l=f.getLocString("InSourceLabel"),c.forEach(function(i){var u,r;if(i.path){if(u=i.path.lastIndexOf("\\"),u==-1)return;r=i.path.slice(i.path.lastIndexOf("\\",u-1)+1,u);i.additionalInfoTextForTopResult||!i.secondaryText?(i.additionalInfoTextForTopResult=i.additionalInfoTextForTopResult?n.formatString(h,[i.additionalInfoTextForTopResult,r]):r,i.secondaryTextClass!=t.CssClass_Action&&(i.narratorText=t.getNarratorText(i))):(i.secondaryText=n.formatString(h,[i.secondaryText,r]),i.narratorText=t.getNarratorText(i));i.additionalInfoText=n.formatString(l,[r])}}))}function y(n,i){n.secondaryText=i.getLocString("RunCommandPrompt");n.secondaryTextClass=t.CssClass_Action;n.narratorText=t.getNarratorText(n)}function ht(n){return n==t.LocalSuggestionTypes.Email||n==t.LocalSuggestionTypes.BrowsingHistory}function p(i,r,f,e,o,s,h,c,l,a,v){var tt=r.deviceItem.kind,g=t.dataSourceMayContainPII(f)&&!s.th,b,p,nt,k,d;if(!c){SharedLogHelper.LogError("parseLocalSuggestion"+f,g?"":r.deviceItem.displayName||r.deviceItem.id,new Error("Unrecognized kind: "+tt));return}if(b=2,n.isSuggestionTypeEnabled(f,c,b,i,s)){var w=ht(c)?null:r.deviceItem.displayName,it=w&&i.queryToFetch?HitHighlightingParser.addMarkers(w,i.queryToFetch):w,y=t.createSuggestion(it,r.getIcon,r.icon,c,w,n.InstrumentedItem.createInstrumentedItem(e),b,e);y.deviceItem=r.deviceItem;y.mayContainPII=ct(c);ot(i,y,f,s,o);p=t.getAppItem(y);p?(y.click=function(){return o.launchAppItem(p,f,y.appContext)},(s.maxJL||s.maxJLcm)&&at(y,p,s,o,h,e,f,l,i)):(nt=t.getBrowsingHistoryItem(y),nt?(k=y.url,y.click=function(){return t.isMobileCache?o.launchUrl(k):o.launchUrlInEdge(k)},y.getIcon=t.isMobileCache?o.getBrowserIcon:o.getEdgeIcon):y.click=function(){return o.launchDeviceItem(y.deviceItem,f)});p||t.isSetting(y.type)||t.isFileOrFolder(y.type)?y.getMruData=function(){var n={type:y.type,handoffType:y.handoffType,hc:y.hc,highConfidenceMetaSuggestionScore:y.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:y.prefetchConfidenceScore,id:r.deviceItem.id};return y.appContext&&(n.appContextData={appContext:y.appContext,query:y.query,textWithoutHH:HitHighlightingParser.removeMarkers(y.text)}),n}:(d=t.getCommandLineItem(y),d?y.hc=t.isRealCommand(y,d):c==t.LocalSuggestionTypes.PowerBi&&(y.hc=r.deviceItem.rankScore>900));s.th&&ClientTestHooks.isTesthookParamSet("forceRemoveIcon")&&t.setRemoveIcon(y);u(y,"parseLocalSuggestion "+f,g)&&v(y)&&a.push(y)}}function ct(n){return n==t.LocalSuggestionTypes.PathCompletion||n==t.LocalSuggestionTypes.Email||t.isFileOrFolder(n)}function lt(t,i){r(t,function(){var r,u;return t.duplicates&&(r=t.duplicates.filter(function(n){return n.handoffType==7})[0],r)?(u={verb:"OpenInOneDrive",displayName:n.formatString(i.getLocString("OpenIn"),["OneDrive"]),executeAsync:function(){return l(r.url)}},[u]):[]})}function at(i,u,e,o,s,h,c,l,a){var p=u.id,d=!1,y=n.contains(w,p),v;(y||(v=u.filePath,v&&(v=v.toLowerCase(),y=b.some(function(n){return v.includes(n)}),y||(d=k.some(function(n){return v.includes(n)})))),y)||(i.calculateChildSuggestions=function(){return vt(p,i,u,d,o,s,h,c,l,e,a)},e.maxJLcm&&r(i,function(){var n=[],r,u;return i.calculateChildSuggestions&&i.calculateChildSuggestions(),i.childSuggestions&&(r=!1,i.childSuggestions.filter(function(n){return!n.displayed&&n.groupType==14}).slice(0,e.maxJLcm).forEach(function(i){r=!0;var u={verb:i.text,displayName:i.text,executeAsync:function(){return f(i,o,s),t.createVoidPromise()}};n.push(u)}),u=!1,i.childSuggestions.filter(function(n){return!n.displayed&&n.groupType!=14}).slice(0,e.maxJLcm).forEach(function(i){var e,h;r&&!u&&(e={verb:null,displayName:null,executeAsync:null},n.push(e));u=!0;h={verb:i.text,displayName:i.text,executeAsync:function(){return f(i,o,s),t.createVoidPromise()}};n.push(h)})),n}))}function vt(i,r,e,o,s,h,c,l,a,v,y){var w,p,b;(r.calculateChildSuggestions=null,w=e.jumpList,w&&w.length!=0)&&(r.childSuggestions=[],p=e.filePath||"",b=p.indexOf("}"),p=p.substr(b+1),w.forEach(function(e){o&&e.type==2||(e.items.forEach(function(o,l){var v,a,w;if(o.displayName&&!n.olderThan2Weeks(o.lastAccessed)){v=t.getIcon(o,i+"_"+o.path+"_"+o.displayName,"jumpList",!1);a=t.createSuggestion(y.queryToFetch&&y.scope!=0&&y.scope!=1?HitHighlightingParser.addMarkers(o.displayName,y.queryToFetch):o.displayName,v,null,t.LocalSuggestionTypes.JumpListItem,o.displayName,n.InstrumentedItem.createInstrumentedItem(c),2,r.sequenceNumber);a.id=r.id+"_"+l;a.click=function(){return f(a,s,h)};a.jumpListItem=o;a.groupDisplayName=e.name;a.getMruData=function(){return r.getMruData()};a.parent=r;a.additionalInfoTextForTopResult=o.path;w=p&&o.path.endsWith(p);w||(a.path=o.path);switch(e.type){case 0:a.groupType=14;break;case 1:a.groupType=15;break;case 2:a.groupType=16;break;case 3:a.groupType=17;break;default:a.groupType=18}a.mayContainPII=a.groupType!=14;u(a,"calculateJumpListSuggestions",a.mayContainPII)&&(r.childSuggestions.push(a),yt(a,s))}}),r.childSuggestions.length>0&&a.instrumentDataSource(c,l,r.childSuggestions,null))}))}function f(n,i,r){t.Promise.safeChain("launchJumpList",function(){return n.jumpListItem.launchAsync()},null,function(){r.showTemporaryMessage(i.getLocString("JumpListItemUnavailable"),{content:t.CortanaFontIcons.Info,type:2});n.jumpListItem.deleteAsync&&t.Promise.safeChain("deleteJumpList",function(){return n.jumpListItem.deleteAsync()});pt(n);i.setFocusInSearchBox("jumpListItemUnavailable")})}function yt(n,i){n.jumpListItem.deleteAsync&&r(n,function(){var r={verb:t.Verbs.RemoveFromThisList,displayName:i.getLocString(t.Verbs.RemoveFromThisList),executeAsync:function(){return t.Promise.safeChain("deleteJumpList",function(){return n.jumpListItem.deleteAsync()},function(){return i.setQuery(null,!1,!0)}),t.createVoidPromise()}};return[r]})}function pt(n){var t=_ge(n.id);t.className+=" b_hide";n.suppressed=!0}var w=["Microsoft.Windows.Explorer","Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge","Microsoft.InternetExplorer.Default","Chrome","360browser",],b=["chrome","iexplore","opera","firefox","360browser","safari","skype",],k=["outlook",],a;t.getFileExtension=d;t.setFileTemplate=i;t.setEmailTemplate=s;t.getOneDriveSuggestionIcon=g;t.getIconForTypeAsync=h;t.isValidIcon=c;t.isValidSuggestion=u;t.setExtraVerbs=r;t.setExtraVerbsAsync=nt;t.getLaunchUrlContextMenuAction=l;a=function(){function i(n,t,i,r,u,f){this._config=n;this._host=t;this._instrumentationHelper=i;this._navigationHelper=r;this._temporaryMessageHandler=u;this._ciDataLoader=f}return i.prototype.parse=function(i,r,u,f,e,o){var s=this,h=[],c,l;f.suggestions.forEach(function(t){return n.safeExecute(function(){return p(i,t,u,r,s._host,s._config,s._temporaryMessageHandler,t.suggestionType,s._instrumentationHelper,h,function(){return!0})},"parseLocalSuggestion "+u)});t.isFileOrFolderLocalDataSource(u,this._config)&&v(i,h,this._config,this._host);c=u==t.DataSources.LocalApps||u==t.DataSources.LocalSettings;l=this._ciDataLoader&&c?{rankerExtraInfo:{ciVersion:this._ciDataLoader.getCurrentCiVersion()}}:null;o(u,h,l)},i}();t.SuggestionsParser=a;t.lookupById=ut;t.decorateLocalFilesAndFoldersAndMediaWithParentFolder=v;t.parseLocalSuggestion=p})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var r="/searchPreCache/mapClient?clientType=DefaultBrowser",u="/search?",f="/searchPreCache/cacheMappedClient?",e="pf=1",o="pf=2",s=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(n.JsonDataProvider),i;t.SearchPreCacheDataProvider=s;i=function(){function n(n,t){var i=this;this._webDataProvider=t;this.mapClient();n.bindConversationStart(function(){return i.mapClient()})}return n.prototype.attempPreCacheAndEnrichUrl=function(n){var t=n,i;return this._clientInfo&&this._clientInfo.mapped=="1"&&(i=n.replace(u,f)+"&"+e,this._webDataProvider.fetchUrl(i,{},null,null,null,function(){return!0}),t+="&"+o),this._clientInfo&&this._clientInfo.pcsId&&this._clientInfo.pcsId.length>0&&(t+="&pcsId="+this._clientInfo.pcsId),t},n.prototype.mapClient=function(){var n=this,t=function(t,i){return n._clientInfo=i};this._webDataProvider.fetchUrl(r,{},null,t,null,function(){return!0})},n}();t.SearchPreCacheHandler=i})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(){this._countTasks=0;this._numTasks=-1;this._partialChunkFromPreviousBatch="";this._taskCache={};this._version=-1;this._prefixCount=-1}return t.prototype.getVersion=function(){return this._version},t.prototype.getPrefixCount=function(){return this._prefixCount},t.prototype.parse=function(n){return this.parseLines(this.splitToCompleteData(n))},t.prototype.flush=function(){return this._partialChunkFromPreviousBatch?this.parseLines([this._partialChunkFromPreviousBatch]):[]},t.prototype.splitToCompleteData=function(n){if(n.length>0){var t=n.split("\n").map(function(n){return n.trim()});return t.length>0&&(t[0]=this._partialChunkFromPreviousBatch+t[0],this._partialChunkFromPreviousBatch=t.pop()),t}return[]},t.prototype.parseLines=function(i){for(var r,f,e,h,o,s=[],u=0;u<i.length;u++){if(r=n.safeExecute(function(){return JSON.parse(i[u])},"BCSParser JSON.parse",null,i[u]),!r)return null;if(this._numTasks==-1)if(f=t.unpackContentHeader(r),f)this._numTasks=f.taskCount,this._version=f.version,this._prefixCount=f.prefixCount;else return SharedLogHelper.LogError("BCSParser unpackContentHeader",i[u],new Error("Malformed BCS header")),null;else this._countTasks<this._numTasks?(this._countTasks++,e=t.unpackTask(r),e&&(h=Object.keys(r)[0],this._taskCache[+h]=e)):(o=t.unpackPrefix(r,this._taskCache),o&&s.push(o))}return s},t.unpackTask=function(n){var i=Object.keys(n)[0],t=n[i];return t&&t.length==2?{id:t[0],type:parseInt(t[1])}:null},t.unpackPrefix=function(n,i){var o=Object.keys(n)[0],u=n[o],e={prefix:o,tasks:[],suppressions:[],engagementSignals:{}},r,f;if(u.TSK)for(r=0;r<u.TSK.length;r++)f=u.TSK[r],f in i&&e.tasks.push(i[f]);if(u.SUP)for(r=0;r<u.SUP.length;r++)f=n[o].SUP[r],f in i&&e.suppressions.push(i[f]);return u.LL&&(e.engagementSignals=t.unPackSignal(u.LL)),e},t.unPackSignal=function(t){for(var i,f,e,u={},r=0;r<t.length;r++)i=t[r],i.length==3&&(f=n.getEngagementSignalKey(i[0],String(i[1])),e={SuggestionGroup:i[1],ProbSugClickGivenPref:i[2]},u[f]=e);return u},t.unpackContentHeader=function(n){return n.length==3?{version:parseInt(n[0]),taskCount:parseInt(n[1]),prefixCount:parseInt(n[2])}:null},t}();t.BCSParser=i})(i=t.Bcs||(t.Bcs={}))})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){var r=sa_config.th&&ClientTestHooks.isTesthookParamSet("bcsPopulationTrace")?n.log:function(){},u=function(){function n(n,i,u,f,e,o,s){var h=this;this._config=i;this._bcsDataReader=u;this._parser=f;this._rowsToSkip=e;this._onLoadingStopped=s;this._progress=e;t.Promise.safeChain("bcsDataReader.tryOpenFileAsync",function(){return u.tryOpenFileAsync(n)},function(n){n?(r("[BCSDataLoader] file available"),o(function(n){h._storage=n;sb_st(function(){return h.loadBatch()},0)})):(r("[BCSDataLoader] file not available"),h.close())},function(){return h.close()})}return n.prototype.cancel=function(){this._cancelRequested=!0},n.prototype.loadBatch=function(){var n=this;if(this._cancelRequested){this.close();return}this._bcsDataReader.readStringAsync?t.Promise.safeChain("bcsDataReader.readStringAsync",function(){return n._bcsDataReader.readStringAsync(n._config.bcsLoaderBatchSize)},function(t){return n.load(t)},function(){return n.close()}):t.Promise.safeChain("bcsDataReader.loadAsync",function(){return n._bcsDataReader.loadAsync(n._config.bcsLoaderBatchSize)},function(t){t<=0?n.load(null):n.load(n._bcsDataReader.readString(t))},function(){return n.close()})},n.prototype.load=function(n){var t=this;if(this._cancelRequested){this.close();return}n?this.addToDatabase(this._parser.parse(n),function(){return t.loadBatch()}):this.addToDatabase(this._parser.flush(),function(){return t.close()})},n.prototype.addToDatabase=function(n,t){var i=this,u;if(!n){this.close();return}this._rowsToSkip&&(n.length>this._rowsToSkip?(n=n.slice(this._rowsToSkip),this._rowsToSkip=0):(this._rowsToSkip-=n.length,n=[]));n.length>0?(u=n.map(function(n){return{key:n.prefix,value:n}}),this._storage.putMultiple(u,function(){if(i._progress+=u.length,r("[BCSDataLoader] "+i._progress),i._cancelRequested){i.close();return}sb_st(function(){return t()},i._config.bcsLoaderIntervalBetweenBatches)},function(n){SharedLogHelper.LogError("BCSDataLoader addToDatabase",null,n);i.close()})):t()},n.prototype.close=function(){this._bcsDataReader&&(this._bcsDataReader.close(),this._bcsDataReader=null);this._storage=null;this._onLoadingStopped&&(this._onLoadingStopped(this._progress),this._onLoadingStopped=null)},n}();i.BCSDataLoader=u})(i=t.Bcs||(t.Bcs={}))})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){var o="BingClientStore",c="BingClientStore2",s="bcs_population_status",h=2,e=function(){function n(){}return n.Populated="P",n.NotPopulated="X",n}(),f=function(){function n(){}return n.LoadingFromClient="C",n.LoadingFromServer="S",n.NotLoading="X",n}(),l=e.Populated+f.NotLoading+n.ClientSideStorage.StorageState.QuerySucceeded,u=function(){function n(){}return n.Start="S",n.Pause="P",n.Resume="R",n.Complete="C",n.Active="A",n.Inactive="I",n}(),r=sa_config.th&&ClientTestHooks.isTesthookParamSet("bcsPopulationTrace")?n.log:function(){},a=function(){function a(n,t,i,r,u,f,e,o){var s=this;this._config=n;this._clientSideStorageFactory=t;this._bcsDataReader=i;this._lightweightStorage=r;this._onDataPopulated=u;this._instrumentationHelper=e;this._status=null;this._allowPopulation=!1;n.th&&ClientTestHooks.isTesthookParamSet("clearBCS")&&(this._status=this.createEmptyStatus(),this.deleteDb(this._status.dbA),this.deleteDb(this._status.dbB));f?(f.bindShown(function(){return s.start()}),n.allowBcsPopulationWhenOtherCortanaCanvasIsActive?(f.bindAppVisible(function(){var n=SearchAppWrapper.CortanaApp.entryPoint;n&&n!="WNSSTB"&&s.start()}),f.bindAppHidden(function(){return s.stop()})):f.bindDismissed(function(){return s.stop()})):this.checkStatus();o&&o.bindItemLaunch(function(){return s.stop()})}return a.prototype.start=function(){this._allowPopulation=!0;this.checkStatus()},a.prototype.stop=function(){this._allowPopulation=!1;this._loader&&this._loader.cancel()},a.prototype.dbPopulatedForCurrentLanguage=function(){if(!this._status)return!1;var n=this.getActiveDb();return this.isFullyPopulated(n)&&n.language==t.getCurrentLanguage()},a.prototype.getActiveVersion=function(){return this._status?this.getVersion(this.getActiveDb()):undefined},a.prototype.getDataSourceState=function(n){var i=this.dbPopulatedForCurrentLanguage()?e.Populated:e.NotPopulated,r=this._dbBeingPopulated?this._dbBeingPopulated.source==0?f.LoadingFromClient:f.LoadingFromServer:f.NotLoading,t=i+r+n;return t==l?undefined:t},a.prototype.getActiveBCSStorage=function(n,t,i){this.getStorage(n,t,i,this.getActiveDb(),!0)},a.prototype.getActiveDb=function(){return this._status.activeDb==this._status.dbA.name?this._status.dbA:this._status.dbB},a.prototype.getInactiveDb=function(){return this._status.activeDb==this._status.dbA.name?this._status.dbB:this._status.dbA},a.prototype.resetDbStatus=function(n){n.version=-1;n.language=null;n.source=null;n.populatedRecords=0;n.totalRecords=-1;n.schemaVersion=n.schemaVersion?n.schemaVersion+1:1},a.prototype.deleteDb=function(t){this.resetDbStatus(t);n.ClientSideStorage.deleteDatabase(t.name);t.schemaVersion=0;this.saveStatus()},a.prototype.isFullyPopulated=function(n){return n.totalRecords>0&&n.populatedRecords==n.totalRecords},a.prototype.isPopulationInProgress=function(n){return n.totalRecords>0&&n.populatedRecords>0&&n.populatedRecords<n.totalRecords},a.prototype.createEmptyStatus=function(){var n={dbA:{name:o},dbB:{name:c},activeDb:o,schemaVersion:h};return this.resetDbStatus(n.dbA),this.resetDbStatus(n.dbB),n},a.prototype.checkStatus=function(){var l=this,o,c;if(!this._loader&&(this._status||(o=n.safeExecute(function(){return l._lightweightStorage()[s]},"getBcsStatus"),o&&(c=n.safeExecute(function(){return JSON.parse(o)},"parse BCS metadata"),c.schemaVersion==h&&(this._status=c)),!this._status&&this._allowPopulation&&(this._status=this.createEmptyStatus(),this.saveStatus())),this._allowPopulation)){var i=this.getActiveDb(),f=this.getInactiveDb(),e=t.getCurrentLanguage();n.contains(this._config.blacklistedBcsVersions,f.version)&&this.deleteDb(f);n.contains(this._config.blacklistedBcsVersions,i.version)&&(this.deleteDb(i),f.version==-1||n.contains(this._config.blacklistedBcsVersions,f.version)||(this._status.activeDb=f.name,this.saveStatus(),i=this.getActiveDb(),f=this.getInactiveDb()));this.isFullyPopulated(i)?this.isPopulationInProgress(f)&&f.language==e?(r("[BCSPopulationManager] resuming inactive "+this.getVersion(f)+" "+f.populatedRecords+"/"+f.totalRecords),this.instrument(f,u.Resume),this.load(f)):i.version<this._config.serverBcsVersion||i.language!=e?this._config.serverBcsSupportedMarkets[e]&&!n.contains(this._config.blacklistedBcsVersions,this._config.serverBcsVersion)?(this.resetDbStatus(f),f.version=this._config.serverBcsVersion,f.source=1,f.language=e,r("[BCSPopulationManager] starting inactive "+this.getVersion(f)),this.instrument(f,u.Start),this.saveStatus(),this.load(f)):r("[BCSPopulationManager] no BCS available to upgrade"):r("[BCSPopulationManager] fully populated "+this.getVersion(i)):this.isPopulationInProgress(i)&&i.language==e?(r("[BCSPopulationManager] resuming active "+this.getVersion(i)+" "+i.populatedRecords+"/"+i.totalRecords),this.instrument(i,u.Resume),this.load(i)):e=="en-us"?(this.resetDbStatus(i),i.source=0,i.language=e,r("[BCSPopulationManager] starting active "+this.getVersion(i)),this.instrument(i,u.Start),this.saveStatus(),this.load(i)):this._config.serverBcsSupportedMarkets[e]&&!n.contains(this._config.blacklistedBcsVersions,this._config.serverBcsVersion)?(this.resetDbStatus(i),i.version=this._config.serverBcsVersion,i.source=1,i.language=e,r("[BCSPopulationManager] starting active "+this.getVersion(i)),this.instrument(i,u.Start),this.saveStatus(),this.load(i)):r("[BCSPopulationManager] no BCS available to populate")}},a.prototype.saveStatus=function(){var t=this;n.safeExecute(function(){return t._lightweightStorage()[s]=JSON.stringify(t._status)},"saveBcsStatus")},a.prototype.getStorage=function(n,t,i,r,u){var f=this,e=function(n){f.deleteDb(r);t(n)};if(u&&!this.isFullyPopulated(r))return t(new Error("Tried to open unpopulated db: "+r.name)),null;this._clientSideStorageFactory(r.name,n,e,i,r.schemaVersion)},a.prototype.load=function(f){var e=this;if(f.source!=1||n.isBingEnabledCache){var s=new i.BCSParser,h,o=function(){h&&h.close();e._dbBeingPopulated=null;e._loader=null},c=function(n){e.getStorage(function(t){h=t;n(t)},function(n){SharedLogHelper.LogError("open storage",f.name,n);o()},function(){e._loader&&e._loader.cancel()},f,!1)},l=function(n){if(f.populatedRecords==n){r("[BCSPopulationManager] pausing "+e.getVersion(f)+" "+f.populatedRecords+"/"+f.totalRecords);e.instrument(f,u.Pause);o();return}f.populatedRecords=n;f.totalRecords=s.getPrefixCount();f.source==0&&(f.version=s.getVersion());e.isFullyPopulated(f)?(r("[BCSPopulationManager] completed "+e.getVersion(f)),e.instrument(f,u.Complete),e._status.activeDb=f.name,e.saveStatus(),t.Promise.safeChain("cleanupFilesAsync",function(){return e._bcsDataReader.cleanupFilesAsync()}),o(),e._onDataPopulated(),sb_st(function(){return e.checkStatus()},0)):(r("[BCSPopulationManager] pausing "+e.getVersion(f)+" "+f.populatedRecords+"/"+f.totalRecords),e.instrument(f,u.Pause),e.saveStatus(),o())};this._dbBeingPopulated=f;this._loader=new i.BCSDataLoader(this.getUrl(f),this._config,this._bcsDataReader,s,f.populatedRecords,c,l)}},a.prototype.getUrl=function(t){return t.source==0?"http://BuiltInBcs":n.getWindowProtocol()+"//"+n.getWindowHost()+"/bcs/"+t.version+"/"+t.language+".js"},a.prototype.getVersion=function(n){return(n.source==0?f.LoadingFromClient:f.LoadingFromServer)+(n.version==-1?"":n.version)},a.prototype.instrument=function(n,t){this._instrumentationHelper&&(t+=this._status.activeDb==n.name?u.Active:u.Inactive,this._instrumentationHelper.instrumentBcsPopulationEvent(this.getVersion(n),t))},a}();i.BCSPopulationManager=a})(i=t.Bcs||(t.Bcs={}))})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=function(){function i(n,t,i,r){this._config=n;this._host=t;this._instrumentationHelper=i;this._temporaryMessageHandler=r}return i.prototype.parse=function(i,r,u,f,e,o,s){var h=this,c;if(!f){n.isDataSourceEnabled(t.DataSources.BingContentStore,i,this._config)&&o(t.DataSources.BingContentStore,[],null);n.isDataSourceEnabled(t.DataSources.BCSApps,i,this._config)&&o(t.DataSources.BCSApps,[],null);n.isDataSourceEnabled(t.DataSources.BCSSettings,i,this._config)&&o(t.DataSources.BCSSettings,[],null);return}n.isDataSourceEnabled(t.DataSources.BingContentStore,i,this._config)&&(c={suppressedAppIds:f.suppressedAppIds,suppressedSettingIds:f.suppressedSettingIds,engagementSignals:f.engagementSignals,rankerExtraInfo:f.bcsVersion?{bcsVersion:f.bcsVersion}:undefined},o(t.DataSources.BingContentStore,[],c));t.lookupById(i,t.DataSources.BCSApps,t.LocalSuggestionTypes.BCSApp,f.appIds,f.appIds,function(n){return[n]},t.DataSources.BCSSettings,t.LocalSuggestionTypes.BCSSetting,f.settingIds,f.settingIds,function(n){return n},e,r,o,s,function(u,f,e,o){e.length==1&&n.safeExecute(function(){return t.parseLocalSuggestion(i,e[0],f,r,h._host,h._config,h._temporaryMessageHandler,e[0].suggestionType,h._instrumentationHelper,o,function(){return!0})},"parseLocalSuggestion "+f)},null,null,null,null,this._config,this._instrumentationHelper)},i}();t.BCSSuggestionParser=i})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,f,e,o,s){var c=this,l=function(){return _w.localStorage},a=function(){return c.reloadStorage()},h=new i.BCSPopulationManager(n,f,SearchAppWrapper.CortanaApp.bcsDataReader,l,a,e,o,s),v=function(n,t,i){return h.getActiveBCSStorage(n,t,i)},y=function(){return h.dbPopulatedForCurrentLanguage()},p=function(n){return h.getDataSourceState(n)},w=function(n,t,i){return u.createBcsResponse(t,i,h.getActiveVersion())};r.call(this,n,v,w,y,p,t.DataSources.BingContentStore,0,e);s&&!n.showNLQueriesInQF&&s.bindItemLaunch(function(n){n.handoffType==4&&c.teardownStorage()})}return __extends(u,r),u.createBcsResponse=function(t,i,r){return!t||!i?{appIds:[],settingIds:[],suppressedAppIds:[],suppressedSettingIds:[],engagementSignals:{},bcsVersion:i?r:undefined}:n.safeExecute(function(){for(var f,s,h,u,e=[],o=[],i=0;i<t.suppressions.length;i++)f=t.suppressions[i],f.type==1?e.push(f.id):o.push(f.id);for(s=[],h=[],i=0;i<t.tasks.length;i++)u=t.tasks[i],u.type==1?n.contains(e,u.id)||s.push(u.id):n.contains(o,u.id)||h.push(u.id);return{appIds:s,settingIds:h,suppressedAppIds:e,suppressedSettingIds:o,engagementSignals:t.engagementSignals,bcsVersion:r}},"createBcsResponse")},u}(n.ClientSideStorage.StorageBasedDataProvider);i.BCSDataProvider=r})(i=t.Bcs||(t.Bcs={}))})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){var r=function(){function i(i,r,u,f){var e=this;f.bindShown(function(){var u,f,o,s;n.isBingEnabledCache&&(u=e.getContstraintIndexInfo(r.lastUrl),e._ciVersion=String(u.version),f=t.getCurrentLanguage(),o=i.ciVersion,i.supportedCiMarkets[f]&&(f!=u.language||o>u.version||o<u.version&&n.contains(i.blacklistedCiVersions,u.version))&&(s=e.getUrlForCINotification(o,f),t.Promise.safeChain("constraintIndexDownloader.tryDownloadFromUrlAsync",function(){return r.tryDownloadFromUrlAsync(s)},function(){})))})}return i.prototype.getContstraintIndexInfo=function(n){var r=-1,u="",t,i;return n&&(t=n.split("/"),t.length>1&&(i=t[t.length-1].split("."),u=i.length==2?i[0]:"",r=+t[t.length-2])),{version:r,language:u}},i.prototype.getUrlForCINotification=function(t,i){return n.getWindowProtocol()+"//"+n.getWindowHost()+"/bcs/ci/"+t+"/"+i+".cab"},i.prototype.getCurrentCiVersion=function(){return this._ciVersion},i}();i.ConstraintIndexDataLoader=r})(i=t.ConstraintIndex||(t.ConstraintIndex={}))})(t=n.Windows||(n.Windows={}))}(AutoSuggest||(AutoSuggest={}))