You are on page 1of 52

var __extends=this&&this.__extends||function(){var n=Object.

setPrototypeOf||
{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var
i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),AutoSuggest;(function(n){function
u(i,r,u,f,e,o,s){t(i,r,u,function(t){return f(t.status==200&&t.responseText?
n.safeExecute(function(){return
JSON.parse(t.responseText)},"JSON.parse"):null)},e,o,s)}function t(n,t,i,r,u,f,e)
{var o=sj_gx(),s,h;try{o.open(i?"POST":"GET",n,!0)}catch(c)
{SharedLogHelper.LogError("fetchUrl",n,c);r&&r({responseText:"",contentType:"",stat
us:-1});return}if(t)for(s in
t)o.setRequestHeader(s,t[s]);u&&(h=u.register(function(){return o.abort()},!1,"xhr
abort"));o.onreadystatechange=function(){o.readyState==4&&(!f||
f())&&(o.onreadystatechange=function()
{},h&&u.unregister(h),r&&r({responseText:o.responseText,contentType:o.getResponseHe
ader("content-type")||"",status:o.status}))};typeof e!="undefined"?
o.withCredentials=e:o.withCredentials!==undefined&&(o.withCredentials=!
0);o.send(i)}function f(n){var t=n.IconContent;return t?t[0]=="S"?
{content:t.slice(1),type:1}:{content:t,type:2}:n.Icon?
{content:n.Icon,type:0}:null}var i,r;n.fetchUrlJson=u;n.fetchUrl=t;i=function()
{function i(t)
{this._dataSource=t;this._delay=n.config.webDataSourcesWithThrottling[t]||0}return
i.prototype.getBaseUrl=function(){throw new Error("Not
Implemented");},i.prototype.getPostBody=function(){return
undefined},i.prototype.onBeforeFetchUrl=function()
{},i.prototype.createUrl=function(t){return decodeURIComponent(this.getBaseUrl())+
(t?
n.encodeQueryParameter(t.queryToFetch.toLowerCase()):"")},i.prototype.addParamsToUr
l=function(n,t){var i=t?Object.keys(t):[];return
i.length>0&&(n+=n.includes("?")?"&":"?",n+=i.map(function(n){return
n+"="+t[n]}).join("&")),n},i.prototype.fetch=function(t,i,r,u,f,e,o){var
h=this,s,c;if(n.isDataSourceEnabled(this._dataSource,t))if(s=this.addParamsToUrl(th
is.createUrl(t),e),c=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()
{h._timer=null;h.onBeforeFetchUrl(r,s);h.fetchUrl(s,o,c,i,u,f)},"fetchDelay")},this
._delay);else{this.onBeforeFetchUrl(r,s);this.fetchUrl(s,o,c,i,u,f)}},i.prototype.f
etchUrl=function(i,r,u,f,e,o){var s=this;t(i,r,u,function(t){var
r=t.responseText,o=t.contentType,u=t.status,e;u==200&&(n.config.th&&r&&(r=r.replace
(new RegExp("<!--[^]*?--
>","gm"),"")),r&&o.includes("json")&&(e=n.safeExecute(function(){return
JSON.parse(r)},"parseWebProviderResponse",null,i)));f(s._dataSource,e,u==200?
null:u.toString())},this._delay>0?e:null,o)},i}
();n.JsonDataProvider=i;r=function(t){function i(i,r,u){var
f=t.call(this,n.WebDataSource)||this;return
f._instrumentationHelper=i,f._responseCacheManager=r,f._headRankingSignalsManager=u
,f}return __extends(i,t),i.prototype.getName=function()
{return"AsSuggestionsDataProvider"},i.prototype.getBaseUrl=function(){return
n.config.u},i.prototype.onBeforeFetchUrl=function(n,t)
{this._instrumentationHelper.instrumentSnRProviderFetchUrl(n,t)},i.prototype.fetch=
function(i,r,u,f,e,o,s){var
a=this,c,l,h;if(n.isDataSourceEnabled(this._dataSource,i))
{if(this._headRankingSignalsManager&&(c=this._headRankingSignalsManager.get(i),c))
{l=this.addParamsToUrl(this.createUrl(i),o);this.onBeforeFetchUrl(u,l);r(this._data
Source,c,null,2);return}h=r;h=function(t,u,f,e)
{u&&n.isEmptyUrlPrefix(i)&&(u.Suggestions=[]);a.processResourceResponse(u);r(t,u,f,
e)};this._responseCacheManager?
this.fetchWithCache(i,h,u,f,e,o,s):t.prototype.fetch.call(this,i,h,u,f,e,o,s)}},i.p
rototype.fetchWithCache=function(n,i,r,u,f,e,o){var
h=this,c=this._responseCacheManager.get(n),l,a,s;if(c)
{l=this.addParamsToUrl(this.createUrl(n),e);this.onBeforeFetchUrl(r,l);i(this._data
Source,c,null,1)}else a=function(){return!0},s=i,s=function(t,r,u)
{f()&&i(t,r,u,0);n.queryToFetch&&h.responseIsValidForCaching(u,r)&&(r.ELToken&&(r=O
bject.assign({},r),delete
r.ELToken),h._responseCacheManager.put(n,r))},t.prototype.fetch.call(this,n,s,r,u,a
,e,o)},i.prototype.responseIsValidForCaching=function(n,t){var i="HS";return!
n&&t&&t.Suggestions.every(function(n){return!n.InstantAnswer&&n.Attributes.stype!
=i})},i.prototype.processResourceResponse=function(n){var
t,i;n&&(t=n.Resources,t)&&(this._downloadedStylesResources?
this.updateWithDownloadedResources(t):this._downloadedStylesResources=t.Styles,i={S
tyles:t.Styles,Scripts:null},JsonInject.WriteHeadAndBeforeContentResources(i))},i.p
rototype.updateWithDownloadedResources=function(n){var t,i;for(t in n.Styles)for(i
in n.Styles[t])this._downloadedStylesResources[t][i]?delete n.Styles[t]
[i]:this._downloadedStylesResources[t][i]=n.Styles[t][i]},i}
(i);n.AsSuggestionsDataProvider=r;n.getIconFromOnlineResponse=f})(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function f(n,t,i,r,f){typeof
indexedDB!="undefined"&&new u(n,f,t,i,r)}function e(n,t,i,r,f){typeof indexedDB!
="undefined"&&new u(n,f,t,i,r)}function o(n,t,i,r,f,e){typeof indexedDB!
="undefined"&&new u(n,e,t,i,r,f)}function s(n,t,i,r,f,e){typeof indexedDB!
="undefined"&&new u(n,e,t,i,r,f)}function h(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&&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
i,u;t.instanceWithNumberKeys=f;t.instanceWithStringKeys=e;t.instanceWithNumberKeysA
ndSecondaryKey=o;t.instanceWithStringKeysAndSecondaryKey=s;i=n.config.th&&ClientTes
tHooks.isTesthookParamSet("dbTrace")?function(t,i){return n.log("["+t+"]
"+i)}:function(){};t.deleteDatabase=h;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._closePen
ding=!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=f
unction(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.removeRangeOnSecondaryK
ey=function(n,t,i,r){var u=this;this._secondaryIndex?
this.safeDbOperation("removeRangeOnSecondaryKey","["+n+","+t+"]","readwrite",i,func
tion(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
f,e,r,u,o;if(t._requestsInProgress>0)i(this._databaseName,"delaying close because
of "+t._requestsInProgress+" requests in progress"),this._closePending=!0;else
for(f=function(t){t._database&&(n.safeExecute(function(){return
t._database.close()},e._databaseName+".close"),i(t._databaseName,"close
completed"),t._database=null,t.onClosed())},e=this,r=0,u=t._allInstances;r<u.length
;r++)o=u[r],f(o)},t.prototype.queryFromCursor=function(t,i,r){var
u=[];t.onsuccess=function(t){var
r=t.target.result;r&&u.push({key:r.primaryKey,value:r.value});r&&u.length!
=n.config.maxIndexedDBCursorIterations?r["continue"]
():i(u)};t.onerror=r},t.prototype.removeFromCursor=function(t,i,r){var
u=0;t.onsuccess=function(t){var r=t.target.result;r&&(r["delete"](),u+=1);r&&u!
=n.config.maxIndexedDBCursorIterations?r["continue"]
():i(null)};t.onerror=r},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._databa
se?(a=this._database.transaction(this._storeName,f).objectSto
re(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
t(n,t,i,r,u,f){var
e=this;this._storageFactory=n;this.createResponse=t;this.dataPopulated=i;this.getDa
taSourceState=r;this._dataSource=u;this._storageOpenInProgress=!
1;this._pendingQueries=[];f&&(f.bindAppVisible(function(){return
e.initStorage()}),f.bindDismissed(function(){return
e._pendingQueries=[]}),f.bindAppHidden(function(){return
e.teardownStorage()}))}return t.prototype.teardownStorage=function()
{this._storage&&this._storage.close()},t.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}))},t.prototype.onError=function(n,t){t!="open
storage"&&SharedLogHelper.LogError(t,this._dataSource,n);this.teardownStorage()},t.
prototype.reloadStorage=function()
{this.teardownStorage();this.initStorage()},t.prototype.isReady=function(){return!!
this._storage},t.prototype.getKey=function(n){return n.queryToFetch?
n.queryToFetch.toLocaleLowerCase():""},t.prototype.fetch=function(t,i,r,u,f){var
o=this,e;n.isDataSourceEnabled(this._dataSource,t)&&(e=function(n,r){var
u=r=="R";f()&&i(o._dataSource,o.createResponse(t,n,u),o.getDataSourceState(r))},thi
s.innerQueryStorage(1,this.getKey(t),function(n){return e(n,"R")},function(){return
e(null,"E")},function(){return e(null,"X")},function(){return
e(null,"T")}))},t.prototype.withStorage=function(n){return this._storage?
(n(this._storage),!0):!1},t.prototype.getMaxKey=function(n){return
n.slice(0,n.length-1)+String.fromCharCode(n.charCodeAt(n.length-
1)+1)},t.prototype.queryStorage=function(n,t,i,r,u)
{this.innerQueryStorage(0,n,t,i,r,u)},t.prototype.innerQueryStorage=function(t,i,r,
u,f,e){var h=this,o=null,s=!1,c=!0,a=function(){if(c)if(c=!1,h._storage){var
n=function(n){o&&sb_ct(o);h.onError(n,"query");s||(s=!0,u())};t==0?
h._storage.getValue(i,function(n){o&&sb_ct(o);s||(s=!0,r(n))},n):i?
h._storage.getRange(i,h.getMaxKey(i),function(n){o&&sb_ct(o);s||(s=!
0,r(n))},n):h._storage.getAll(function(n){o&&sb_ct(o);s||(s=!0,r(n))},n)}else
o&&sb_ct(o),s||(s=!0,u())},l;if(this._storage)a();else
if(this.initStorage(),this._storageOpenInProgress)this._pendingQueries.push(a);else
{f();return}l=i?
n.config.indexedDBTimeout:n.config.latencyTimeoutForZeroInput;l&&(o=sb_st(function(
){return n.safeExecute(function(){o=null;c=!1;s||(s=!
0,e())},"innerQueryStorage")},l))},t}();t.StorageBasedDataProvider=i})
(t=n.ClientSideStorage||(n.ClientSideStorage={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){var i=function(){function i(n,t,i)
{this._host=n;this._instrumentationHelper=t;this._temporaryMessageHandler=i}return
i.prototype.parse=function(i,r,u,f,e,o,s){var
l=this,a=[],d,h,c,g;if(t.config.historySettingsPresent){var
v=[],y=[],p=[],w=[],b=[],k=[];if(f&&f.Suggestions)for(d=function(u){var
f=u.suggestionData,e,o;f.handoffType==2?t.isApp(f.type)?
(e=f,v.push(e.id),w.push(u)):t.isSetting(f.type)?
(e=f,y.push(e.id),b.push(u)):t.isFileOrFolder(f.type)&&(e=f,p.push(e.id),k.push(u))
:n.isBingEnabled()&&(o=n.safeExecute(function(){return
l.parseMRUWebSuggestion(i,u,r)},"parseMRUWebSuggestion"),o&&a.push(o))},h=0,c=f.Sug
gestions;h<c.length;h++)g=c[h],d(g);t.lookupById(i,"MPP",v,w,function(n)
{return[n.suggestionData.id]},"MST",y,b,function(n){return
n.suggestionData.id},e,r,o,s,function(n,t,u,f){return
l.parseIdLookupResponse(i,r,n,t,u,f)},"MFF",p,k,function(n){return
n.suggestionData.id},this._instrumentationHelper,this._host)}o(n.MRUDataSource,a,f)
},i.prototype.parseIdLookupResponse=function(i,r,u,f,e,o){var
h=this,s,c;e.length==1&&(s=u.suggestionData,c=function(n){return
h.setupRemoveFromHistoryContextMenu(n,u,h._host),s.appContextData&&(n.appContext=s.
appContextData.appContext,n.query=s.appContextData.query,n.text=i.queryToFetch?
HitHighlightingParser.addMarkers(s.appContextData.textWithoutHH,i.queryToFetch):s.a
ppContextData.textWithoutHH),h.setRankingSignals(n,s),!0},n.safeExecute(function()
{return
t.parseLocalSuggestion(i,e[0],f,r,h._host,h._temporaryMessageHandler,s.type,h._inst
rumentationHelper,o,c)},"parseLocalSuggestion
"+f))},i.prototype.setRankingSignals=function(n,t)
{n.hc=t.hc;n.highConfidenceMetaSuggestionScore=t.highConfidenceMetaSuggestionScore;
n.prefetchConfidenceScore=t.prefetchConfidenceScore;n.fromHistory=!0;n.hasMruData=!
0},i.prototype.parseMRUWebSuggestion=function(i,r,u){var
e=r.suggestionData,f=t.createSuggestion(i.queryToFetch?
HitHighlightingParser.addMarkers(e.textWithoutHH,i.queryToFetch):e.textWithoutHH,nu
ll,e.icon,e.type,e.query,n.InstrumentedItem.createInstrumentedItem(u),e.handoffType
,u,!1),o,s,h;this.setRankingSignals(f,e);switch(f.handoffType){case 5:case 4:if(!
t.isCortanaEnabledCache||f.type=="CSK"||(o=e,f.primaryMetadata=o.annotation||
o.secondaryText,!
t.setCat1SuggestionProperties(f,i,u,o.actionUri,o.taskFrame,o.confidence,o.source,t
his._host)))return null;break;case 10:return null;case
1:s=e;h=r.rankingData;i.queryToFetch.length>3&&(f.autoOpenPreviewPaneWhenOnTopHit=!
!h.previewPaneLaunchCount);f.primaryMetadata=s.title||
s.secondaryText;t.setUrlSuggestionProperties(f,i,u,s.url,this._host);break;default:
return SharedLogHelper.LogError("parseMruWebSuggestion",null,new Error("Unexpected
handoff type: "+e.handoffType)),null}return
t.isValidSuggestion(f,"parseMruWebSuggestion")?
(this.setupRemoveFromHistoryContextMenu(f,r,this._host),f):null},i.prototype.setupR
emoveFromHistoryContextMenu=function(n,i,r){var
u=this;i.remove&&t.setExtraVerbs(n,function(t){if(t||!i.remove)return[];if(!
n.removeIcon&&n.duplicates&&n.duplicates.some(function(n){return!
n.fromHistory}))return[];var
f={verb:"RemoveFromDeviceHistory",displayName:r.getLocString("RemoveFromDeviceHisto
ry"),executeSync:function(){i.remove(function()
{r.refreshCurrentPane();u._temporaryMessageHandler.showTemporaryMessage(r.getLocStr
ing("RemovedFromDeviceHistory",HitHighlightingParser.removeMarkers(n.text)),
{content:"&#xE946",type:2})});delete i.remove},icon:
{content:"&#xE711",type:2}};return[f]},!0)},i}();t.MRUParser=i})(t=n.WSB||
(n.WSB={}))}(AutoSuggest||(AutoSuggest={}));__extends=this&&this.__extends||
function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.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){var
l=this;r&&r.bindItemLaunch(function(n,t,i){return l.onLaunch(n,t,i)});var
a,v=function(t,r,f){return u(s,function(i){t(i);var r=n.getTimeDiffInDays(a);
(r===null||r>=1)&&(a=n.getCurrentDate(),l.prune())},r,f,i)},y=function(t,i,r)
{return n.safeExecute(function(){return
l.createMruResponse(t,i,r)},"createMruResponse")},p=function(){return!
0},w=function(n){return n=="R"?undefined:n};return
f.bindClearMRURequested(function(t)
{l.teardownStorage();n.ClientSideStorage.deleteDatabase(s,function(){return t(!
0)},function(){return t(!1)})}),l=t.call(this,v,y,p,w,n.MRUDataSource,f)||
this,l.candidatesEnabled=h,l.loggingEnabled=c,l.getSuggestionKey=e,l.getGroupType=o
,l._pendingWrites=[],l}return __extends(r,t),r.prototype.getName=function()
{return"MRUDataProvider"},r.prototype.shouldStoreSuggestions=function(){return
n.config.historySettingsPresent&&this.candidatesEnabled()},r.prototype.createMruRes
ponse=function(t,i,r){var c=this,f,s,u,o,h;if(i=i||
[],f=this.getKey(t),this._lastKey=r?f:null,s=r?i.find(function(n){return
n.key==f}):null,this._valueForLastKey=s?
s.value:null,u={},n.config.mruSignalsEnabled&&this._valueForLastKey&&(u.SuggestionE
ngagementData=this._valueForLastKey.SuggestionEngagementData),u.LookupCompletions=i
.map(function(n)
{return{key:n.key,value:n.value.SuggestionEngagementData}}),this.shouldStoreSuggest
ions()){var e=[],v=this.getOldestDateToKeep(),y=function(n,t){var
u,i,r,f;if(t.Suggestions)for(u=function(i){var
r=l.getRankingData(t,i);r&&r.lastLaunchTime&&r.lastLaunchTime>=v&&e.push({rankingDa
ta:n==l._lastKey?
{prefixLaunchCount:r.prefixLaunchCount,lastLaunchTime:r.lastLaunchTime,previewPaneL
aunchCount:r.previewPaneLaunchCount,lastPreviewPaneLaunchTime:r.lastPreviewPaneLaun
chTime}:r,suggestionData:i,remove:function(t){return
c.remove(n,i,t)}})},i=0,r=t.Suggestions;i<r.length;i+
+)f=r[i],u(f)},l=this;for(o=0,h=i;o<h.length;o++){var
a=h[o],p=a.key,w=a.value;y(p,w)}e.length>0&&(u.Suggestions=[],e.sort(function(n,t)
{return t.rankingData.lastLaunchTime-
n.rankingData.lastLaunchTime}),e.forEach(function(n){return
c.addToResponseIfNotPresent(u.Suggestions,n)}),f?f.length<=n.config.mruLengthA?
u.Suggestions.splice(n.config.maxMruA):f.length<=n.config.mruLengthB&&u.Suggestions
.splice(n.config.maxMruB):u.Suggestions.splice(n.config.maxMruZeroInput))}return
u},r.removeRankerSignals=function(n,t){return
n=="highConfidenceMetaSuggestionScore"||n=="prefetchConfidenceScore"?
undefined:t},r.prototype.addToResponseIfNotPresent=function(n,t){var
f=JSON.stringify(t.suggestionData,r.removeRankerSignals),i=n.find(function(n)
{return JSON.stringify(n.suggestionData,r.removeRankerSignals)==f}),u;i?
(u=i.remove,i.remove=function(n){return u(function(){return
t.remove(n)})},i.rankingData.lastLaunchTime=Math.max(i.rankingData.lastLaunchTime,t
.rankingData.lastLaunchTime),i.rankingData.prefixLaunchCount+=t.rankingData.prefixL
aunchCount,t.rankingData.previewPaneLaunchCount&&(i.rankingData.previewPaneLaunchCo
unt=(i.rankingData.previewPaneLaunchCount||0)+t.rankingData.previewPaneLaun
chCount),t.rankingData.lastPreviewPaneLaunchTime&&(i.rankingData.lastPreviewPaneLau
nchTime=i.rankingData.lastPreviewPaneLaunchTime?
Math.max(i.rankingData.lastPreviewPaneLaunchTime,t.rankingData.lastPreviewPaneLaunc
hTime):t.rankingData.lastPreviewPaneLaunchTime)):n.push(t)},r.prototype.addToDataIf
NotPresent=function(n,t){var
i=JSON.stringify(t,r.removeRankerSignals),u=n.find(function(n){return
JSON.stringify(n,r.removeRankerSignals)==i});u||
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(n,t,i){var
r=this,u;if(this.loggingEnabled()){if(this._writing)
{this._pendingWrites.push(function(){return
r.onLaunch(n,t,i)});return}this._writing=!0;u=this.getKey(t);this._lastKey==u?
this.updateAndSaveLaunchData(u,this._valueForLastKey,n,i):this.queryStorage(u,funct
ion(t){return r.updateAndSaveLaunchData(u,t,n,i)},function(){return
r.onAfterWrite()},function(){return r.onAfterWrite()},function(){return
r.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,funct
ion(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.SuggestionEngagementData=t.SuggestionEngagementDat
a||{}):t={LastUpdated:r.getUnixTime(),SuggestionEngagementData:
{}},f=this.getSuggestionKey(i),t.SuggestionEngagementData[f]=this.updateMRUEntryCli
cksAndTime(t.SuggestionEngagementData[f],t.LastUpdated,u),this.getGroupType&&(t.Sug
gestionEngagementData[f].groupType=this.getGroupType(i)),this.shouldStoreSuggestion
s()&&(e=i.getMruData(),e&&n&&(t.Suggestions||
(t.Suggestions=[]),this.addToDataIfNotPresent(t.Suggestions,e))),t},r.prototype.upd
ateMRUEntryClicksAndTime=function(n,t,i){return n?
(n.prefixLaunchCount+=1,n.lastLaunchTime=t):n={prefixLaunchCount:1,lastLaunchTime:t
},i&&(n.previewPaneLaunchCount=(n.previewPaneLaunchCount||
0)+1,n.lastPreviewPaneLaunchTime=t),n},r.prototype.getOldestDateToKeep=function()
{var t=n.getCurrentDate();return t.setDate(t.getDate()-
n.config.mruMaxAgeInDays),r.getUnixTime(t)},r.prototype.updateAndSaveLaunchData=fun
ction(t,i,r,u){var f=this;if(i=n.safeExecute(function(){return
f.createOrUpdateDbEntry(t,i,r,u)},"createOrUpdateDbEntry"),!i)
{this.onAfterWrite();return}n.safeExecute(function(){return
f.removeOldLaunches(i,f.getOldestDateToKeep())},"removeOldLaunches");this._lastKey=
t;this._valueForLastKey=i;this.withStorage(function(n){return n.put(t,i,function()
{return f.onAfterWrite()},function(n)
{f.onError(n,"updateAndSaveLaunchData");f.onAfterWrite()})})||
this.onAfterWrite()},r.prototype.removeAndSaveLaunchData=function(n,t,i,r){var
u=this,e,f;if(!t){SharedLogHelper.LogError("removeAndSaveLaunchData",null,new
Error("MRU entry not
present"));this.onAfterWrite();return}if(e=JSON.stringify(i),f=(t.Suggestions||
[]).findIndex(function(n){return JSON.stringify(n)==e}),f==-1)
{SharedLogHelper.LogError("removeAndSaveLaunchData",null,new Error("Suggestion not
present in
MRU"));this.onAfterWrite();return}t.Suggestions.splice(f,1);this._lastKey=n;this._v
alueForLastKey=t;this.withStorage(function(i){return i.put(n,t,function()
{r&&r();u.onAfterWrite()},function(n)
{u.onError(n,"removeAndSaveLaunchData");u.onAfterWrite()})})||
this.onAfterWrite()},r.prototype.getRankingData=function(n,t){return
n.SuggestionEngagementData?
n.SuggestionEngagementData[t.suggestionKey]:undefined},r.prototype.removeOldLaunche
s=function(n,t){var i,r,u;if(n.Suggestions)for(i=n.Suggestions.length-1;i>=0;--
i)r=this.getRankingData(n,n.Suggestions[i]),u=r?r.lastLaunchTime:null,(!u||
u<t)&&n.Suggestions.splice(i,1);this.removeOldEngagementData(n.SuggestionEngagement
Data,t)},r.prototype.removeOldEngagementData=function(n,t){var i,r,u;if(n)for(i in
n)r=n[i],r&&(u=r.lastLaunchTime,(!u||u<t)&&delete
n[i])},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){var i;
(function(i){function a(n,t){var r,i;if(f||g(),r=f[n],!r)throw new
Error("Unsupported data source: "+n);if(i=r.filter(function(n){return!n.enabled||
n.enabled(t)}),i.length==0)throw new Error("No enabled strategies for data source:
"+n);else if(i.length>1)throw new Error("Multiple strategies for data source:
"+n);else return i[0]}function or(n){return f||g(),!!f[n]}function sr(n,t,i){if(!
f||!f[i]||t.taskFrame)return!1;var r=a(i,t);return r.sfgaoFilter?!
r.sfgaoFilter(n.getProperty("System.SFGAOFlags")):!1}function r(n,t){return
n=ai.concat(n),t&&(n=n.concat(vi)),n}function g(){var
a=0,e=SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getUserSID(),d=
ni(a,e,!1),g=d[0],o=d[1],nt=ni(a,e,!0),i=nt[0],n=nt[1];w=g;vt=o;var
tt='"System.Kind" != ANY ARRAY['+k.concat("link").map(function(n)
{return"'"+n+"'"}).join(", ")+"] AND "+g,gt="\"System.Kind\" = SOME
ARRAY['program'] AND "+i,it='"System.Kind" != ANY ARRAY['+pt.map(function(n)
{return"'"+n+"'"}).join(", ")+"] AND "+i,s='"System.Kind" != ANY
ARRAY['+yt.concat(k).concat("folder").map(function(n){return"'"+n+"'"}).join(", ")
+"] AND "+i,ti="\"System.Kind\" = SOME ARRAY['folder'] AND "+i,wt="\"System.Kind\"
= SOME ARRAY['Music'] AND "+i,bt="\"System.Kind\" = SOME ARRAY['Picture'] AND
"+i,kt='"System.Kind" = SOME ARRAY['+b.map(function(n){return"'"+n+"'"}).join(", ")
+"] AND "+i,dt="SCOPE = 'winrt://
{"+e+"}/LS/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/spartan
history'";f={};f.IFF=[{selectFields:r(h,!1),filterFieldsSets:
[rt],mostRelevantProps:c,kindAndScopeClauses:tt,sortClause:u,searchOptions:3,sfgaoF
ilter:o,enabled:function(n){return!!n.queryToFetch&&!
t.supportsShortcuts("IFF",n)}},{selectFields:r(h,!1),filterFieldsSets:
[],mostRelevantProps:c,kindAndScopeClauses:tt,sortClause:u,searchOptions:0,sfgaoFil
ter:o,enabled:function(n){return!n.queryToFetch&&!t.supportsShortcuts("IFF",n)}},
{selectFields:r(ut,!0),filterFieldsSets:
[yi],mostRelevantProps:c,kindAndScopeClauses:it,sortClause:u,searchOptions:3,sfgaoF
ilter:n,enabled:function(n){return!!n.queryToFetch&&t.supportsShortcuts("IFF",n)}},
{selectFields:r(ut,!0),filterFieldsSets:
[],mostRelevantProps:c,kindAndScopeClauses:it,sortClause:u,searchOptions:0,sfgaoFil
ter:n,enabled:function(n){return!
n.queryToFetch&&t.supportsShortcuts("IFF",n)}},];f.EBH=[{selectFields:ft,filterFiel
dsSets:
[pi],mostRelevantProps:et,kindAndScopeClauses:dt,sortClause:ot,searchOptions:7,sfga
oFilter:null,enabled:function(n){return!!n.queryToFetch}},
{selectFields:ft,filterFieldsSets:
[wi],mostRelevantProps:et,kindAndScopeClauses:dt,sortClause:ot,searchOptions:0,sfga
oFilter:null,enabled:function(n){return!
n.queryToFetch}},];f.MDOC=[{selectFields:r(l,!0),filterFieldsSets:
[st.concat(gi)],mostRelevantProps:v,kindAndScopeClauses:s,sortClause:u,searchOption
s:3,sfgaoFilter:n,enabled:function(n){return
n.queryToFetch&&t.config.minLengthForContentMatch&&n.queryToFetch.length>=t.config.
minLengthForContentMatch}},{selectFields:r(l,!0),filterFieldsSets:
[st],mostRelevantProps:v,kindAndScopeClauses:s,sortClause:u,searchOptions:3,sfgaoFi
lter:n,enabled:function(n){return n.queryToFetch&&(!
t.config.minLengthForContentMatch||
n.queryToFetch.length<t.config.minLengthForContentMatch)}},{selectFields:r(l,!
0),filterFieldsSets:
[],mostRelevantProps:v,kindAndScopeClauses:s,sortClause:u,searchOptions:0,sfgaoFilt
er:n,enabled:function(n){return!n.queryToFetch}},];f.MFOL=[{selectFields:r(nr,!
0),filterFieldsSets:
[ir],mostRelevantProps:tr,kindAndScopeClauses:ti,sortClause:u,searchOptions:3,sfgao
Filter:n}];f.MPHO=[{selectFields:r(y,!0),filterFieldsSets:
[rr],mostRelevantProps:ht,kindAndScopeClauses:bt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(y,!
0),filterFieldsSets:
[],mostRelevantProps:ht,kindAndScopeClauses:bt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.MVID=[{selectFields:r(p,!
0),filterFieldsSets:
[ur],mostRelevantProps:ct,kindAndScopeClauses:kt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(p,!
0),filterFieldsSets:
[],mostRelevantProps:ct,kindAndScopeClauses:kt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.MMUS=[{selectFields:r(lt,!
0),filterFieldsSets:
[fr],mostRelevantProps:at,kindAndScopeClauses:wt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(lt,!
0),filterFieldsSets:
[],mostRelevantProps:at,kindAndScopeClauses:wt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.IBA=[{selectFields:r(bi,!
0),filterFieldsSets:
[di],mostRelevantProps:ki,kindAndScopeClauses:gt,sortClause:u,searchOptions:3,sfgao
Filter:n}];f.MFF=[{selectFields:r(h,!1),filterFieldsSets:
[er],mostRelevantProps:null,kindAndScopeClauses:null,sortClause:null,searchOptions:
0,sfgaoFilter:null}]}function hr(n,t,i){return kr(n.queryToFetch).then(function(r)
{return lr(n,r,t,i)})}function cr(n,t,i){var r=a(t,n);return"SELECT
TOP "+i.length+" "+wt(r.selectFields)+" FROM SystemIndex WHERE "+pr(r,i)}function
lr(n,t,i,r){var
f=SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getLCIDStringForTex
t(n.queryToFetch),u=n.taskFrame?ru(r,n.taskFrame.parsed,f):a(r,n);return"SELECT TOP
"+i+" "+wt(u.selectFields)+" FROM SystemIndex WHERE
"+wr(u,n.queryToFetch,t,u.searchOptions,f)+" ORDER BY "+u.sortClause}function ar(n)
{var t={displayName:n.displayName,id:n.id,kind:n.kind,getProperty:function(t)
{return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,url:n.getProper
ty("System.Link.TargetUrl"),title:n.getProperty("System.Title"),visitCount:n.getPro
perty("System.History.VisitCount"),dateVisited:n.getProperty("System.Link.DateVisit
ed")};return t.originalDeviceItem=n,t}function vr(n){var
f,i,r,t,u;if(n.kind=="link"||
n.kind=="program")for(f=n.getProperty("System.Kind"),i=0,r=f;i<r.length;i++)
{if(t=r[i],t=="program")return yr(n,t);if(t!="link")return
u={displayName:n.displayName,id:n.id,kind:t,getProperty:function(t){return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,getImageAsync:f
unction(t){return
n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,g
etVerbsAsync:function(){return
n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,
createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate},u.originalDeviceItem
=n,u}return n}function yr(n,i){var r=n.displayName,u,f;return
r.toLocaleLowerCase().endsWith(".lnk")&&(r=r.substr(0,r.length-
4)),u=t.indexerFilePathToRegularPath(n.id),f={displayName:r,id:u,kind:i,getProperty
:function(t){return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,getImageAsync:f
unction(t){return
n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,g
etVerbsAsync:function(){return
n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,
createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate,filePath:u,lastAccess
ed:n.getProperty("System.DateAccessed"),version:null,isImmersive:!
1,logoBackgroundColor:null,launchArguments:null,totalLaunches:null,isTrustedApp:!
1,packageFamilyName:null,jumpList:null,getJumpListAsync:null,voiceCommandExamples:n
ull,rawIndexResponse:null},f.originalDeviceItem=n,f}function wt(n){return
n.map(function(n){return
n=="System.ParsingPath"?"path":'"'+n+'"'}).join(",")}function pr(n,t)
{return"("+dr(n,t)+")"}function wr(n,t,i,r,u){var f="",e;return
n.mostRelevantProps.length>0&&(f+="WITH ("+n.mostRelevantProps.join(", ")+") AS
#MRProps "),e=gr(n,t,i,r,u),e&&(f+="("+e+") AND "),f+n.kindAndScopeClauses}function
br(n,t){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.tokenize(n,t)}functio
n kr(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.getLinguisticDataAsync(n)}function
bt(t,i){var r="",u=t.filterFieldsSets.length>1;return
t.filterFieldsSets.forEach(function(t){var s,f,h,l,e,o,c,a;for(u&&(r?r+=") AND
(":r="("),s=!0,f=0,h=t;f<h.length;f++){for(l=h[f],e=!1,o=0,c=i;o<c.length;o+
+)a=c[o],s?(r+="(",s=!1):r+=e?" OR ":" OR (",r+=n.formatString(l,[a]),e=!
0;e&&(r+=")")}}),u&&(r+=")"),r}function dr(n,t){var i=t.map(function(n){return
nt(n)});return bt(n,i)}function gr(n,t,i,r,u){var o=[t],e,f;return
i.alternatives&&i.alternatives.forEach(function(n){return
o.push(n)}),e=o.map(function(n){return nt(n)}),f=bt(n,e),
(r&2)==2&&(f=nu(r,i,e,f,u)),f}function nu(t,i,r,u,f){for(var
k,o,s,v,h,e,c,w,d,g=tu(t),l=!1,a=0,b=g;a<b.length;a++){for(k=b[a],o=!
1,s=0,v=r;s<v.length;s++){var nt=v[s],y=[],p=br(nt,i.language);if((t&4)==0||
p.length<=it)for(h=0;h<Math.min(p.length,it);++h)y.push(p[h]);if(y.length>1)
{for(e="",c=0,w=y;c<w.length;c++)d=w[c],e&&(e+=" AND "),e+='"'+d+(l?'*"':'"');u?
u+=o?" OR ":" OR (":u="(";u+=n.formatString(k,[e,f]);o=!0}}o&&(u+=")");l=!l}return
u}function tu(n){var t=[];return t.push("CONTAINS(#MRProps, '{0}', {1}) RANK BY
COERCION(ABSOLUTE, 600)"),(n&1)==1&&t.push("CONTAINS(#MRProps, '{0}', {1}) RANK BY
COERCION(ABSOLUTE, 550)"),t}function kt(n,t){return
n=n.replace(/'/g,"''"),n=n.replace(/"/g," "),t>=2&&(n=n.replace(/
%/g,"[%]"),n=n.replace(/_/g,"[_]"),n=n.replace(/\[/g,"[[]"),t==3?
(n=n.replace(/\*/g,"%"),n=n.replace(/\?/g,"_")):(n=n.replace(/\*/g,"
"),n=n.replace(/\?/g," "))),n}function e(n){return kt(n,1)}function nt(n){return
kt(n,2)}function iu(n){var t=s[n];if(t)return t;throw new Error("select fields for
NL Data source was not found: "+n);}function o(n,t,i){for(var
u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];typeof i=="string"?
(i=nt(i),t.push(u.map(function(t){return"CONTAINS("+t+",'\""+i+"*\"',"+n+") RANK BY
COERCION(ABSOLUTE, 1000)"}))):i&&i.Value&&o.apply(void 0,
[n,t,i.Value].concat(u))}function ru(n,t,i){var f=[],e='"System.Kind" != ANY
ARRAY['+d+"]",s,r;if(t.FileType&&t.FileType.Value){s=t.FileType.Value;switch(s)
{case"Document":break;case"Picture":e="\"System.Kind\" = SOME
ARRAY['Picture']";break;case"Video":e='"System.Kind" = SOME
ARRAY['+b.map(function(n){return"'"+n+"'"}).join(", ")
+"]";break;case"Powerpoint":case"Word":case"Excel":e="CONTAINS(System.ItemType,'\""
+dt[s]+"*\"',"+i+') RANK BY COERCION(ABSOLUTE, 1000) AND "System.Kind" != ANY
ARRAY['+d+"]";break;default:e='"System.Kind" != ANY
ARRAY['+d+"]";o(i,f,s,"System.ItemType","System.ItemTypeText")}}return
o(i,f,t.Title,"System.ItemNameDisplay","System.Title"),o(i,f,t.Body,"System.ItemNam
eDisplay","System.Title","System.FileDescription","System.Keywords","System.Search.
Contents"),t.People&&t.People.forEach(function(n){var t=n.Value;t&&o(i,f,t=="me"?
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.userName:t,"System.Au
thor","System.FileOwner","System.Document.LastAuthor","System.Photo.TagViewAggregat
e")}),o(i,f,t.Place,"System.Photo.TagViewAggregate"),r=uu(t.Time),r&&f.push(["Syste
m.DateCreated>='"+r[0]+"' AND
System.DateCreated<'"+r[1]+"'","System.DateModified>='"+r[0]+"' AND
System.DateModified<'"+r[1]+"'","System.DateAccessed>='"+r[0]+"' AND
System.DateAccessed<'"+r[1]+"'","System.DateArchived>='"+r[0]+"' AND
System.DateArchived<'"+r[1]+"'","System.DateAcquired>='"+r[0]+"' AND
System.DateAcquired<'"+r[1]+"'",]),
{selectFields:iu(n),filterFieldsSets:f,kindAndScopeClauses:e?e+" AND
"+w:w,mostRelevantProps:[],searchOptions:0,sortClause:u,sfgaoFilter:vt}}function
uu(t){var i,f,u,e,r;return t?(i=t.value,!i)?null:(f=i.indexOf("T"),f!=-
1&&(i=i.substr(0,f)),u=i.split("-"),u.length<2||u.length>3)?null:(e=new Date(i),!
n.isValidDate(e))?null:(r=new Date(i),u.length==3?r.setUTCDate(r.getUTCDate()
+1):r.setUTCMonth(r.getUTCMonth()+1),[gt(e),gt(r)]):null}function gt(n){var
t=n.toISOString();return t.substr(0,t.indexOf("T"))}function ni(n,i,r){var
u,h,c,f,o,s,l,a,v;r||(u="NOT System.Shell.SFGAOFlagsStrings = SOME ARRAY['hidden']
AND NOT System.Shell.SFGAOFlagsStrings = SOME ARRAY['system'] AND NOT
System.Shell.SFGAOFlagsStrings = SOME ARRAY['link']");r?h=function(n){return!
(n&si)&&!(n&oi)&&(!!(n&&hi)||n&&li&&!!(n&&tt)||n&&ci&&!!(n&&tt))}:(u+=" AND
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['stream']",u+=" OR
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['fileanc'] AND
System.Shell.SFGAOFlagsStrings = SOME ARRAY['folder'])",u+=" OR
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['storageanc'] AND
System.Shell.SFGAOFlagsStrings = SOME ARRAY['folder'])",u+=")");r?
u="System.Shell.OmitFromView != 'true'":u+=" AND System.Shell.OmitFromView !=
'true'";c=e(t.getKnownFolderPathLC(t.FOLDERID_Profile));switch(n){case
0:f=e(t.getKnownFolderPathLC(ri));u+=" AND (Scope = 'file://' OR Scope = 'csc://
{"+i+"}') AND (Scope <> 'file:"+c+"\\AppData') AND (Scope <>
'file:"+f+"\\Default\\AppData') AND (Scope <>
'file:"+f+"\\Administrator\\AppData')";o=e(t.getKnownFolderPathLC(ti));s=e(t.getKno
wnFolderPathLC(ii));u+=" AND (Scope <> 'file:"+o+"')";s!=o&&(u+=" AND (Scope <>
'file:"+s+"')");l=e(t.getKnownFolderPathLC(ui));u+=" AND (Scope <>
'file:"+l+"')";a=e(t.getKnownFolderPathLC(fi));u+=" AND (Scope <>
'file:"+a+"')";r&&(v=e(t.getKnownFolderPathLC(ei)),u+=" AND (Scope <>
'file:"+v+"')");break;case 1:u+=" AND (Scope = 'file://' OR Scope = 'csc://
{"+i+"}')";break;default:throw new Error("Unknown SearchScope:
"+n);}return[u,h]}var ti="{905e63b6-c1bf-494e-b29c-65b732d3d21a}",ii="{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}",ri="{0762D272-C50A-4BB0-A382-
697DCD729B80}",ui="{A4115719-D62E-491D-AA7C-E74B8BE3B067}",fi="{0482af6c-08f1-4c34-
8c90-e17ec98b1e17}",ei="{bfb9d5e0-c6a9-404c-b2b2-
ae6db6af4968}",oi=4096,si=524288,hi=4194304,tt=536870912,ci=8388608,li=268435456,it
=3,u='"System.Search.Rank" DESC, "System.DateModified" DESC,
"System.ItemNameDisplay"
ASC',ai=["System.Kind","System.Search.Rank","System.ParsingPath","System.DateCreate
d","System.DateModified","System.Search.QueryPropertyHits","System.ItemNameDisplay"
,"System.FileExtension","System.ItemType",],vi=["System.Link.TargetParsingPath","Sy
stem.SFGAOFlags",],h=["System.Title","System.Music.AlbumTitle","System.Music.Displa
yArtist"],c=["System.ItemNameDisplay","System.Music.DisplayArtist","System.Music.Al
bumTitle",],rt=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
990)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
960)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
890)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
860)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
790)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
760)","System.Music.AlbumTitle = '{0}' RANK BY COERCION(ABSOLUTE,
690)","CONTAINS(System.Music.AlbumTitle, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
660)",],ut=h.concat("System.DateAccessed"),yi=rt.concat(["CONTAINS(System.Link.Targ
etParsingPath, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
920)"]),ft=["System.ItemNameDisplay","System.Search.QueryPropertyHits","System.Kind
","System.Search.Rank","System.Link.TargetUrl","System.Title","System.History.Visit
Count","System.Link.DateVisited","System.DateCreated","System.DateModified",],et=["
System.Link.TargetUrl","System.Title",],pi=["(System.
Link.TargetUrl LIKE 'http%' AND CONTAINS(System.Title, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE, 1000))","(System.Link.TargetUrl LIKE 'http%' AND
CONTAINS(System.Link.TargetUrl, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
995))",],wi=["(System.Link.TargetUrl LIKE 'http%' RANK BY COERCION(ABSOLUTE,
995))",],ot='"System.History.VisitCount" DESC, "System.Link.DateVisited" DESC,
"System.Title"
ASC',bi=["System.DateAccessed",],ki=["System.ItemNameDisplay",],di=["System.ItemNam
eDisplay = '{0}' RANK BY COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay,
'\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","CONTAINS(System.Link.TargetParsingPath, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
795)",],l=["System.Search.AutoSummary","System.Keywords","System.Title","System.Aut
hor","System.Document.LastAuthor",],v=["System.ItemNameDisplay","System.Keywords","
System.Title",],st=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Keywords = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Keywords, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)",],gi="CONTAINS(System.Search.Contents, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
545)",nr=[],tr=["System.ItemNameDisplay",],ir=["System.ItemNameDisplay = '{0}' RANK
BY COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
895)",],y=["System.Photo.TagViewAggregate","System.Title",],ht=["System.ItemNameDis
play","System.Photo.TagViewAggregate",],rr=["System.ItemNameDisplay = '{0}' RANK BY
COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE, 895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Photo.TagViewAggregate = '{0}' RANK BY COERCION(ABSOLUTE,
940)","CONTAINS(System.Photo.TagViewAggregate, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
835)",],p=["System.Title","System.Keywords","System.Music.DisplayArtist","System.Mu
sic.Genre",],ct=["System.ItemNameDisplay","System.Title","System.Keywords",],ur=["S
ystem.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)","System.Music.Genre = '{0}' RANK BY COERCION(ABSOLUTE,
950)","CONTAINS(System.Music.Genre, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
845)","System.Keywords = '{0}' RANK BY COERCION(ABSOLUTE,
940)","CONTAINS(System.Keywords, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
835)",],lt=["System.Title","System.Music.DisplayArtist","System.Music.AlbumTitle","
System.Music.Genre",],at=["System.ItemNameDisplay","System.Title","System.Music.Alb
umTitle",],fr=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Music.AlbumTitle = '{0}' RANK BY COERCION(ABSOLUTE,
970)","CONTAINS(System.Music.AlbumTitle, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
865)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)","System.Music.Genre = '{0}' RANK BY COERCION(ABSOLUTE,
950)","CONTAINS(System.Music.Genre, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
845)",],er=["path =
'{0}'"],f,s,dt;i.getStrategy=a;i.dataSourceSupported=or;i.suppress=sr;var
w,vt,b=["Movie","RecordedTV","Video"],yt=b.concat(["Picture","Music"]),pt=["calenda
r","game","web
history","feed","contact","task","journal","note","instantmessage"],k=pt.concat("pr
ogram"),d=yt.concat(k).concat(["folder","link"]).map(function(n)
{return"'"+n+"'"}).join(",");i.initStrategies=g;i.generateIndexerQueryAsync=hr;i.ge
nerateIndexerQueryForMRUFilesAndFolders=cr;i.toBrowsingHistoryItem=ar;i.fixKind=vr;
s={};s.MPHO=r(y,!1);s.MVID=r(p,!1);s.MDOC=r(l,!1);dt=function(){var n={};return
n.Powerpoint="ppt",n.Word="doc",n.Excel="xls",n}()})(i=t.IndexerQueryGenerator||
(t.IndexerQueryGenerator={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function s(n,i,r,u,f,e,o){var s=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",e,o,s)},e,f?function(){return
n.imageType===0}:null,s)}function i(n,i,r,u,f,e)
{return{deviceItem:n,getIcon:s(n,n.id,r,r&&!
t.localDataSourceMayContainPII(r),t.displayedInGridLayout(i),u,f),icon:e?
u:null,suggestionType:i}}function e(n,t,i)
{return{deviceItem:n,icon:i,suggestionType:t}}function r(t,i,r){switch(t)
{case"program":return"IBA";case"picture":return
i&&n.contains(h,i.toLowerCase())?"FL":"LI";case"video":return
i&&n.contains(c,i.toLowerCase())?"FL":"LV";case"movie":case"recordedtv":return"LV";
case"music":return"MU";case"folder":return"FD";default:return r}}function
o(i,r,u,f,e,o,s,h,c,l){var v=l&&s&&c?i.filter(function(t){return
n.contains(Object.keys(g),t)}):[],a;v.length>0&&(i=i.filter(function(t){return!
n.contains(v,t)}));a=function(n){for(var i,f,t=0,u=v;t<u.length;t+
+)i=u[t],f=g[i],n[i]={deviceItem:
{id:i,displayName:l.getLocString(f.locStringKey),kind:null,getProperty:function()
{return null},propertyHits:
[],rankScore:1e3},icon:f.icon};r(n)};n.safeExecute(function(){var
r,n,c,l,v;if(i.length==0)a({});else{if(r={},n=i.slice(0),h)for(c=i.length-1;c>=0;--
c)l=i[c],h.hasOwnProperty(l)&&(r[l]=h[l],n.splice(c,1));n.length==0?a(r):(v=!s||
t.localDataSourceMayContainPII(s)?s:s+" "+n,t.Promise.safeChain(u,function(){return
f(n)},function(u){var o=t.Map.map(n,u,function(n){return
e(n)}),f;if(h&&n.forEach(function(n){return h[n]=o[n]}),n.length!=i.length)for(f in
r)r.hasOwnProperty(f)&&(o[f]=r[f]);a(o)},function(){return
a({})},o,v))}},"resolveIdsWithCache",null,s,function(){return a({})})}function
lt(n,t){if(!t.launchArguments||ct.test(n.query))return!0;var
i=t.id.toLowerCase();return nt.some(function(n){return i.includes(n)})?!0:!
1}function tt(n,i,r,u,f){if(!f)return!1;var
o=n.displayName.toLocaleLowerCase(),e=i.queryToFetch.toLocaleLowerCase(),s=null;if(
f.Parses&&f.Parses.length>0&&f.Parses[0].SubParses&&f.Parses[0].SubParses.length>1&
&f.Parses[0].SubParses[0].Interpretation&&f.Parses[0].SubParses[0].Interpretation==
="regex"&&e.length>=f.Parses[0].SubParses[0].QueryEnd&&f.Query!=null)
{if(e.length===f.Parses[0].SubParses[0].QueryEnd)return!
0;e=e.substr(f.Parses[0].SubParses[0].QueryEnd+1);f.Query=f.Query.substr(f.Parses[0
].SubParses[0].QueryEnd+1)}return
e.length<t.config.filterCICandidatesPrefixLength&&!
it(e,o)&&(s=t.matchesOnPropertyHH(o,e),!s)?!0:pt(o,e,n,r,u,f)?!0:!1}function
pt(n,i,r,u,f,e){var o,s;return!i||!e||!e.MatchScore||!e.Parses||
e.Parses.length==0||!e.Parses[0].Entities||e.Parses[0].Entities.length==0||!
e.Query?!1:n.startsWith(i)&&i.length>=t.config.filterCICandidatesPrefixLength?!1:
(o=e.Query,o.startsWith(i))?!1:(s=n.startsWith(o),!s)?!
0:f.Counter>=t.config.maxCISpellCorrectionCandidates?!0:(f.Counter++,!1)}function
it(n,t){var r,i;if(!!t&&t.length==0||(r=t.split(" "),n.length!=r.length))return!
1;for(i=0;i<r.length;i++)if(r[i].length==0||r[i][0]!=n[i])return!1;return!
0}function rt(n){var i=n.id.toLowerCase(),t;if(i.startsWith("http:")||
i.startsWith("https:")||n.kind=="link"&&i.endsWith(".url"))return
1;if(i.startsWith("file:")||n.kind=="document")return
0;if(t=n.filePath,t&&(t=t.toLowerCase(),t!=i)){if(t.startsWith("http:")||
t.startsWith("https:")||n.kind=="link"&&t.endsWith(".url"))return
1;if(t.startsWith("file:"))return 0}return 2}function ut(n,t)
{if(t.dataSource=="PP"){var
i=rt(n);if(i==1)return"LURL";if(i==0)return"LDOC"}return
t.getSuggestionType(n)}function ft(t){return t&&t.rawIndexResponse?
n.safeExecute(function(){return
JSON.parse(t.rawIndexResponse)},"parseConstraintIndexMetaData"):undefined}function
et(i,r,u,f,e,o){var
g,v,h,b,y,k,d,l,s,p,a,c;if(t.IndexerQueryGenerator&&t.IndexerQueryGenerator.suppres
s(r,i,f))return!0;if(t.isMobileCache)return!
1;if(u=="PP")return(g=r.id,n.contains(at,g))?!0:(v=r,tt(v,i,!0,e,o))?!0:
(h=r.kind,h&&(h=h.toLocaleLowerCase(),h!="program"&&h!="unknown"))?!
0:f=="LRA"&&rt(v)!=2?!0:(b=v.extension,b&&b.toLowerCase()==".chm")?!0:!1;if(u!
="LURL"&&r.kind=="link")return!0;if(t.isSetting(u))return tt(r,i,!1,e,o)?!0:!
1;if(u=="EBH")return(y=r,k=y.url,n.olderThan2Weeks(y.dateVisited)||
n.isBingSearchUrl(k))?!0:i.queryToFetch?i.isMultiWord?!1:n.getProtocol(i.fixedUrl||
i.queryToFetch)==0&&n.contains(y.propertyHits,"System.Title")?!1:
(d={},n.computeUrlMatchLengths(d,k,i.queryToFetch),!d.domainMatchLength):!
1;if(t.isItemWithFileMetadata(u)){if((l=r,!
t.IndexerQueryGenerator&&f=="MDOC"&&l.propertyHits.length==1&&l.propertyHits[0]=="S
ystem.Search.Contents"&&(!t.config.minLengthForContentMatch||
i.queryToFetch.length<t.config.minLengthForContentMatch))||
(s=l.id,s&&(s.includes("\\.")||s.includes("/.")||
(s=s.toLowerCase(),i.queryToFetch.toLocaleLowerCase()!
=r.displayName.toLocaleLowerCase()&&yt.some(function(n){return
s.includes("\\"+n+"\\")||s.includes("/"+n+"/")}))))||(p=l.extension,p&&!
i.queryToFetch.toLowerCase().includes(p.toLowerCase())&&n.contains(vt,p.toLowerCase
())))return!0;if(u=="CG"){if(a=r,c=a.displayName.split(" ")
[0].toLowerCase(),c.includes("\\")||c.indexOf(":")==1)return!1;var
w=a.id.toLowerCase(),it=w.lastIndexOf("."),ut=w.lastIndexOf("\\"),ft=a.kind=="folde
r"||it<0||it<ut;if(ft&&!c.includes("%")||![".exe",".com"].some(function(n){return
c.includes(n)})&&(st.some(function(n){return
w.includes(n)})||!a.launchArguments&&nt.some(function(n){return w.includes(n)})||
n.contains(ht,c)))return!0}return!1}return!1}var
h,c,ot,u;t.getIcon=s;h=[".dwg",".ai",".psd"];c=[".ts"];t.getSuggestionTypeFromKindA
ndExtension=r;var l={getResultsContainer:function(n){return
n.apps},dataSource:"PP",getSuggestionType:function()
{return"PP"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Apps].icon,n.isImmersive?
n.logoBackgroundColor:undefined)},supportsEmptyQuery:!
0},a={getResultsContainer:function(n){return
n.settings},dataSource:"ST",getSuggestionType:function()
{return"ST"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,r,u){if(t.isModernSetting(n)){var
f=n.glyph,o=f?{content:f,type:1}:t.ScopeConfig[t.Scope.Settings].icon;return
e(n,r,o)}return i(n,r,u,t.ScopeConfig[t.Scope.Settings].icon)},supportsEmptyQuery:!
1},v=[l,a,{getResultsContainer:function(n){return
n.media},dataSource:"LM",getSuggestionType:function(n){return
r(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8charsOrInL2Z
eroInput:20,supportsEmptyQuery:!0},{getResultsContainer:function(n){return
n.files},dataSource:"FL",getSuggestionType:function(n){return
r(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8charsOrInL2Z
eroInput:20,supportsEmptyQuery:!0},{getResultsContainer:function(n){return
n.powerBi},dataSource:"PBI",getSuggestionType:function()
{return"PBI"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,t){return e(n,t,
{content:"&#xEA1E",type:2})},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.browsingHistory},dataSource:"EBH",getSuggestionType:function()
{return"EBH"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,t){return
e(n,t,null)},supportsEmptyQuery:!0},{getResultsContainer:function(){throw
Error("Only supported via
IndexerQuery");},dataSource:"IBA",getSuggestionType:function()
{return"IBA"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Apps].icon)},supportsEmptyQuery:!1},
{getResultsContainer:function(){throw Error("Only supported via
IndexerQuery");},dataSource:"IFF",getSuggestionType:function(n){return
r(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:15,maxAfter8charsOrInL2Z
eroInput:25,supportsEmptyQuery:!0},],y=[{getResultsContainer:function(n){return
n.files},dataSource:"MDOC",getSuggestionType:function(n){return
r(n.kind,n.extension,"FL")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Documents].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.folders},dataSource:"MFOL",getSuggestionType:function(n){return
r(n.kind,n.extension,"FD")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Folders].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.pictures},dataSource:"MPHO",getSuggestionType:function(n){return
r(n.kind,n.extension,"LI")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Photos].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.video},dataSource:"MVID",getSuggestionType:function(n){return
r(n.kind,n.extension,"LV")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Videos].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.music},dataSource:"MMUS",getSuggestionType:function()
{return"MU"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Music].icon,null,!0)},supportsEmptyQuery:!
1},],p=[{getResultsContainer:function(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.startPathCompletionQuery(n.origina
lQuery,"")},dataSource:"PT",getSuggestionType:function()
{return"PT"},maxUpTo3chars:15,maxAfter3chars:15,maxAfter8charsOrInL2ZeroInput:15,cu
stomCancellation:function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastPathCompletionQuery()},s
upportsEmptyQuery:!1},{getResultsContainer:function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getRecentAppsAsync()}
,getResults:function(n){return n},dataSource:"LRA",getSuggestionType:function()
{return"PP"},maxUpTo3chars:undefined,maxAfter3chars:undefined,maxAfter8charsOrInL2Z
eroInput:undefined,customCreateLocalResponseSuggestion:function(n,r,u){return
i(n,r,u,t.ScopeConfig[t.Scope.Apps].icon,n.isImmersive?
n.logoBackgroundColor:undefined)},supportsEmptyQuery:!
0}],w=[{getResultsContainer:function(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.startCommandLineQuery(n.originalQu
ery,"")},dataSource:"CG",getSuggestionType:function()
{return"CG"},customCancellation:function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastCommandLineQuery()},supp
ortsEmptyQuery:!
1},];t.LocalDataProviderDataSources=v.concat(y).concat(p).concat(w).map(function(n)
{return n.dataSource});var f={suggestions:[],maxedOut:!
1},b={},k={},d={},g={"shell:RecycleBinFolder":{icon:
{content:"&#xEF87",type:2},locStringKey:"RecycleBin"}};var
st=["\\system32\\user.exe","\\system32\\sidebar.exe","\\system32\\at.exe","\\system
32\\change.exe","\\system32\\control.exe","\\system32\\find.exe","\\system32\\net.e
xe","\\system32\\share.exe","\\system32\\rundll32.exe","\\system32\\append.exe","\\
system32\\choice.exe","\\system32\\clip.exe","\\system32\\comp.exe","\\system32\\co
mpact.exe","\\system32\\consent.exe","\\system32\\convert.exe","\\system32\\format.
exe","\\system32\\graphics.com","\\system32\\label.exe","\\system32\\mem.exe","\\sy
stem32\\mode.com","\\system32\\more.com","\\system32\\recover.exe","\\system32\\rep
lace.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","\\syste
m32\\help.exe","\\system32\\where.exe","\\system32\\skydrive.exe","\\system32\\calc
.exe","\\system32\\fc.exe","\\accessories\\wordpad.exe",],nt=["\\system32\\finger.e
xe","\\system32\\ping.exe","\\system32\\print.exe","\\system32\\shutdown.exe","\\sy
stem32\\expand.exe","\\system32\\tskill.exe","\\system32\\reg.exe","\\system32\\sc.
exe",],ht=["uninstall","outlook","excel","skype","nero","onenote","lync","vmware","
firefox","itunes","photoshop","print","opera","visio","thunderbird","smartscreen"],
ct=/[\/\.\-\\]/;t.isRealCommand=lt;var at=["Microsoft.Cortana_8wekyb3d8bbwe!
CortanaUI","Microsoft.Windows.Cortana_cw5n1h2txyewy!
CortanaUI",],vt=[".dll",".pdb",".obj",".bin",".etl",".bak",".config",".resx",".mani
fest",".ini",".searchconnector-ms",".settingcontent-ms",".vstx",".vssx",".ms-one-
stub",],yt=["visio
content","bin","debug","obj","objd","amd64","x86","microsoftedgebackups",];t.isInit
ials=it;t.getSuggestionTypeOverride=ut;t.parseConstraintIndexMetaData=ft;t.isSuppre
ssed=et;ot=function(){function e(n,t)
{this._previousKeystrokeCache=n;t.bindAppHidden(function(){b={};k={};d={}})}return
e.prototype.getName=function()
{return"LocalDataProvider"},e.prototype.fetch=function(i,r,f,e,o){var
it=this,h,c,rt,a,ut,s,b,k,ft,d,st,ht,g,et,nt,ct,lt,tt,ot,l;if(e&&e.register(functio
n(){return t.Promise.clearPendingItemsFromCache()},!
1,"clearPendingItemsFromCache"),h=[],c=v.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,i)}),t.IndexerQueryGenerator&&(h=h.concat(c.filt
er(function(n){return
t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),c=c.filter(function(n)
{return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),c.length>0)
{if(!i.queryToFetch&&!c.every(function(n){return n.supportsEmptyQuery}))throw new
Error(u);if(e&&e.register(function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.cancelLastDeviceQuery()},!
1,"cancelLastDeviceQuery"),rt=n.safeExecute(function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.startDeviceQuery(i.queryToFetch)},
"startDeviceQuery",null,i.queryToFetch),rt)for(a=0,ut=c;a<ut.length;a+
+)l=ut[a],this.searchFolderWithMultipleResults(i,l,rt,r,o,e);else
this.emptyFetch(c,r)}if(s=y.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,i)}),t.IndexerQueryGenerator&&(h=h.concat(s.filt
er(function(n){return
t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),s=s.filter(function(n)
{return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),s.length>0)
{if(!i.queryToFetch&&!s.every(function(n){return n.supportsEmptyQuery}))throw new
Error(u);b=i.taskFrame?
i.taskFrame.raw:"";t.Promise.safeChain("executeSearchAsync",function(){return
SearchAppWrapper.CortanaApp.searchResultsView.executeSearchAsync(i.queryToFetch,b)}
,function(n){var t,u,f;if(o())if(n)for(t=0,u=s;t<u.length;t+
+)f=u[t],it.searchFolderWithMultipleResults(i,f,n,r,o,e);else
it.emptyFetch(s,r)},function(){return it.emptyFetch(s,r)},null,b?
i.queryToFetch+"\n"+b:i.queryToFetch)}if(h.length>0){if(!i.queryToFetch&&!
h.every(function(n){return n.supportsEmptyQuery}))throw new
Error(u);for(k=0,ft=h;k<ft.length;k+
+)l=ft[k],this.searchFolderWithMultipleResults(i,l,null,r,o,e)}if(d=p.filter(functi
on(t){return n.isDataSourceEnabled(t.dataSource,i)}),d.length>0){if(!
i.queryToFetch&&!d.every(function(n){return n.supportsEmptyQuery}))throw new
Error(u);for(st=function(n){e&&n.customCancellation&&e.register(function(){return
n.customCancellation()},!0,n.dataSource+"
cancellation");ht.searchFolderWithMultipleResults(i,n,i,r,o,e)},ht=this,g=0,et=d;g<
et.length;g++)l=et[g],st(l)}if(nt=w.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,i)}),nt.length>0){if(!i.queryToFetch&&!
nt.every(function(n){return n.supportsEmptyQuery}))throw new
Error(u);for(ct=function(n){e&&n.customCancellation&&e.register(function(){return
n.customCancellation()},!0,n.dataSource+"
cancellation");lt.searchFolderWithSingleResult(i,n,i,r,o)},lt=this,tt=0,ot=nt;tt<ot
.length;tt++)l=ot[tt],ct(l)}i.taskFrame&&n.safeExecute(function(){return
SearchAppWrapper.CortanaApp.searchResultsView.setTaskFrame(i.originalQuery,"")},"re
set task frame")},e.prototype.emptyFetch=function(n,t){for(var
u,i=0,r=n;i<r.length;i+
+)u=r[i],this.logProviderFailure(u.dataSource),t(u.dataSource,f,e.getDataSourceStat
e(0))},e.prototype.getMax=function(n,i){return n.scope!=t.Scope.All?n.queryToFetch?
i.maxAfter8charsOrInL2ZeroInput*2:i.maxAfter8charsOrInL2ZeroInput:n.queryToFetch.le
ngth>8?i.maxAfter8charsOrInL2ZeroInput:n.queryToFetch.length>3?
i.maxAfter3chars:i.maxUpTo3chars},e.prototype.toLocalResponse=function(n,r,u,f,e)
{var l,a,c,v,h;e&&(a=f,a.getGroupDisplayName&&(l=a.getGroupDisplayName(e)));var
w={Counter:0},p=[],b=u.length<n;for(c=0,v=u;c<v.length;c++){var
o=v[c],s=ut(o,f),y=t.isApp(s)||t.isSetting(s)?
ft(o):undefined;et(r,o,s,f.dataSource,w,y)||(h=void
0,h=f.customCreateLocalResponseSuggestion?
f.customCreateLocalResponseSuggestion(o,s,f.dataSource):i(o,s,f.dataSource),l&&(h.g
roupDisplayName=l),y&&(h.ciMetaData=y),p.push(h))}return{suggestions:p,maxedOut:b}}
,e.prototype.getResults=function(n,t,i,r){if(r.getResults)return
r.getResults(i);var
u=i,f=u.getItemsAsyncWithSpeller,e=this.enableSpellCorrection(n);return f?
u.getItemsAsyncWithSpeller(0,t,e):i.getItemsAsync(0,t)},e.prototype.enableSpellCorr
ection=function(n){return
n.queryToFetch.length>=t.config.enableCISpellerAtPrefixLength&&this._previousKeystr
okeCache&&this._previousKeystrokeCache.enableCISpeller(n.queryToFetch)?!0:!
1},e.prototype.searchFolderWithMultipleResults=function(i,r,u,o,s,h){var
v=this,c=r.dataSource,y=this.getMax(i,r),l=!u,p,a;if(l)p=function(){return
t.IndexerQueryGenerator.generateIndexerQueryAsync(i,y,c).then(function(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.queryWindowsSearchInd
exerAsync(n)})};else{if(a=n.safeExecute(function(){return
r.getResultsContainer(u)},"getResultsContainer "+c),!a)
{o(c,f,null);return}p=function(){return
v.getResults(i,y,a,r)}}t.Promise.safeChain(l?"queryWindowsSearchIndexerAsync":"getI
temsAsync",p,function(n){var u,f,h;s()&&(u=n.resultSet,f=void 0,u?
f=n.state:u=n,l&&(c=="EBH"?u=u.map(function(n){return
t.IndexerQueryGenerator.toBrowsingHistoryItem(n)}):t.supportsShortcuts(c,i)&&(u=u.m
ap(function(n){return
t.IndexerQueryGenerator.fixKind(n)}))),h=e.getDataSourceState(f),o(c,v.toLocalRespo
nse(y,i,u,r,a),h))},function(t){n.isCancellation(t)||
v.logProviderFailure(c);o(c,f,null)},l?h:null,c+"
"+i.queryToFetch)},e.prototype.searchFolderWithSingleResult=function(i,r,u,e,o){var
h=this,s=r.dataSource,c=n.safeExecute(function(){return
r.getResultsContainer(u)},"getResultsContainer "+s);c?
t.Promise.safeChain("tryGetResultAsync "+s,function(){return
c.tryGetResultAsync()},function(n){o()&&e(s,h.toLocalResponse(1,i,n?[n]:
[],r,null),null)},function(t){n.isCancellation(t)||
h.logProviderFailure(s);e(s,f,null)},null,i.queryToFetch):e(s,f,null)},e.prototype.
logProviderFailure=function(i){var
r=t.providerFailureLogName(i);r&&SearchAppWrapper.CortanaApp.queryFormulationView.l
ogProviderFailure&&n.safeExecute(function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure(r,"ErrorForTopH
it")},"logProviderFailure")},e.getDataSourceState=function(n){switch(n){case
0:return"UN";case 1:return"NI";case 2:return"PI"}return
undefined},e.getApps=function(n,i,r,u,f){o(n,i,"findAppsAsync",function(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findAppsAsync(n)},fun
ction(n){return
l.customCreateLocalResponseSuggestion(n,null,u)},r,u,t.config.cacheAppItems?
b:null,!0,f)},e.getSettings=function(n,i,r,u,f)
{o(n,i,"findSettingsAsync",function(n){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findSettingsAsync(n)}
,function(n){return
a.customCreateLocalResponseSuggestion(n,null,u)},r,u,t.config.cacheSettingItems&&!
f?k:null)},e.getFiles=function(n,u,f,e,s){o(n,u,"findFilesAsync",function(n)
{if(t.IndexerQueryGenerator){var
i=t.IndexerQueryGenerator.generateIndexerQueryForMRUFilesAndFolders(f,"MFF",n);retu
rn
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.queryWindowsSearchInd
exerAsync(i).then(function(n){for(var i,r={},t=0,u=n.resultSet;t<u.length;t+
+)i=u[t],r[i.id]=i;return r})}return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.findFilesAsync(n)},fu
nction(n){return
i(n,r(n.kind,n.extension,"FL"),s)},e,s,d)},e.launchIndexingOptions=function(n,i)
{var r=this;e.getSettings([t.IndexingOptionsSettingId],function(u){var
f=u[t.IndexingOptionsSettingId];f?n.launchDeviceItem(f.deviceItem,"ST"):i||
r.launchIndexingOptions(n,!0)},null,null,!0)},e}();t.LocalDataProvider=ot;u="Local
provider doesn't support empty query"})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function w(n){return typeof
n.type=="number"}var
f="showScopesL2",u="block",e="none",r,h="UpsellDismissed",o="OptInCardDisplayed",c=
"DismissCardDisplayed",s="OptErrorCardsDismissed",l="filtersButton",a="moreButton",
v="feedbackButton",y="optionsButton",i,p;(function(t){function f(n,t,i)
{u.push({Name:n,Status:t,Callback:i})}function e(n,t){for(var
f=[],i=2;i<arguments.length;i++)f[i-
2]=arguments[i];r.setItem(n,t);u.forEach(function(i)
{i.Name==n&&i.Status==t&&i.Callback.apply(i,f)})}function o(n){var
t=r.getItem(n);return t?i[t]:i.Unknown}var i,r,u;(function(n)
{n.OptedIn="OptedIn";n.OptedOut="OptedOut";n.Unknown="Unknown";n.Unavailable="Unava
ilable"})(i=t.FeatureStatus||(t.FeatureStatus={}));r=new
n.LightweightStorage;u=[];t.onOptInStatus=f;t.setOptInStatus=e;t.getOptInStatus=o})
(i=t.OptionalFeatures||(t.OptionalFeatures={}));p=function(){function p(n,f,p,w,b)
{var
k=this,d;if(this._host=n,this._page=f,this._instHelper=p,this._sequenceNumberReader
=w,this._storage=b,this._filtersButton={id:l,selected:!
1},this._moreButton={id:a,selected:!1},this._feedbackButton={id:v,selected:!
1},this._optionsButton={id:y,selected:!1},this._topHitPresent=!
1,this._resultsPresent=!1,this._currentScopeTileIndex=-
1,this._onL2TransitionEndHandlers=[],this._upsellGotDismissed=b.getItem(h)=="1",r=S
earchAppWrapper.CortanaApp,this._optInPromptError=!1,this._firstKSForCardShown=!
1,t.config.immersiveSearchOptInSupported)
{this._optInCardDisplayed=b.getItem(o)=="1";this._optOutCardDisplayed=b.getItem(c)=
="1";this._dismissCardDisplayed=b.getItem(s)=="1";i.onOptInStatus("ImmersiveSearch"
,i.FeatureStatus.OptedIn,function(n){return
k.onImmersiveSearchOptIn(n)});i.onOptInStatus("ImmersiveSearch",i.FeatureStatus.Opt
edOut,function(n){return k.onImmersiveSearchOptOut(n)})}else
this._optInCardDisplayed=!0,this._optOutCardDisplayed=!
0,this._dismissCardDisplayed=!0;
(this._rootElement=_ge("root"),this._topHitHeaderElement=_ge("topHitHeader"),this._
searchScopesL2Element=_ge("searchScopesL2"),this._suggestionsList=_ge("suggestionsL
ist"),t.config.scopesOrderBegin.length!=0)&&(n.bindAppHidden(function()
{k._scopeTiles=null;k._effectiveScopeOrder=null}),t.config.searchBoxFocusEvents?
(n.bindSearchBoxLostFocus(function(){k.isScopesL2Visible()&&k.select(null,!
1)}),n.bindSearchBoxGotFocus(function()
{k.isScopesL2Visible()&&k.select(k._selectedL2Item?
k._selectedL2Item:k.getTopItemForSelection(),!1)})):
(d=r.searchBox,d.addEventListener("keydown",function(n)
{k.isScopesL2Visible()&&n.keyCode==9&&k.getSelectedItem()&&k.select(null,!
1)}),sj_be(_w,"keydown",function(n)
{k.isScopesL2Visible()&&n.keyCode==9&&k.getSelectedItem()&&k.select(null,!
1)}),sj_be(_w,"focus",function(){k.isScopesL2Visible()&&!
k.getSelectedItem()&&k.select(k._selectedL2Item?
k._selectedL2Item:k.getTopItemForSelection(),!
1)})),n.bindQueryChangedOrInitialized(function(n){k.isScopesL2Visible()&&(!
k._currentQuery||k._currentQuery.originalQuery!=n.originalQuery)&&k.hideL2(!
0);k._currentScopeTileIndex=-1}),n.bindDismissed(function()
{k._advancedOptionsBottom=null;k._advancedOptionsTop=null;k.hideL2(!
1);k._currentScopeTileIndex=-
1}),this._rootElement.addEventListener("transitionend",function(n)
{(k.isScopesL2Visible()&&k._searchScopesL2Element.style.display==e&&(k._searchScope
sL2Element.style.display=u),n.target==k._searchScopesL2Element)&&k.finalizeL2Transi
tion()}),n.bindButtonRightOfSearchBoxClick(function(i){i==""||i==""||
t.qfMode==2?(n.reformulate(""),k.setFocusInSearchBox("clear search
box"),p.logClientInstEvent("Select","ClearSearchBox",null)):i==""&&(k.isScopesL2V
isible()?
k.closeScopesL2("ButtonRightOfSearchBox"):k.navigateScopesL2("ButtonRightOfSearchBo
x"))}),this._substrateUpsellDismiss={action:function(){k._upsellGotDismissed=!
0;b.setItem(h,"1");k.isScopesL2Visible()?
k.navigateScopesL2("DismissUpsell"):n.refreshCurrentPane()},icon:
{content:"&#xE711",type:2}},this._optInDismiss={action:function()
{k._dismissCardDisplayed=!0;b.setItem(s,"1");k.reloadOptInAdvancedOptions()},icon:
{content:"&#xE711",type:2}})}return p.prototype.bindOnL2TransitionEnd=function(n)
{this._onL2TransitionEndHandlers.push(n)},p.prototype.getTopItemForSelection=functi
on(){return this._advancedOptionsTop&&this._advancedOptionsTop.length?
this._advancedOptionsTop[0]:this._scopeTilesL2[0]},p.prototype.finalizeL2Transition
=function(){var
n=this.isScopesL2Visible(),t;this._searchScopesL2Element.style.display=n?
u:e;t=this._searchScopesL2Element.getElementsByClassName("searchByCat")
[0];t&&(t.getElementsByTagName("a")[0].tabIndex=n?1:-
1);this._topHitHeaderElement.style.display=n?
e:u;this._suggestionsList.style.display=n?e:u;n||
(this._advancedOptionsTop=[],this._advancedOptionsBottom=[],this.select(null,!
1));this._onL2TransitionEndHandlers.
forEach(function(n){return n()})},p.prototype.focusNextScopeTile=function(n,t){var
r=this.isScopesL2Visible()?
this._searchScopesL2Element:this._topHitHeaderElement,i=[].slice.call(r.getElements
ByClassName("scopeTile"));this._currentScopeTileIndex=i.indexOf(n);t?
this._currentScopeTileIndex!=i.length-1&&+
+this._currentScopeTileIndex:this._currentScopeTileIndex>0&&--
this._currentScopeTileIndex;i.forEach(function(n){return n.tabIndex=-
1});i[this._currentScopeTileIndex].tabIndex=1;i[this._currentScopeTileIndex].focus(
)},p.prototype.handleOptInOutNavigation=function(n,t){if(!this.isScopesL2Visible())
{var i;n.id==="optInYesBtn"&&t?i=_ge("optInNoBtn"):n.id!=="optInNoBtn"||t||
(i=_ge("optInYesBtn"));i&&i.focus()}},p.prototype.render=function(n,i,r,u,f)
{if(this._currentQuery=n,n&&(n.fullPartialQuery||t.zeroInputAvailable)){var
e=t.getEffectiveScope(n);this.innerRender(n.scope,e,n,i,r,u,f)}else
this.cleanUp()},p.prototype.getScopeToolTip=function(n,i){var
u=t.ScopeConfig[n],f=t.getScopeDisplayName(u,this._host),r;if(i)
{if(n==t.Scope.All)return null;r="RemovingScopeNarratorText2"}else
r=n==t.Scope.All?"AddingScopeNarratorTextAll2":"AddingScopeNarratorText";return
this._host.getLocString(r,f.toLocaleLowerCase())},p.prototype.getScopeDescription=f
unction(n){var t=this.getSources(n);return t?
t.join(this._host.getLocString("Comma")+"
"):null},p.prototype.getSources=function(i){var r,u,f;switch(i){case
t.Scope.All:return
r=[this._host.getLocString("MostRelevantOnThisPC")],n.isBingEnabled()&&r.push(t.get
ScopeDisplayName(t.ScopeConfig[t.Scope.Web],this._host)),u=t.getAccountTypeForCloud
Content(),u!=3&&u!
=0&&t.isCloudSearchEnabledCache&&t.substrateProvidersEnabled()&&r.push(this._host.g
etLocString("CloudServices")),r;case t.Scope.Apps:return n.isBingEnabled()?
[this._host.getLocString("Installed"),this._host.getLocString("StoreGroup")]:
[this._host.getLocString("Installed")];case t.Scope.Emails:case
t.Scope.People:return[this._host.getLocString(t.getAccountTypeForCloudContent()==2?
"Personal":"WorkOrSchool")];case
t.Scope.Settings:return[this._host.getLocString("SystemSettingsAnnotation"),this._h
ost.getLocString("ControlPanelAnnotation")];case t.Scope.Web:return
n.isBingEnabled()?
(r=[t.getWebSuggestionsGroupHeader(this._host),t.getWebsitesGroupHeader(this._host)
,this._host.getLocString("Answers")],t.getAccountTypeForCloudContent()==1&&t.isClou
dSearchEnabledCache&&t.bingAtWorkProviderEnabled()&&r.push(this._host.getLocString(
"Bookmarks"))):r=[],t.edgeBrowsingHistoryAvailable()&&r.push(this._host.getLocStrin
g("EdgeHistoryGroup")),r;default:return t.isFileOrFolderScope(i)?
(r=[t.getGroupSourceDisplayName(1,this._host)],t.isCloudSearchEnabledCache&&(n.isBi
ngEnabled()&&(t.substrateProvidersEnabled()?
t.getAccountTypeForCloudContent()==2&&r.push(t.getGroupSourceDisplayName(2,this._ho
st)):(f=t.isCortanaPersonalized?t.cortanaAccountType:t.windowsAccountType,f!
=1&&r.push(t.getGroupSourceDisplayName(2,this._host)))),i==t.Scope.Documents&&t.get
AccountTypeForCloudContent()==1&&t.substrateProvidersEnabled()&&r.push(t.getGroupSo
urceDisplayName(3,this._host),t.getGroupSourceDisplayName(4,this._host))),r):null}}
,p.prototype.selectScope=function(n){var
r,i,u,t;for(this._selectedScope&&(this._selectedScope.tabindex=-
1,this._selectedScope.narratorText=this.getScopeToolTip(this._selectedScope.type,!
1)),r=!1,i=0,u=this._scopeTiles;i<u.length;i+
+)t=u[i],t.selected=t.type==n,t.selected&&(r=!
0,t.tabindex=1,this._selectedScope=t,t.narratorText=this.getScopeToolTip(n,!0));r||
(this._selectedScope=null)},p.prototype.innerRender=function(n,i,r,u,f,e,o){var
w=this,s,v,b,p;if(this._topHitPresent=u,this._resultsPresent=f,t.scopesAvailable&&(
!this._scopeTiles||
t.scopeListRequiresUpdate)&&this.init(),this._scopeTiles&&this.selectScope(n),t.qfM
ode==3)if(f)s=this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(
),3)[0],v=s&&s.click,this._page.renderTabShellFooter(2,v);else if(b=r&&!
r.queryToFetch&&!e,b){var s=!
this._upsellGotDismissed&&this.getAdvancedOptions(this._sequenceNumberReader.getSeq
uenceNumber(),3)
[0],v=s&&s.click,d=s&&this._substrateUpsellDismiss.action;this._page.renderTabShell
Footer(1,v,d)}else this._page.renderTabShellFooter(0);else{var
c=t.ScopeConfig[i],k=r.showProgressBar?o:!e,l=!r||!r.queryToFetch,a=!f&&(k||l)?
this.getEmptyQueryMessage(l,i,c):"",y=k||l||f||!this._lastRenderedTopHitHeader||
t.uses3lineTemplate(i)?
this.getHeaderText(i,c):this._lastRenderedTopHitHeader.headerText,g=i!
=t.Scope.All||!l||
t.zeroInputAvailable,h=c.showUpsellOnSuggestionsList&&c.showUpsellOnSuggestionsList
()?this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),0):
[];if(this.getAdvancedOptionsForImmersive(h),t.alwaysWide&&(h=h.concat(this.getAdva
ncedOptions(this._sequenceNumberReader.getSequenceNumber(),4))),this._lastRenderedT
opHitHeader&&this._lastRenderedTopHitHeader.scope==n&&this._lastRenderedTopHitHeade
r.message==a&&this._lastRenderedTopHitHeader.headerText==y&&this._lastRenderedTopHi
tHeader.advancedOptions==h)return;this._lastRenderedTopHitHeader={scope:n,headerTex
t:y,message:a,advancedOptions:h};p=this.getScopeBarElements();this._page.updateTopH
itHeaderView(g,y,a,a?c.icon:null,p,this.getHiddenScopeElements(p),function(){return
w.navigateScopesL2("ScopesMore")},function(){return
w.showFeedback()},h)}},p.prototype.cleanUp=function(){t.qfMode==3?
this._page.renderTabShellFooter(0):
(this._lastRenderedTopHitHeader=null,this._page.updateTopHitHeaderView(!
1,null,null,null,null,null,null,null,null))},p.prototype.setImmersiveSearchOptStatu
s=function(n,t){var
i=this,u={Source:n,ExpId:r.experienceId,OptIn:t.toString()};n==="OC"&&(u.CardDismis
sed="0");t?r.enableCenterScreenAndRelaunch?(r.enableCenterScreenAndRelaunch(!
1),r.addEventListener("experiencelaunched",function(){i._storage.getItem(o)!
="1"&&r.experienceId!="CenterScreen"&&(i._optInPromptError=!
0)}),this.ForceRerender()):this._optInPromptError=!0:
(r.disableCenterScreenAndRelaunch(),this.ForceRerender());this._instHelper.logClien
tInstEvent("ClientInst","OptInImmersiveSearch",this._sequenceNumberReader.getSequen
ceNumber(),u)},p.prototype.ForceRerender=function(){var
n=this,t;this._dismissCardDisplayed&&this._storage.setItem(s,"1");t=this._currentQu
ery.queryToFetch;sb_st(function(){n._host.reloadWebView(!
1);n._host.updateQueryWithoutRefetching(t)},100)},p.prototype.getAdvancedOptionsFor
Immersive=function(n){var
o=this,u,f,e;t.config.immersiveSearchOptInSupported&&t.qfMode!
=2&&(this._optInCardDisplayed||this._optOutCardDisplayed||
(this._firstKSForCardShown||(this._firstKSForCardShown=!
0,u={CardShown:"1",ExpId:r.experienceId},this._instHelper.logClientInstEvent("Clien
tInst","OptInImmersiveSearch",this._sequenceNumberReader.getSequenceNumber(),u)),f=
function()
{i.setOptInStatus("ImmersiveSearch",i.FeatureStatus.OptedIn,"OptInOutCard")},e=func
tion()
{o.markOptOutCardDisplayed("OptInOutCard")},n.push({id:"advancedOption05",selected:
!
1,title:null,heading:this._host.getLocString("OptInText"),text:null,instItem:null,c
lick:null,layout:3,dismiss:null,icon:{type:6,needsAccentColor:!0},description:
[this._host.getLocString("LearnMoreLine1"),this._host.getLocString("LearnMoreLine2"
)].join(" "),yesBtn:
{text:this._host.getLocString("YesBtnText"),instItem:null,click:f},noBtn:
{text:this._host.getLocString("NoBtnText"),instItem:null,click:e}})),!
this._dismissCardDisplayed&&this._optInCardDisplayed&&this._optInPromptError&&(this
._dismissCardDisplayed=!0,n.push({id:"advancedOption06",selected:!
1,title:null,heading:this._host.getLocString("OptErrorText",this._host.getLocString
("OptInButtonText")),text:null,instItem:null,click:null,layout:2,dismiss:this._optI
nDismiss,icon:{type:6,needsAccentColor:!0}})),!
this._dismissCardDisplayed&&this._optOutCardDisplayed&&(this._dismissCardDisplayed=
!0,n.push({id:"advancedOption07",selected:!
1,title:null,heading:this._host.getLocString("OptOutText",this._host.getLocString("
OptInButtonText")),text:null,instItem:null,click:null,layout:2,dismiss:this._optInD
ismiss,icon:{type:6,needsAccentColor:!
0}})))},p.prototype.reloadOptInAdvancedOptions=function(){var
n=[];this.getAdvancedOptionsForImmersive(n);this._page.updateOptInAdvancedOptions(n
)},p.prototype.onImmersiveSearchOptOut=function(n)
{this.setImmersiveSearchOptStatus(n,!
1)},p.prototype.onImmersiveSearchOptIn=function(n){this._optInCardDisplayed=!
0;this.setImmersiveSearchOptStatus(n,!
0);this._storage.setItem(o,"1");this.reloadOptInAdvancedOptions()},p.prototype.mark
OptOutCardDisplayed=function(n){this._optOutCardDisplayed=!
0;this._storage.setItem(c,"1");var
t={Source:n,CardDismissed:"1",ExpId:r.experienceId};this._instHelper.logClientInstE
vent("ClientInst","OptInImmersiveSearch",this._sequenceNumberReader.getSequenceNumb
er(),t);this.reloadOptInAdvancedOptions()},p.prototype.scopeNamesElements=function(
n){var i=this;return n.map(function(n){return i._scopeTiles.find(function(i){return
t.Scope[i.type]==n})}).filter(function(n){return!!
n})},p.prototype.getEffectiveScopeOrder=function(){var i,r,u,n,f;return
this._scopeTiles.length==0?[]:this._effectiveScopeOrder?
this._effectiveScopeOrder.slice(0):(t.alwaysWide?
(i=t.config.scopesOrderBeginAlwaysWide,r=t.config.scopesOrderLastAlwaysWide,u=t.con
fig.numberOfScopesToRenderAlwaysWide):
(i=t.config.scopesOrderBegin,r=t.config.scopesOrderLast,u=t.config.numberOfScopesTo
Render),n=[],i&&(f=r?this.scopeNamesElements(r):
[],n=this.scopeNamesElements(i),n=n.slice(0,u-
f.length),n.push.apply(n,f)),this._effectiveScopeOrder=n,n.slice(0))},p.prototype.g
etHiddenScopeElements=function(n){return this._scopeTilesL2?
this._scopeTilesL2.filter(function(t){return n.find(function(n){return
n.type==t.type})==undefined}):[]},p.prototype.getScopeBarElements=function(){var
r=this,n,t,i;return this._scopeTiles?
(n=this.getEffectiveScopeOrder(),t=n.some(function(n){return n.selected}),t||
(this._selectedScope?(i=this._scopeTiles.find(function(n){return
n.type==r._selectedScope.type}),n.push(i),t=!0):n[0].tabindex=1),t&&!
n[0].selected&&(n[0].tabindex=-1),n):[]},p.prototype.navigateScopesL2=function(n)
{var

i,r;t.scopeListRequiresUpdate&&this.init();this._page.ensureWebViewExpanded();i=thi
s._sequenceNumberReader.getSequenceNumber();this._advancedOptionsBottom=this.getAdv
ancedOptions(i,1);this._advancedOptionsTop=this.getAdvancedOptions(i,2);this.select
(this._selectedScope?this._selectedScope:this.getTopItemForSelection(),!
1);this.showL2();this._host.setFocusInSearchBox(n);r={Source:n};this._instHelper.lo
gClientInstEvent("Select","ScopesL2Opened",null,r)},p.prototype.showFeedback=functi
on(){if(this._page.ensureWebViewExpanded(),typeof WindowsFeedbackForm!="undefined")
{var
n=t.qfMode==2?"feedbackContainer":"";WindowsFeedbackForm.Show(n)}},p.prototype.clos
eScopesL2=function(n){this.hideL2(!0);this._host.setFocusInSearchBox(n);var
t={Source:n};this._instHelper.logClientInstEvent("Unselect","ScopesL2Closed",null,t
)},p.prototype.showL2=function(){var
n=this;this._topHitHeaderElement.style.display=u;this._searchScopesL2Element.style.
display=u;sb_st(function(){return
n._rootElement.classList.add(f)},0);this._host.updateQueryWithoutRefetching(null)},
p.prototype.hideL2=function(n){var
t=this;this._topHitHeaderElement.style.display=u;this._searchScopesL2Element.style.
display=u;this._suggestionsList.style.display=u;n?sb_st(function(){return
t._rootElement.classList.remove(f)},0):
(this._rootElement.classList.remove(f),this.finalizeL2Transition())},p.prototype.ge
tHeaderText=function(n,i)
{if(t.shouldRenderFlatListWithoutGroups(this._currentQuery))return null;if(n!
=t.Scope.All||t.zeroInputAvailable){var
r=t.getScopeDisplayName(i,this._host);if(r)return this._topHitPresent?
n==t.Scope.All?
this._host.getLocString("BestMatch"):this._host.getLocString("BestMatchFor",r.toLoc
aleLowerCase()):this._resultsPresent?null:r}return
this._host.getLocString("BestMatch")},p.prototype.getEmptyQueryMessage=function(n,i
,r){if(r.showUpsellOnSuggestionsList&&r.showUpsellOnSuggestionsList()&&i!
=t.Scope.Documents)return"";if(n){if(i==t.Scope.Web)return
this._host.getLocString("EmptyScopeMessageWeb");if(i!=t.Scope.All||
t.zeroInputAvailable){var u=t.getScopeDisplayName(r,this._host);if(u)return
this._host.getLocString("EmptyScopeMessage",u.toLocaleLowerCase())}return""}return
this._host.getLocString("NoResults",this._currentQuery.queryToFetch)},p.prototype.i
nit=function(){var u,f,i,r;t.scopeListRequiresUpdate=!
1;this._scopeTiles=[];this._scopeTilesL2=[];u=t.alwaysWide?
t.config.scopesOrderBeginAlwaysWide:t.config.scopesOrderBegin;this._allScopeButtonP
resent=n.contains(u,"All");for(f in t.ScopeConfig)
(i=parseInt(f),r=t.ScopeConfig[i],r.prefixesLocString&&t.isScopeEnabled(i,r))&&((i!
=t.Scope.All||
this._allScopeButtonPresent)&&this._scopeTiles.push(this.createScopeElement(i,r,!
1)),this._scopeTilesL2.push(this.createScopeElement(i,r,!
0)));this._scopeTilesL2.sort(function(n,i){return n.type==t.Scope.All?-
1:i.type==t.Scope.All?
1:n.text.localeCompare(i.text)})},p.prototype.createScopeElement=function(n,i,r)
{var u=this;return{id:(r?"scope":"l1scope")
+n,type:n,text:t.getScopeDisplayName(i,this._host),description:r?
this.getScopeDescription(n,i):null,icon:n==t.Scope.All?
{content:"&#xE8A9",type:1}:i.icon,click:function(){return
u.clickHandler(n,u.isScopesL2Visible()?"scopesL2":"scopeBar")},selected:!
1,tabindex:-1,narratorText:this.getScopeToolTip(n,!
1)}},p.prototype.clickHandler=function(n,i,r){var
h=t.getScopeDisplayName(t.ScopeConfig[n],this._host),e,u=this._currentQuery,f=u.sco
pe,o,s,c;if(this._scopeTiles.some(function(n){return n.type==f})||
(f=t.Scope.All),h&&f!=n)e=(n==t.Scope.All?"":h.toLocaleLowerCase()+": ")
+u.queryToFetch,this.innerRender(n,n,u,this._topHitPresent,this._resultsPresent,!
0,!1),o={query:this._currentQuery,topResults:[],groups:
[]},this._page.updateTopResultsView(o),this._page.updateGroupsView(o),this.hideL2(!
0);else{if(this.isScopesL2Visible()){this.select(this._selectedScope,!
1);this.closeScopesL2(i);return}if(f==t.Scope.All||this._allScopeButtonPresent)
{this._page.ensureWebViewExpanded();this.setFocusInSearchBox("scope clickHandler
noop");return}e=u.queryToFetch;n=t.Scope.All;this.innerRender(n,n,u,this._topHitPre
sent,this._resultsPresent,!0,!
1)}s=t.Scope[n];c={Scope:s,Source:i,GroupSource:r&&r.source?
r.source.toString():undefined};this._instHelper.logClientInstEvent("Select","ScopeC
hanged",null,c);f!
=n&&this._host.reformulate(e,undefined,undefined,r);this.setFocusInSearchBox("scope
clickHandler "+s)},p.prototype.setFocusInSearchBox=function(t)
{this._host.setFocusInSearchBox(t);var
i=n.getCurrentActiveElement();i&&i.blur()},p.prototype.isScopeElement=function(i)
{return t.config.allowUpForScopes&&this._scopeTiles&&(this.isScopeButton(i.id)||
n.contains(this._scopeTiles,i))},p.prototype.isScopeButton=function(n){return
n==this._filtersButton.id||n==this._moreButton.id||n==this._feedbackButton.id||
n==this._optionsButton.id},p.prototype.isScopesL2Visible=function(){return
this._rootElement.classList.contains(f)},p.prototype.getSelectableItems=function()
{var n=[];return
this._advancedOptionsTop&&(n=n.concat(this._advancedOptionsTop)),n=n.concat(this.ge
tScopeSelectableItems()),this._advancedOptionsBottom&&(n=n.concat(this._advancedOpt
ionsBottom)),n},p.prototype.getScopeSelectableItems=function(){var
t,i,r;if(this.isScopesL2Visible())return
this._scopeTilesL2;if(t=this._currentScopeTileIndex,t<0&&this._selectedScope)return
[this._selectedScope];if(i=n.getCurrentActiveElement(),i)switch(i.id){case
l:return[this._filtersButton];case a:return[this._moreButton];case
v:return[this._feedbackButton];case y:return[this._optionsButton]}return
r=this.getScopeBarElements(),(t<0||
t>=r.length)&&(t=0),r.slice(t,t+1)},p.prototype.getSelectedItem=function(){return
this._selectedL2Item&&this._selectedL2Item.selected?
this._selectedL2Item:null},p.prototype.select=function(n,t){var
l=this,f,s,r,e,c,i,o,h,u;if(t){SharedLogHelper.LogError("selectScope",null,new
Error("Can't update search box value when selecting
scope"));return}if(this._selectedL2Item&&(this._selectedL2Item.selected=!
1,this._selectedL2Item=null),n){if(w(n))
{if(this._scopeTilesL2)for(f=0,s=this._scopeTilesL2;f<s.length;f+
+)r=s[f],e=r.type==n.type,r.selected=e,r.tabindex=e?1:-
1,e&&(this._selectedL2Item=r)}else
for(c=n,i=[],this._advancedOptionsTop&&(i=i.concat(this._advancedOptionsTop)),this.
_advancedOptionsBottom&&(i=i.concat(this._advancedOptionsBottom)),o=0,h=i;o<h.lengt
h;o++)u=h[o],u==c?(u.selected=!0,this._selectedL2Item=u):u.selected=!
1;this._page.updateSearchScopesL2View(this._scopeTilesL2,function(){return
l.closeScopesL2("ScopesL2")},this._advancedOptionsTop,this._advancedOptionsBottom);
this._selectedL2Item&&this._selectedL2Item.selected&&this.scrollTo(this._selectedL2
Item)}},p.prototype.onAfterKeyDown=function(){},p.prototype.scrollTo=function(n)
{var
i=_ge(n.id),t,r;i&&(t=this._searchScopesL2Element.firstChild,r=this._advancedOption
sTop?n==this._advancedOptionsTop[0]:n==this._scopeTilesL2[0],r?
t.scrollTop=0:this._page.scrollToElement(i,t,t.offsetHeight))},p.prototype.getSubst
rateUpsellClickHandler=function(n){var i=this,r=function(){var
n=i.isScopesL2Visible();i._host.refreshCurrentPane();n&&i.navigateScopesL2("Substra
teUpsell");i._host.setFocusInSearchBox("SubstrateUpsell")};return function(){return
i._host.promptAutheticateDialog(n,t.getSubstrateResourceOrScope(n),r,r)}},p.prototy
pe.getSubstrateUpsell=function(n,i,r){var
o=null,u="VerifyAccountToSearch",s=0,h="CloudSearch",c=["Verify"],f=null,e;return
r==0?(h="",e=t.getEffectiveScope(this._currentQuery),e==t.Scope.People?
u+="Contacts":e==t.Scope.Emails?
u+="Emails":e==t.Scope.Documents&&(u+="Documents",s=1,o={content:"&#xE9BE",type:2,n
eedsAccentColor:!0},f=this._substrateUpsellDismiss)):r==2?
f=this._substrateUpsellDismiss:r==4&&(o={content:"&#xE9BE",type:2,needsAccentColor:
!
0},f=this._substrateUpsellDismiss,s=4,c=["VerifyAccountToSearch"]),this.getAdvanced
Option(n==1?"COFA":"COOA",i,h,u,c,this.getSubstrateUpsellClickHandler(n),s,"advance
dOption03",f,o)},p.prototype.getOneDriveUpsell=function(n){var i=this;return
this.getAdvancedOption("SDSC",n,"SignInToCortanaTitle","SeeResultsFromOneDrive",
["SignInToCortana"],function(){t.config.cortanaCapabilitiesAvailable?
i._host.launchCortanaSignIn():i._host.launchCortanaHome()},0,"advancedOption02")},p
.prototype.getIndexingOption=function(n,i){var r=this;return i==4?
this.getAdvancedOption("OMIO",n,"","ChangeWhereWindowsSearches",
["OptionsMenuIndexing"],function(){return
t.LocalDataProvider.launchIndexingOptions(r._host,!1)},4,"",null,
{type:2,content:"&#xED52"}):this.getAdvancedOption("SDIO",n,"ChangeWhereWindowsSear
ches",null,["SelectLocations"],function(){return
t.LocalDataProvider.launchIndexingOptions(r._host,!
1)},0,"advancedOption01")},p.prototype.getAdvancedOption=function(i,r,u,f,e,o,s,h,c
,l){var
y=this,a=n.InstrumentedItem.getNonSuggestionInstrumentedItem(i,t.SyntheticQSCodesMa
ps.KValues),v;return
this._instHelper.instrumentSyntheticInstrumentedItem(r,i,a),v=function(t)
{y._instHelper.instrumentItemClick(n.getCurrentTime(),a,r,null,n.getInputType(t));o
()},{id:h,selected:!1,title:this._host.getLocString(u),heading:f?
this._host.getLocString(f):null,text:this._host.getLocString.apply(this._host,e),in
stItem:a,click:v,layout:s,dismiss:c,icon:l}},p.prototype.getImmersiveOptInOption=fu
nction(n){var u,r;return t.qfMode==2?
(r=this._host.getLocString("OptOutButtonText"),u=function(){return
i.setOptInStatus("ImmersiveSearch",i.FeatureStatus.OptedOut,"FiltersOptButton")}):
(r=this._host.getLocString("OptInButtonText"),u=function(){return
i.setOptInStatus("ImmersiveSearch",i.FeatureStatus.OptedIn,"FiltersOptButton")}),
{id:"advancedOption04",selected:!
1,title:r,heading:null,text:r,instItem:null,click:u,layout:n,icon:
{type:2,content:"&#xEADA"}}},p.prototype.getMenuDividerOption=function()
{return{id:"",selected:!
1,title:"",heading:null,text:"",instItem:null,click:null,layout:5}},p.prototype.add
CortanaOptions=function(n,i){var
r=this,u;t.qfMode==2&&(n.push(this.getAdvancedOption("OMCS",i,"",null,
["OptionsMenuSettings"],function(){return
r._host.launchWindowsCortanaSettings()},4,"",null,
{type:2,content:"&#xE713"})),u=t.cortanaAccountType==2||t.cortanaAccountType==1,u?
(n.push(this.getAdvancedOption("OMCN",i,"",null,
["OptionsMenuCortanaNotebook"],function(){return
r._host.launchCortanaNotebook()},4,"",null,
{type:2,content:"&#xEB7F"})),n.push(this.getAdvancedOption("OMCD",i,"",null,
["OptionsMenuCortanaDevices"],function(){return
r._host.launchCortanaDevices()},4,"",null,
{type:2,content:"&#xF191"})),n.push(this.getAdvancedOption("OMAC",i,"",null,
["OptionsMenuAddAccount"],function(){return
r._host.launchWindowsAccountSettings()},4,"",null,{type:2,content:"&#xE910"}))):
(n.push(this.getMenuDividerOption()),n.push(this.getAdvancedOption("OMSC",i,"",null
,["OptionsMenuSignIn"],function(){return r._host.launchCortanaSignIn()},4,"",null,
{type:3,needsAccentColor:!1}))))},p.prototype.getAdvancedOptions=function(n,i){var
r=[];return
i==4&&(t.config.immersiveSearchOptInSupported&&(r.push(this.getImmersiveOptInOption
(4)),r.push(this.getMenuDividerOption())),r.push(this.getIndexingOption(n,i)),this.
addCortanaOptions(r,n,i)),t.config.immersiveSearchOptInSupported&&i==2&&r.push(this
.getImmersiveOptInOption(0)),t.isCloudSearchEnabledCache&&(i==4&&r.push(this.getMen
uDividerOption()),this.addCloudSearchUpsells(r,n,i)),i==1&&r.push(this.getIndexingO
ption(n,i)),r},p.prototype.addCloudSearchUpsells=function(i,r,u){var
e=t.substrateProvidersEnabled(),o=e&&!this._upsellGotDismissed,f;if((u==0||u==4||
u==3||u==(o?2:1))&&(u!=0||!this._selectedScope||
this._selectedScope.type==t.Scope.Emails||
this._selectedScope.type==t.Scope.People||
this._selectedScope.type==t.Scope.Documents)&&(f=t.getAccountTypeForCloudContent(),
u!=3||e&&f==1))if(e)
{if(this._upsellGotDismissed&&this._selectedScope&&this._selectedScope.type==t.Scop
e.Documents&&u==0)return;(f!=1||t.isSubstrateO365AccountConnected)&&(f!=2||
t.isSubstrateOutlookAccountConnected)||
i.push(this.getSubstrateUpsell(t.accountTypeToAuthType(f),r,u))}else
n.isBingEnabled()&&t.isCortanaEnabledCache&&!
t.isCortanaPersonalized&&i.push(this.getOneDriveUpsell(r))},p}
();t.HeaderFooterViewModel=p})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function i(n,t){var
i=HitHighlightingParser.removeMarkers(n.text),r;!
i.includes(t.queryToFetch)&&i.toLowerCase().startsWith(t.queryToFetch.toLowerCase()
)&&(r=t.queryToFetch+i.substr(t.queryToFetch.length),n.text=HitHighlightingParser.a
ddMarkers(r,t.queryToFetch));!
n.query.includes(t.queryToFetch)&&n.query.toLowerCase().startsWith(t.queryToFetch.t
oLowerCase())&&(n.query=t.queryToFetch+n.query.substr(t.queryToFetch.length))}funct
ion r(n,r,u,f,e,o,s,h){var
l,c;if(n.actionUri=f,n.confidence=o,n.source=s,n.handoffType==4)if(l=n.query.toLowe
rCase()==r.queryToFetch.toLowerCase(),n.updateFromQuery=function(i){return l?
(n.query=i.queryToFetch,n.text=HitHighlightingParser.addMarkers(n.query,i.queryToFe
tch),n.narratorText=t.getNarratorText(n),!0):!
1},c=t.parseTaskFrame(e),c)n.isReformulation=!0,n.click=function(){return
h.reformulate(n.query,c)};else return!1;else
n.classNames.push("action"),n.click=function(){return
h.launchCat1(n.query,f,e)};return n.getIcon||t.isValidIcon(n.icon)||
(n.icon={type:3}),i(n,r),n.narratorText=t.getNarratorText(n),n.type!
="CSK"&&(n.getMruData=function()
{return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionS
core:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfiden
ceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),ann
otation:n.primaryMetadata,icon:n.getIcon?
null:n.icon,actionUri:f,taskFrame:e,confidence:o,source:s,suggestionKey:t.getSugges
tionKey(n)}}),!0}function o(n,r,u,e,o,s,h,c,l,a,v,y){if(n.isAnswer=!
0,n.htmlContent=e&&e.Content?
e.Content.HTML:null,n.baseSearchUrl=h,n.segments=c,n.htmlContent){var
p=JsonInject.GetResourceKeys([e]);p&&(n.executeScript=function(){return
JsonInject.WriteAfterContentResources(JsonInject.FilterResources(a,p))})}s&&(n.seco
ndaryIcon={content:s,type:0});n.text.includes(HitHighlightingParser.startMarker)||
(n.text=HitHighlightingParser.addMarkers(n.text,r.queryToFetch));n.htmlContent||
o&&(n.primaryMetadata=o,n.additionalInfoText=" - "+o);n.handoffType==10?
(n.classNames.push("action"),i(n,r),t.isValidIcon(n.icon)||
(n.icon={type:3}),n.click=function(){return
v.launchCat2or3a(n.query,l)},n.allowedInGroups=!n.htmlContent):
(f(n,v),n.click=function(){return
v.launchSearch(n.query,y.getSearchUrl(r.fullPartialQuery,n.query,n.type,n.baseSearc
hUrl),!1)},n.allowedInGroups=n.secondaryIcon?!!n.additionalInfoText:!
n.htmlContent);n.narratorText=t.getNarratorText(n)}function u(n,i,r,u,f)
{n.url=u;n.tooltip=u+"\n\n"+HitHighlightingParser.removeMarkers(n.primaryMetadata);
t.isValidIcon(n.icon)||(t.qfMode!=3?
n.getIcon=f.getEdgeIcon:n.icon={type:1,content:"&#xE774"});n.click=function()
{return
f.launchUrl(u)};n.narratorText=t.getNarratorText(n,f.getLocString("DirectNavSuggest
ion"));n.getMruData=function()
{return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionS
core:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfiden
ceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),tit
le:n.primaryMetadata,icon:n.getIcon?
null:n.icon,url:u,suggestionKey:t.getSuggestionKey(n)}}}function f(n,i)
{t.isValidIcon(n.icon)||(n.icon=n.type=="HS"&&t.qfMode!=3?
{content:"&#xE81C",type:2}:n.handoffType===13?
{content:"&#xEB9F",type:2}:n.handoffType===14?
{content:"&#xE714",type:1}:t.getSearchSuggestionIcon());n.primaryMetadata||
n.secondaryIcon||n.htmlContent||n.additionalInfoText||
(n.primaryMetadata=n.handoffType===13?
i.getLocString("SearchForWebImages"):n.handoffType===14?
i.getLocString("SearchForWebVideos"):t.getWebSuggestionAnnotation(i))}var
e=function(){function i(n,t,i,r,u)
{this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._temporar
yMessageHandler=r;this._previousKeystrokeCache=u}return
i.prototype.parse=function(n,t,i,r,u,f,e)
{this.parseOnlineSuggestions(n,t,r,u,f,e,i)},i.prototype.parseOnlineSuggestions=fun
ction(i,r,u,f,e,o,s){var a=this,h,l,k;if(!u)
{n.isDataSourceEnabled(n.WebDataSource,i)&&e(n.WebDataSource,
[],null);n.isDataSourceEnabled("OSTMA",i)&&e("OSTMA",
[],null);n.isDataSourceEnabled("QS",i)&&e("QS",
[],null);return}u.ELToken&&this._host.shouldRequestEltoken()&&this._host.setElToken
(u.ELToken);var
v=[],y=[],p=[],c=[],w=[],b=n.isDataSourceEnabled(n.WebDataSource,i);n.safeExecute(f
unction(){for(var e,o=function(t){var o=t.Attributes,h=o.appId,f,e;if(h)return
y.push(t),h.split(";").forEach(function(t){n.contains(c,t)||
c.push(t)}),"continue";if(f=o.settingId,f)return
p.push(t),w.push(f),"continue";b&&(e=n.safeExecute(function(){return
a.parseOnlineSuggestion(i,t,r,u.Resources,s)},"parseOnlineSuggestion"),e&&v.push(e)
)},t=0,f=u.Suggestions;t<f.length;t+
+)e=f[t],o(e)},"parseOnlineSuggestions");b&&(h=null,l=null,u.RankingSignals&&(h=n.s
afeExecute(function(){return
n.parseWebEngagementSignals(u.RankingSignals)},"parseWebEngagementSignals"),t.isL2(
i)||(l=n.safeExecute(function(){return
t.parseWebSuppressionSignals(u.RankingSignals,i)},"parseWebSuppressionSignals"))),t
his._previousKeystrokeCache&&this._previousKeystrokeCache.updateWebSignalsData(i.qu
eryToFetch,h),k={rankingSignals:u.RankingSignals,engagementSignals:h,suppressedGrou
ps:l,webTopResultRoutingType:u.PrefixRoutingType},e(n.WebDataSource,v,k));t.lookupB
yId(i,"OSTMA",c,y,function(n){return
n.Attributes.appId.split(";")},"QS",w,p,function(n){return
n.Attributes.settingId},f,r,e,o,function(n,t,f,e){return
a.parseIdLookupResponse(u,i,r,n,t,f,e)},null,null,null,null,this._instrumentationHe
lper,this._host)},i.prototype.parseIdLookupResponse=function(i,u,f,e,o,s,h){var
c=this,l,a;if(e.Attributes.stype!="CS"||!(s.length>0)){if(s.length!=1)
{l=n.safeExecute(function(){return
c.parseOnlineSuggestion(u,e,f,i.Resources,o)},"parseOnlineSuggestion
"+o);l&&h.push(l);return}a=function(n){var i=e.Attributes;return
c.compliesWithMinVersion(i.appMinVersion,n.deviceItem.version)?
(n.appContext=i.appContext,c.setRankingSignals(n,e),e.Text&&i.query&&(!
t.isApp(n.type)||
n.appContext)&&(n.text=e.Text,n.query=i.query),e.SecondaryText&&(n.primaryMetadata=
e.SecondaryText),n.handoffType==5)?
r(n,u,f,i.actionUri,i.taskFrame,parseFloat(i.confidence),parseInt(i.source),c._host
):!0:!1};n.safeExecute(function(){return
t.parseLocalSuggestion(u,s[0],o,f,c._host,c._temporaryMessageHandler,e.Attributes.s
type,c._instrumentationHelper,h,a)},"parseLocalSuggestion
"+o)}},i.prototype.parseOnlineSuggestion=function(i,f,e,s,h){var
d=this,l=f.Attributes,v=l.stype,y,c,a;if(l.appId&&v!="CS"||l.settingId)return
null;if(y=n.InstrumentedItem.createInstrumentedItem(e),c=t.createSuggestion(f.Text,
null,n.getIconFromOnlineResponse(f),v,l.query,y,null,e,!
1),c.primaryMetadata=f.SecondaryText,this.setRankingSignals(c,f),c.autoOpenPreviewP
aneWhenOnTopHit=l.openPP==="1",l.isAnswer==="1"){if(!l.url&&!
t.isCortanaEnabledCache)return null;c.handoffType=l.url||l.vertical?
n.verticalToHandoffType(l.vertical):10;c.signals=f.Signals;o(c,i,e,f.InstantAnswer,
l.additionalInfoText,l.secondaryIconUrl,l.url,l.segments,l.taskFrame,s,this._host,t
his._navigationHelper);l.noHeightRestriction==="1"&&c.classNames.push("noHeightRest
riction")}else if(l.taskFrame){if(!t.isCortanaEnabledCache||
(c.handoffType=l.actionUri.startsWith("action://FindMyStuff/")?4:5,!
r(c,i,e,l.actionUri,l.taskFrame,parseFloat(l.confidence),parseInt(l.source),this._h
ost)))return null}else
if(c.type=="CS")c.handoffType=3,this.setStoreSuggestionProperties(c,i,e,l);else{if(
!l.url)return
null;if(c.autoOpenPreviewPaneWhenOnTopHit=l.openPP==="1",c.type=="MD"||
c.type=="ML")a=n.prettyPrintUrl(l.query,i.queryToFetch,!0),a!
=c.query&&(c.query=a,c.text=i.queryToFetch?
HitHighlightingParser.addMarkers(a,i.queryToFetch):a),c.primaryMetadata&&!
c.primaryMetadata.includes(HitHighlightingParser.startMarker)&&(c.primaryMetadata=H
itHighlightingParser.addMarkers(c.primaryMetadata,i.queryToFetch)),c.handoffType=1,
u(c,i,e,l.url,this._host);else{if(n.queryLooksL
ikeUrl(c.query))return
null;c.handoffType=n.verticalToHandoffType(l.vertical);this.setWebSearchSuggestionP
roperties(c,i,e,l.url)}}if(!t.isValidSuggestion(c,"parseOnlineSuggestion"))return
null;var p=c.segments,w=p?p.split(","):[],b=w.some(function(i){return
n.contains(t.config.relatedWebImageSupportedSegments,i)}),k=w.some(function(i)
{return
n.contains(t.config.relatedWebVideoSupportedSegments,i)});return(f.ChildSuggestions
||b||k)&&(c.calculateChildSuggestions=function(){return
d.calculateRelatedSuggestions(c,i,f,h,b,k)}),c},i.prototype.setStoreSuggestionPrope
rties=function(n,i,r,u){var e=this,f;n.icon.bgColor=u.bgColor=="transparent"?
this._host.getAccentColor():u.bgColor;n.classNames.push("action");f=parseFloat(u.av
gRating);n.stars=this.getStarsRating(f);n.catalogScore=parseFloat(u.catalogScore);n
.avgRating=f;n.ratingCount=parseInt(u.ratingCount);n.packageFamilyName=u.appId;n.cl
ick=function(){return
e._host.launchStorePdp(u.productId)};n.narratorText=t.getNarratorText(n)},i.prototy
pe.getStarsRating=function(n){var t=Math.round(n*2)/2;return
Math.max(0,Math.min(5,t))},i.prototype.setRankingSignals=function(n,t){var
i=t.Attributes;n.hc=i.hc==="1";n.highConfidenceSuggestionScore=+i.hcs;n.highConfide
nceMetaSuggestionScore=t.HighConfidenceMetaSuggestionScore;n.prefetchConfidenceScor
e=t.PrefetchConfidenceScore;n.suggestionLogMeta=i.lm},i.prototype.compliesWithMinVe
rsion=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.leng
th;++i){if(f=u[i],e=r[i],f<e)return!1;if(f>e)return!0}return!
0},i.prototype.setWebSearchSuggestionProperties=function(n,i,r,u){var
e=this;f(n,this._host);i.queryToFetch||
(n.text=HitHighlightingParser.addMarkers(n.text));n.baseSearchUrl=u;n.click=functio
n(){return
e._host.launchSearch(n.query,e._navigationHelper.getSearchUrl(i.fullPartialQuery,n.
query,n.type,n.baseSearchUrl,n.handoffType),n.useRaf)};n.narratorText=t.getNarrator
Text(n);n.type=="HS"&&t.setExtraVerbs(n,function(){var
i=[{verb:"ManageSearchHistory",displayName:e._host.getLocString("ManageSearchHistor
y"),executeSync:function(){return
e._host.launchUrl("https://www.bing.com/profile/history?fsi=1&FORM=WNSHIS")},icon:
{content:"&#xE81C",type:2}}];return
t.config.removeSuggUrl&&i.unshift({verb:"RemoveFromWebHistory",displayName:e._host.
getLocString("RemoveFromWebHistory"),executeSync:function(){return
e.removeBingHistorySuggestion(n.text)},icon:{content:"&#xE711",type:2}}),i},!
0)},i.prototype.removeBingHistorySuggestion=function(i){var
r=this,u;i=HitHighlightingParser.removeMarkers(i);u=t.config.removeSuggUrl.replace(
"%7b0%7d",encodeURIComponent(i)).replace("%7bSID
%7d",sj_cook.get("_SS","SID"));n.fetchUrlJson(u,null,null,function(n)
{n.success&&(r._host.refreshCurrentPane(),sb_st(function(){return
r._temporaryMessageHandler.showTemporaryMessage(r._host.getLocString("RemoveFromWeb
HistoryConfirmation",i),
{content:"&#xE946",type:2})},250))})},i.prototype.addRelatedSuggestion=function(i,r
,u,f,e,o,s){var h=t.createSuggestion(f,null,e,o,i?
i.Query:u.query,n.InstrumentedItem.createInstrumentedItem(u.sequenceNumber),s,u.seq
uenceNumber,!1);h.groupType=t.GroupType.Related;h.parent=u;h.tooltip=i?
i.SecondaryText:null;h.rankingScore=i?i.RankingScore:0;h.category=i?
i.Category:null;h.isAnswer=!
0;this.setWebSearchSuggestionProperties(h,r,u.sequenceNumber,i?
i.Url:null);h.primaryMetadata=null;t.isValidSuggestion(h,"calculateRelatedSuggestio
ns")&&u.childSuggestions.push(h)},i.prototype.calculateRelatedSuggestions=function(
t,i,r,u,f,e){var
s,h,o;if(t.childSuggestions=[],r.ChildSuggestions)for(s=0,h=r.ChildSuggestions;s<h.
length;s+
+)o=h[s],this.addRelatedSuggestion(o,i,t,o.Text,n.getIconFromOnlineResponse(o),o.Ty
pe,0);f&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Images"),null,
"EIM",13);e&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Videos"),n
ull,"EVI",14);t.childSuggestions.length>0&&this._instrumentationHelper.instrumentDa
taSource(t.sequenceNumber,u,t.childSuggestions,null)},i}
();t.OnlineSuggestionsParser=e;t.adjustCasing=i;t.setCat1SuggestionProperties=r;t.s
etUrlSuggestionProperties=u})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function y(n){return n?[n]:
[]}function ft(n){if(n){var t=n.lastIndexOf(".");if(t>=0)return
n.substring(t)}return""}function et(t){var i=t?new Date(t):null;return
n.isValidDate(i)?i:null}function p(i){if(i){var
r=n.getCurrentDate();if(r.getDate()==i.getDate()&&r.getMonth()==i.getMonth()&&r.get
FullYear()==i.getFullYear())return i.toLocaleTimeString(t.uiLanguageCache,
{hour:"numeric",minute:"numeric"})}return null}function f(n,i,f,o,s){var
b,h,tt,it,k,d,c,a,l,g,v,y,rt,w,nt;for(s===void 0&&(s=!1),!
s&&f.extensionLC&&r.hideFileExtensions&&(b=f.extensionLC.length,h=f.query,h.toLocal
eLowerCase().endsWith(f.extensionLC)&&(tt=HitHighlightingParser.addMarkers(h,n),tt.
toLocaleLowerCase().endsWith(f.extensionLC)&&(f.query=h.substring(0,h.length-
b),it=HitHighlightingParser.removeMarkers(f.text),h==it&&(k=f.text.toLocaleLowerCas
e().lastIndexOf(f.extensionLC),f.text=f.text.substring(0,k)
+f.text.substr(k+b))))),a=f.lastModifiedDate,a&&(d=a.toLocaleDateString(),c=p(a),c|
|(c=a.toLocaleString(t.uiLanguageCache,
{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}))),l
=f.handoffType==2?
f.path:decodeURI(f.url||""),f.tooltip=at(f,l,c,o),f.primaryMetadata=f.sourceForGrou
p&&f.sourceForGroup!=1?
t.getGroupSourceDisplayName(f.sourceForGroup,o):f.itemTypeDisplayName,f.classNames=
[],f.match?(g=(vt(f.match.matchType)?o.getLocString(t.MatchType[f.match.matchType])
+": ":"")
+HitHighlightingParser.addMarkers(f.match.matchedText,n),f.additionalInfoText=g,f.s
econdaryMetadata=g,f.classNames.push("withMatchAnnotation","forceNoWrapOutsideTopRe
sult")):d&&(f.secondaryMetadata=o.getLocString("LastModified")+":
"+d),f.narratorText=t.getNarratorText(f),t.displayedInGridLayout(f.type)&&(i?
f.classNames.push("bigIcon","biggerIcon"):f.classNames.push("bigIcon")),!
s&&f.handoffType==2&&r.copyToClipboard&&u(f,function()
{return[{verb:"QF.CopyFullPath",displayName:o.getLocString("CopyFullPath"),executeS
ync:function(){return r.copyToClipboard(f.path,"")},icon:
{type:1,content:"&#xE8C8"}}]},!
1),v={},l&&(y=l.lastIndexOf("/"),y<0&&(y=l.lastIndexOf("\\")),rt=l.substring(0,y),v
[o.getLocString("Location")]={text:rt,click:f.click}),c&&(v[o.getLocString("LastMod
ified")]={text:c}),w=0,nt=e;w<nt.length;w++){var
ut=nt[w],et=ut[0],ot=ut[1],ft=f[ot];ft&&(v[o.getLocString(t.MatchType[et])]={text:f
t})}f.previewMetadata=v}function ot(n,i,r,u){var o,s;for(i.match||!r.match||
i.parentFolderDisambig||(i.match=r.match,i.needsRefreshAfterDeduping=!
0),o=0,s=e;o<s.length;o++){var l=s[o],h=l[1],c=r[h];c&&!
i[h]&&(i[h]=c,i.needsRefreshAfterDeduping=!
0)}i.needsRefreshAfterDeduping&&f(t.getEffectiveQuery(n),t.isL2(n),i,u,!0)}function
st(n,i,u,f,e){return n?
t.Promise.safeChainWithGlobalCaching("getImageWithLiveTokenAsync",function(){return
r.getImageWithLiveTokenAsync(u)},function(){return e},function(n){return
t.toIcon(n,"getImageWithLiveTokenAsync",i)},i,null,null,3):w(i,f)}function w(n,i)
{return t.Promise.safeChainWithGlobalCaching("getIconForTypeAsync",function(n)
{return
r.queryFormulationView.deviceSearch.getIconForTypeAsync(i,t.getImageSizeValue(n))},
function(n){return n+"_"+i},function(i){return
t.toIcon(i,"getIconForTypeAsync",n)},n)}function b(n){return n!
=null&&(n.type==3||!!n.content||!!n.className)}function o(n,t,i){i===void 0&&(i=!
0);var r=n.mayContainPII;return n.text?n.query?!n.handoffType&&n.handoffType!==0?
(SharedLogHelper.LogError(t,r?"":n.text,new Error("Missing handoff type")),!
1):n.type?i&&!n.getIcon&&!b(n.icon)?(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing icon")),!1):!0:(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing suggestion type")),!1):(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing query")),!1):(SharedLogHelper.LogError(t,r?"":n.deviceItem?
n.deviceItem.id:"",new Error("Missing text")),!1)}function u(n,i,r){var
u=n.getExtraVerbs;n.getExtraVerbs=function(n){var f=u?u(n):[],e=i(n);return
t.joinVerbs(f,e,r)}}function ht(n,i,r){var
u=n.getExtraVerbsAsync;n.getExtraVerbsAsync=u?function(n){return
ThresholdUtilities.createPromise(function(f){return u(n).then(function(u){return
i(n).then(function(n){return f(t.joinVerbs(u,n,r))})})})}:i}function s(n,t){var
r=n.propertyHits||[],i=r.indexOf(t);return typeof i=="object"&&i.returnValue!
==undefined?i.returnValue:i>=0}function ct(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 i(t,i,r){return n.safeExecute(function(){return
ct(t.getProperty(i))},"get"+i,undefined,r)}function lt(n){for(var
r,u,e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];for(r=0,u=e;r<u.length;r++)
{var f=u[r],h=f[0],o=f[1],c=f[2];if(o&&s(n,c))return t.createMatch(h,o)}return
null}function at(n,i,r,u){var
f=i||"",s,h,o,c;for(n.textContentIfMatched&&(f+=(f?"\n\n":"")
+n.textContentIfMatched),s=!!f,h=function(){f&&(f+="\n");s&&(f+="\n",s=!
1)},r&&(h(),f+=u.getLocString("LastModified")+": "+r),o=0,c=e;o<c.length;o++){var
l=c[o],v=l[0],a=l[1],y=n[a];y&&(h(),f+=u.getLocString(t.MatchType[v])+":
"+n[a])}return f}function vt(n){switch(n){case t.MatchType.Author:case
t.MatchType.LastModifiedBy:case t.MatchType.Tags:case t.MatchType.Genre:case
t.MatchType.Album:case t.MatchType.Artist:return!0;case t.MatchType.Content:case
t.MatchType.Location:return!1;default:throw new Error("Unknown match type:
"+n);}}function yt(i,r,u,f,e,o,s,h,c,l,a,v,p,w,b,k,d,g,nt,tt)
{r&&n.isDataSourceEnabled(r,i)&&t.LocalDataProvider.getApps(u,function(t){var
u,s,i,o,h;if(l()){for(nt.instrumentResponseReceived(a,r,null,0,!
1),u=[],s=function(i){n.safeExecute(function(){return w(i,r,e(i).map(function(n)
{return t[n]}).filter(function(n){return!!n}),u)},"parseApp
"+r)},i=0,o=f;i<o.length;i+
+)h=o[i],s(h);v(r,u,null)}},p,r,tt);o&&n.isDataSourceEnabled(o,i)&&t.LocalDataProvi
der.getSettings(s,function(t){var
u,e,i,f,s;if(l()){for(nt.instrumentResponseReceived(a,o,null,0,!
1),u=[],e=function(i){n.safeExecute(function(){return
w(i,o,y(t[c(i)]),u)},"parseSetting "+r)},i=0,f=h;i<f.length;i+
+)s=f[i],e(s);v(o,u,null)}},p,o);b&&n.isDataSourceEnabled(b,i)&&t.LocalDataProvider
.getFiles(k,function(t){var r,f,i,u,e;if(l())
{for(nt.instrumentResponseReceived(a,b,null,0,!1),r=[],f=function(i)
{n.safeExecute(function(){return w(i,b,y(t[g(i)]),r)},"parseFile
"+b)},i=0,u=d;i<u.length;i++)e=u[i],f(e);v(b,r,null)}},i,p,b)}function pt(n,i)
{return t.isMobileCache?null:n.id==t.EdgeAppId?
i.getLocString("MicrosoftRecommendedBrowser"):n.isImmersive?n.isTrustedApp?
i.getLocString("TrustedMicrosoftStoreAppAnnotation"):i.getLocString("WindowsAppAnno
tation"):i.getLocString("DesktopAppAnnotation")}function wt(n,i){return
t.isModernSetting(n)?
i.getLocString("SystemSettingsAnnotation"):i.getLocString("ControlPanelAnnotation")
}function bt(i,r,u,e,o,s){var h=t.getAppItem(e),c,a,p,v,w,tt,b,k,nt;if(h)
{u&&d(e,h);e.primaryMetadata=pt(h,s);e.narratorText=t.getNarratorText(e);e.type=="I
BA"&&(e.tooltip=h.id,e.path=h.id);return}if(t.isSetting(e.type))
{e.primaryMetadata=wt(e.deviceItem,s);e.narratorText=t.getNarratorText(e);return}if
(e.type=="LURL"&&(h=e.deviceItem,h))
{c=h.id;e.narratorText=t.getNarratorText(e,s.getLocString("DirectNavSuggestion"));e
.tooltip=e.query+"\n\n"+c;e.url=c;return}if(a=t.getBrowsingHistoryItem(e),a){var
c=a.url,y=n.prettyPrintUrl(c,i,!1),it=i?
HitHighlightingParser.addMarkers(y,i):y,l=a.title;l&&(e.primaryMetadata=i?
HitHighlightingParser.addMarkers(l,i):l);e.text=it;e.query=y;e.narratorText=t.getNa
rratorText(e,s.getLocString("DirectNavSuggestion"));e.template=1;e.tooltip=(l?
l+"\n\n":"")
+c;e.classNames.push("forceNoWrapOutsideTopResult");e.url=c;return}if(p=t.getFileIt
em(e),p){kt(i,r,u,o,e,p,s);return}if(e.type=="PT"||e.type=="CG"){if(v=e,e.type!
="PT"&&e.deviceItem.launchArguments||
(v.path=e.deviceItem.id),w=e.deviceItem,tt=w.kind,tt=="program")
{g(e,s);return}if(b=dt(w),b)
{v.itemTypeDisplayName=b;f(i,r,v,s);return}e.type=="CG"&&g(e,s);return}if(k=t.getPo
werBiItem(e),k){nt=k.modelDisplayName;e.primaryMetadata=nt;e.additionalInfoText=" -
"+nt;e.narratorText=t.getNarratorText(e);return}throw new Error("Unexpected type:
"+e.type);}function kt(r,u,e,o,h,c,l){var y,k,p,w,v,b,a,g,nt;if(k=h.type=="LDOC"?
t.resolveKnownFolderGUIDsInPath(c.id):t.indexerFilePathToRegularPath(c.id),h.path=k
,h.itemTypeDisplayName=c.itemTypeDisplayName,e&&d(h,c),p=c.lastModifiedDate,n.isVal
idDate(p)&&(h.lastModifiedDate=p),w=c.extension,w&&(h.extensionLC=w.toLocaleLowerCa
se()),o!="MFF"||t.IndexerQueryGenerator)
{h.type=="MU"&&(h.artist=t.IndexerQueryGenerator?
i(c,"System.Music.DisplayArtist",o):i(c,"System.Music.Artist",o),h.album=i(c,"Syste
m.Music.AlbumTitle",o));v=void 0;switch(o)
{case"MDOC":h.author=i(c,"System.Author",o);h.lastModifiedBy=i(c,"System.Document.L
astAuthor",o);h.tags=i(c,"System.Keywords",o);s(c,"System.Search.Contents")&&(b=i(c
,"System.Search.AutoSummary",o),b&&(y=t.tryGetTextContentMatch(b,r),h.textContentIf
Matched=y[0],v=y[1]),c.propertyHits.length==1&&(h.matchedOnlyOnContent=!
0));break;case"MPHO":h.tags=i(c,"System.Photo.TagViewAggregate",o);break;case"MVID"
:t.IndexerQueryGenerator&&(h.artist=i(c,"System.Music.DisplayArtist",o),h.genre=i(c
,"System.Music.Genre",o));h.tags=i(c,"System.Keywords",o);break;case"MMUS":h.genre=
i(c,"System.Music.Genre",o)}!
h.text.includes(HitHighlightingParser.startMarker)&&r&&(a=void 0,g=o!="LM"&&o!
="FL",g&&(o=="MFF"?(a=i(c,"System.Title",o),a&&!
t.matchesOnPropertyHH(a,r)&&(a=undefined)):s(c,"System.Title")&&(a=i(c,"System.Titl
e",o))),a?h.text=HitHighlightingParser.addMarkers(a,r):v?h.match=v:
(nt=t.IndexerQueryGenerator?"System.Music.DisplayArtist":"System.Music.Artist",h.ma
tch=lt(c,o,[t.MatchType.Album,h.album,"System.Music.AlbumTitle"],
[t.MatchType.Artist,h.artist,nt],[t.MatchType.Genre,h.genre,"System.Music.Genre"],
[t.MatchType.Tags,h.tags,"System.Keywords"],
[t.MatchType.Tags,h.tags,"System.Photo.TagViewAggregate"],
[t.MatchType.Author,h.author,"System.Author"],
[t.MatchType.LastModifiedBy,h.lastModifiedBy,"System.Document.LastAuthor"])))}f(r,u
,h,l);ni(h,l)}function d(i,r){var u=n.safeExecute(function(){return
r.getProperty("System.Link.TargetParsingPath")},"getTargetPath"),f,e,o;u&&(u=u.toLo
caleLowerCase(),f=t.getKnownFolderPathLC(t.FOLDERID_Profile),f&&(e=t.getKnownFolder
PathLC(t.FOLDERID_SystemX86),e&&u.startsWith(e+"\\config\\systemprofile")?
u=f+u.substr(e.length+21):
(o=t.getKnownFolderPathLC(t.FOLDERID_System),o&&u.startsWith(o+"\\config\\systempro
file")&&(u=f+u.substr(o.length+21)))),i.targetPathLC=u)}function dt(n)
{if(n.launchArguments)return null;var t=n.itemTypeDisplayName;return t&&t[0]!="."?
t:null}function h(i,r){for(var o,y,h,c,a,u,l,f,v,s=[],e=0;e<i.length-1;++e)if(!
t.displayedInGridLayout(i[e].type))for(o=e+1;o<i.length;+
+o)if(i[e].type==i[o].type&&i[e].text.toLocaleLowerCase()==i[o].text.toLocaleLowerC
ase()){s[e]=!0;s[o]=!0;break}if(s.length!=0)for(y=i.filter(function(n,t){return
s[t]}),h=r.getLocString("InfoTextWithSource"),c=0,a=y;c<a.length;c+
+)if(u=a[c],u.path){if(l=u.path.lastIndexOf("\\"),l==-
1)continue;if(f=u.path.slice(u.path.lastIndexOf("\\",l-1)+1,l),v=u.handoffType==2?
null:u.primaryMetadata,v&&f.endsWith(":"))continue;u.type=="IBA"?
(u.secondaryMetadata=u.primaryMetadata,u.primaryMetadata=f):u.primaryMetadata=u.pri
maryMetadata?v?n.formatString(h,[f,u.primaryMetadata]):n.formatString(h,
[u.primaryMetadata,f]):f;u.additionalInfoText=n.formatString(h,["
-",f]);u.match&&(u.classNames=u.classNames.filter(function(n){return n!
="withMatchAnnotation"&&n!
="forceNoWrapOutsideTopResult"}));u.narratorText=t.getNarratorText(u);u.parentFolde
rDisambig=f}}function g(n,i)
{n.primaryMetadata=i.getLocString("RunCommandPrompt");n.classNames.push("action");n
.narratorText=t.getNarratorText(n)}function gt(n){return n=="EBH"}function
nt(i,r,u,f,e,s,h,c,l,a){var
it=r.deviceItem.kind,d=t.localDataSourceMayContainPII(u),w,y,g,nt,k,tt;if(!h)
{SharedLogHelper.LogError("parseLocalSuggestion"+u,d?"":r.deviceItem.displayName||
r.deviceItem.id,new Error("Unrecognized kind: "+it));return}if(w=h=="LURL"||
h=="EBH"?1:2,n.isSuggestionTypeEnabled(u,h,w,i)){var
b=t.getEffectiveQuery(i),p=gt(h)?null:r.deviceItem.displayName,rt=p&&b?
HitHighlightingParser.addMarkers(p,b):p,v=t.createSuggestion(rt,r.getIcon,r.icon,h,
p,n.InstrumentedItem.createInstrumentedItem(f),w,f,d);v.deviceItem=r.deviceItem;v.c
iMetaData=r.ciMetaData;t.isApp(h)&&(v.pinnedToTaskbar=e.isPinnedToTaskbar(r.deviceI
tem.id));r.groupDisplayName&&(v.groupDisplayName=r.groupDisplayName);y=t.getAppItem
(v);y?(v.click=function(){return
e.launchAppItem(y,u,v.appContext)},t.config.maxJLcm&&ti(v,y,e,s,f,u,c)):
(g=t.getBrowsingHistoryItem(v),g?(nt=v.url,v.click=function(){return
e.launchUrl(nt)},t.qfMode!=3?
v.getIcon=e.getEdgeIcon:v.icon={type:2,content:"&#xE81C"}):v.click=function()
{return e.launchDeviceItem(v.deviceItem,u)});y&&v.type!="IBA"||
t.isSetting(v.type)||t.isFileOrFolder(v.type)&&v.type!="LDOC"?
v.getMruData=function()
{return{type:v.type,handoffType:v.handoffType,hc:v.hc,highConfidenceMetaSuggestionS
core:v.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:v.prefetchConfiden
ceScore,id:r.deviceItem.id,suggestionKey:t.getSuggestionKey(v),appContextData:v.app
Context?
{appContext:v.appContext,query:v.query,textWithoutHH:HitHighlightingParser.removeMa
rkers(v.text)}:undefined}}:(k=t.getCommandLineItem(v),k?
v.hc=t.isRealCommand(v,k):h=="PBI"&&(v.hc=r.deviceItem.rankScore>900));tt=t.getGrou
pType(v);t.shouldSetThisPcGroupSource(tt,i)&&(v.sourceForGroup=1);bt(b,t.isL2(i),t.
supportsShortcuts(u,i),v,u,e);o(v,"parseLocalSuggestion
"+u)&&a(v)&&l.push(v)}}function ni(n,i){u(n,function(){var r,u;return
n.duplicates&&(r=n.duplicates.find(function(n){return n.handoffType==7||
n.handoffType==8}),r)?
(u=[],u.push({verb:"OpenInBrowser",displayName:i.getLocString("OpenInBrowser"),exec
uteSync:function(){return i.launchUrl(r.url+(r.handoffType==8?"?web=1":""))},icon:
{type:1,content:"&#xE774"}}),r.locationUrl&&u.push({verb:"OpenFileLocationInBrowser
",displayName:i.getLocString("OpenFileLocationIn",t.getGroupSourceDisplayName(r.sou
rceForGroup,i)),executeSync:function(){return i.launchUrl(r.locationUrl)},icon:
{type:2,content:"&#xE838"}}),u):[]},!0)}function ti(n,i,r,f,e,o,s){var
h=i.id,y=i.filePath,a=rt[h],w,p;if(!a&&y){w=y.toLowerCase();for(p in
v)if(w.includes(p)){a=v[p];break}}a&&a.length==0||(t.alwaysWide||!
ut.find(function(n){return n==h}))&&(n.calculateChildSuggestions=function(){return
ii(h,y,n,i,a,r,f,e,o,s)},t.config.maxJLcm&&u(n,function(u){var e=[],o,s;return u||
(n.calculateChildSuggestions&&n.calculateChildSuggestions(),n.childSuggestions&&(o=
!1,n.childSuggestions.filter(function(n){return n.type=="JL"&&!
n.displayed&&n.groupType==t.GroupType.JumpListTasks}).slice(0,t.config.maxJLcm).for
Each(function(n){o=!0;var
t={verb:"JumpListTask_"+h+"_"+n.text,displayName:n.text,executeSync:function()
{return l(i,n,r,f)},getIcon:c(n.jumpListItem,n.parent,!1,h)};e.push(t)}),s=!
1,n.childSuggestions.filter(function(n){return n.type=="JL"&&!
n.displayed&&n.groupType!
=t.GroupType.JumpListTasks}).slice(0,t.config.maxJLcm).forEach(function(n,t){var
u,a;o&&!s&&(u={},e.push(u));s=!
0;a={verb:"JumpList_"+h+"_"+t,displayName:n.text,executeSync:function(){return
l(i,n,r,f)},getIcon:c(n.jumpListItem,n.parent,!0,h)};e.push(a)}))),e},!0))}function
ii(i,r,u,f,e,s,a,v,y,p){var
d,b,ft,w,g,rt,k,nt,ut,st;if(u.calculateChildSuggestions=null,d=f.jumpList,d&&d.leng
th!=0){for(b=r||"",ft=b.indexOf("}"),b=b.substr(ft+1),w=[],g=0,rt=d;g<rt.length;g+
+)if(k=rt[g],!e||n.contains(e,k.type)){var et=it(k.type),ot=et!
=t.GroupType.JumpListTasks,ht=function(r){var
e,h;if(tt(r))return"continue";e=t.createSuggestion(r.displayName,c(r,u,ot,i),null,"
JL",r.displayName,n.InstrumentedItem.createInstrumentedItem(v),2,u.sequenceNumber,o
t);e.click=function(){return
l(f,e,s,a)};e.jumpListItem=r;e.groupType=et;e.groupDisplayName=k.name;e.parent=u;e.
tooltip=r.description;h=b&&r.path.endsWith(b);h||
(e.path=r.path);o(e,"calculateJumpListSuggestions")&&(w
.push(e),ri(f,e,s,a))};for(nt=0,ut=k.items;nt<ut.length;nt+
+)st=ut[nt],ht(st)}w.length>0&&(u.childSuggestions=u.childSuggestions?
u.childSuggestions.concat(w):w,h(w,s),p.instrumentDataSource(v,y,w,null))}}function
c(n,i,r,u){return function(f,e){return
t.getIcon(n,u+"_"+n.path+"_"+n.displayName,"jumpList",!r,!1)(f,function(n){n?
e(n):i.getIcon(f,e)})}}function tt(i){return i.displayName?!
t.alwaysWide&&n.olderThan2Weeks(i.lastAccessed)?!0:!1:!0}function it(n){switch(n)
{case 0:return t.GroupType.JumpListTasks;case 1:return
t.GroupType.JumpListPinned;case 2:return t.GroupType.JumpListRecent;case 3:return
t.GroupType.JumpListFrequent;default:return t.GroupType.JumpListCustom}}function
l(n,i,r,u){t.Promise.safeChain("launchJumpList",function(){return
i.jumpListItem.launchAsync()},null,function()
{i.jumpListItem.deleteAsync&&t.DialogBox?
t.DialogBox.show(r.getLocString("JumpListItemUnavailableDeleteConfirmation"),
[{id:null,text:r.getLocString("Cancel"),selected:!0,action:function(){return
r.setFocusInSearchBox("jumpListItemDialogBoxCancel")}},
{id:null,text:r.getLocString("Remove"),selected:!1,action:function()
{a(n,i,r,u);r.setFocusInSearchBox("jumpListItemUnavailable")}}]):
(u.showTemporaryMessage(r.getLocString("JumpListItemUnavailable"),
{content:"&#xE946",type:2}),a(n,i,r,u),r.setFocusInSearchBox("jumpListItemUnavailab
le"))})}function a(n,i,r,u){var f=function(){return
ui(i)},e;i.jumpListItem.deleteAsync?
(e=i.parent.childSuggestions.length==1,t.Promise.safeChain("deleteJumpList",functio
n(){return i.jumpListItem.deleteAsync()},function()
{n.getJumpListAsync&&t.Promise.safeChain("getJumpListAsync",function(){return
n.getJumpListAsync()},function(n){e&&n.some(function(n){return
it(n.type)==i.groupType&&n.items.some(function(n){return!tt(n)})})?f():
(r.refreshCurrentPane(),u.showTemporaryMessage(r.getLocString("RemovedFromList",i.t
ext),{content:"&#xE946",type:2}))},f)},f)):f()}function ri(n,t,i,r)
{t.jumpListItem.deleteAsync&&u(t,function(){var
u={verb:"RemoveFromThisList",displayName:i.getLocString("RemoveFromThisList"),execu
teSync:function(){return a(n,t,i,r)},icon:{type:2,content:"&#xE711"}};return[u]},!
0)}function ui(n){var i=_ge(n.id);t.setVisibility(i,!1);n.suppressed=!0}var
r=SearchAppWrapper.CortanaApp,rt={"Microsoft.MicrosoftEdge_8wekyb3d8bbwe!
MicrosoftEdge":[0],"Microsoft.InternetExplorer.Default":[0],Chrome:
[0],"360browser":[0]},v={skype:[],outlook:[0],"360browser":[0],chrome:[0],iexplore:
[0],opera:[0],firefox:[0],safari:
[0]},e=[[t.MatchType.LastModifiedBy,"lastModifiedBy"],
[t.MatchType.Author,"author"],[t.MatchType.Artist,"artist"],
[t.MatchType.Album,"album"],[t.MatchType.Genre,"genre"],
[t.MatchType.Tags,"tags"],],ut=["Microsoft.Windows.Explorer",],k;t.getFileExtension
=ft;t.toDate=et;t.getTodayTimeString=p;t.setFileTemplate=f;t.enrichMetadataFromDupl
icate=ot;t.getOneDriveSuggestionIcon=st;t.getIconForTypeAsync=w;t.isValidIcon=b;t.i
sValidSuggestion=o;t.setExtraVerbs=u;t.setExtraVerbsAsync=ht;k=function(){function
i(n,t,i,r)
{this._host=n;this._instrumentationHelper=t;this._temporaryMessageHandler=i;this._c
iDataLoader=r}return i.prototype.parse=function(i,r,u,f,e,o){for(var
v,y,p,s=this,c=[],w=function(t){n.safeExecute(function(){return
nt(i,t,u,r,s._host,s._temporaryMessageHandler,t.suggestionType,s._instrumentationHe
lper,c,function(){return!0})},"parseLocalSuggestion
"+u)},l=0,a=f.suggestions;l<a.length;l++)v=a[l],w(v);
(t.isFileOrFolderLocalDataSource(u)||u=="IBA")&&h(c,this._host);y=u=="PP"||
u=="ST";p={rankerExtraInfo:this._ciDataLoader&&y?
{ciVersion:this._ciDataLoader.getCurrentCiVersion()}:null,maxedOut:f.maxedOut};o(u,
c,p)},i}
();t.SuggestionsParser=k;t.lookupById=yt;t.decorateSuggestionsWithParentFolder=h;t.
parseLocalSuggestion=nt})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){var
r=function(){function i(i,r,u){var f=this;(u.bindShown(function(){var
n=f.getContstraintIndexInfo(i.lastUrl);f._ciVersion=String(n.version)}),u.hasFallba
ckHappened())||u.bindAppHidden(function(){var
r,s;if(n.isBingEnabled()&&n.isBrowserOnline())
{r=f.getContstraintIndexInfo(i.lastUrl);f._ciVersion=String(r.version);var
e=t.getCurrentLanguage(),u=t.config.ciVersion,o=f.parseUrlResult(i.urlResult);u>0&&
t.config.supportedCiMarkets[e]&&(e!=r.language||u>r.version||
u<r.version&&n.contains(t.config.blacklistedCiVersions,r.version))&&(!o.url||
i.lastUrl==o.url||o.errorCode!
="00000000")&&(s=f.getUrlForCiCab(u,e),t.Promise.safeChain("constraintIndexDownload
er.tryDownloadFromUrlAsync",function(){return
i.tryDownloadFromUrlAsync(s)},function(n){if(n){var
t=f.getContstraintIndexInfo(i.lastUrl);f._ciVersion=String(t.version)}else
SharedLogHelper.LogError("constraintIndexDownloader.tryDownloadFromUrlAsync",s,"Dow
nload failed")}))}})}return i.prototype.parseUrlResult=function(n){var
r=null,t=null,i;return n&&(i=n.split(":0x"),i.length>1&&(r=i[0],t=i[1],t!
="00000000"&&SharedLogHelper.LogError("constraintIndexDownloader.urlResult",t,"Down
load encountered problems"))),
{url:r,errorCode:t}},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.getUrlForCiCab=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.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}));__extends=this&&this.__extends||function(){var
n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){function
i(n,i,r,u){r||
(r={});t.getAuthAccountForCloudContent()=="Windows"&&t.cortanaAccountType!
=3&&t.getWindowsAndCortanaAccountIdentityDiff()!=1&&t.substrateProvidersEnabled()?
n.getAccount(0,t.getBingResourceOrScope(0),!1,!0,function(n){r["X-Search-
RPSToken"]=n&&n.Token?n.Token:"";u(r)},"Windows"):u(r)}var r=function(r){function
u(n,t){var i=r.call(this,"MODC")||this;return
i._accessTokenManager=n,i._host=t,i}return
__extends(u,r),u.prototype.getName=function()
{return"MyStuffOneDriveDataProvider"},u.prototype.getBaseUrl=function(){return
t.config.myStuffOneDriveRootUrl},u.prototype.getPostBody=function(n){return
n.taskFrame?n.taskFrame.raw:""},u.prototype.fetch=function(t,u,f,e,o,s,h){var
l=this,c;n.isDataSourceEnabled(this._dataSource,t)&&(c=function(i){var
h=Object.assign({},s);delete h[n.Service.QueryParams.ImpressionGuid];delete
h[n.Service.QueryParams.RequestElToken];r.prototype.fetch.call(l,t,u,f,e,o,h,i)},i(
this._accessTokenManager,this._host,h,c))},u}
(n.JsonDataProvider);t.MyStuffOneDriveDataProvider=r;t.updateOneDriveHeaders=i})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;
(function(t){var i=function(){function i(n){this._host=n}return
i.prototype.parse=function(n,i,r,u,f,e){var o=[];u&&(u.Results?
(this.addContent(n,o,u.Results.OneDriveDocuments,"FL",t.Scope.Documents,i),this.add
Content(n,o,u.Results.OneDriveFolders,"FD",t.Scope.Folders,i),this.addContent(n,o,u
.Results.OneDriveImages,"LI",t.Scope.Photos,i),this.addContent(n,o,u.Results.OneDri
veVideos,"LV",t.Scope.Videos,i),this.addContent(n,o,u.Results.OneDriveAudio,"MU",t.
Scope.Music,i)):SharedLogHelper.LogError("MyStuffOneDriveParser",null,new
Error("Missing Results
property")));t.decorateSuggestionsWithParentFolder(o,this._host);e("MODC",o,null)},
i.prototype.addContent=function(i,r,u,f,e,o){var
s=this,c,l,v,a;if(u&&n.isSuggestionTypeEnabled("MODC",f,7,i)){var
h=t.Scope[e],y=function(u){var k,c,d,w,g,b;if(!u.Content)return
SharedLogHelper.LogError("MyStuffOneDriveParser",h,new Error("Missing Content
property")),{value:void 0};if(c=u.Content.OneDriveData,!c)return
SharedLogHelper.LogError("MyStuffOneDriveParser",h,new Error("Missing OneDriveData
property")),{value:void
0};if(d=c.propertyHits.length==1&&c.propertyHits[0]=="TextContent",d&&(!
t.config.minLengthForContentMatch||
i.queryToFetch.length<t.config.minLengthForContentMatch))return{value:void
0};if(w=c.SeeMore,!w)return SharedLogHelper.LogError("MyStuffOneDriveParser",h,new
Error("Missing SeeMore property")),{value:void 0};var
v=t.getEffectiveQuery(i),a=t.decodeHtml(c.Name),y=void
0;if(a.includes(HitHighlightingParser.startMarker)?
y=HitHighlightingParser.removeMarkers(a):
(y=a,a=HitHighlightingParser.addMarkers(y,v)),f=="FL"&&(g=c.FullPath.lastIndexOf("\
\"),g!=-1)){var
nt=c.FullPath.substr(g+1),tt=HitHighlightingParser.addMarkers(nt,v),rt=!
tt.includes(HitHighlightingParser.startMarker)&&a.includes(HitHighlightingParser.st
artMarker);rt||(a=tt,y=nt)}var
it=t.ScopeConfig[e].icon,ut=t.isMedia(f),ft=t.getOneDriveSuggestionIcon(ut,it,c.Thu
mbnail.replace(":Thumbnail",":Cropped176x176#h=176&w=176"),c.Extension,c.Id),l=t.cr
eateSuggestion(a,ft,it,f,y,n.InstrumentedItem.createInstrumentedItem(o),7,o,!
0);l.url=w;l.path=c.FullPath;l.matchedOnlyOnContent=d;l.lastModifiedDate=t.toDate(c
.DateModified);c.Extension&&(l.extensionLC=c.Extension.toLocaleLowerCase());b=void
0;f=="FL"&&c.TextContent&&n.contains(c.propertyHits,"TextContent")&&(k=t.tryGetText
ContentMatch(c.TextContent,v),l.textContentIfMatched=k[0],b=k[1]);c.Artist&&(l.arti
st=HitHighlightingParser.removeMarkers(c.Artist));c.Album&&(l.album=HitHighlighting
Parser.removeMarkers(c.Album));a.includes(HitHighlightingParser.startMarker)||(b?
l.match=b:c.Path&&n.contains(c.propertyHits,"Path")&&(l.match=t.tryGetLocationMatch
(c.Path,v)));l.sourceForGroup=2;t.setFileTemplate(v,t.isL2(i),l,p._host);l.click=fu
nction(){return
s._host.launchUrl(w)};c.LocationUrl&&(l.locationUrl=c.LocationUrl,t.setExtraVerbs(l
,function(){var
n={verb:"OpenFileLocationInBrowser",displayName:s._host.getLocString("OpenFileLocat
ionIn",t.getGroupSourceDisplayName(2,s._host)),executeSync:function(){r
eturn s._host.launchUrl(c.LocationUrl)},icon:
{type:2,content:"&#xE838"}};return[n]},!
0));t.isValidSuggestion(l,"MyStuffOneDriveParser
"+h)&&r.push(l)},p=this;for(c=0,l=u;c<l.length;c++)if(v=l[c],a=y(v),typeof
a=="object")return a.value}},i}();t.MyStuffOneDriveParser=i})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(n){var t;(function(n)
{var t=function(){function n(n){var
t=this;n.bindQueryChangedOrInitialized(function()
{t._previousWebSignals=t._currentWebSignals;t._currentWebSignals=null;t._previousSp
ellerTrigger=t._currentSpellerTrigger;t._currentSpellerTrigger=null});n.bindConvers
ationStart(function()
{t._previousWebSignals=null;t._currentWebSignals=null;t._previousSpellerTrigger=nul
l;t._currentSpellerTrigger=null})}return
n.prototype.updateWebSignalsData=function(n,t)
{this._currentWebSignals={query:n,signals:t}},n.prototype.updateSpellerTriggerData=
function(n,t)
{this._currentSpellerTrigger={query:n,triggerSpeller:this.triggerSpellerOnTheNextKe
yStroke(t,n)}},n.prototype.getPreviousEventWebSignalsData=function(n){return
this._previousWebSignals&&this.isPreviousEventQuery(this._previousWebSignals.query,
n)?this._previousWebSignals.signals:null},n.prototype.enableCISpeller=function(n)
{return
this._previousSpellerTrigger&&this.isPreviousEventQuery(this._previousSpellerTrigge
r.query,n)&&this._previousSpellerTrigger.triggerSpeller},n.prototype.triggerSpeller
OnTheNextKeyStroke=function(n,t){return this.enableCISpeller(t)?!
0:n.every(function(n){return n.notAResult})?!
0:n.length>0&&this.isWebSpellCorrectedSuggestion(n[0])&&n.every(function(n){return
n.handoffType==0})?!0:!1},n.prototype.isWebSpellCorrectedSuggestion=function(n)
{return n.type=="SC"||n.type=="OS"},n.prototype.isPreviousEventQuery=function(n,t)
{return n&&t&&n.length==t.length-1&&t.startsWith(n)},n}
();n.PreviousKeystrokeCache=t})(t=n.Cache||(n.Cache={}))})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(t)
{function c(t,f){e=t;var o=_ge("dialogBox");if(!o){n.log("DialogBox wrapper element
not found");return}sj_be(o,"click",function(n){var
u=n.target.id,t=i.filter(function(n){return n.id==u}).shift();t?
(t.action&&t.action(),r()):u=="dialog_overlay"&&r();sj_sp(n)},!
0);f.bindKeyDown(function(n){var f,e,t,o,r,i;switch(n){case 39:for(t=u(),e=!
1,r=0,i=void 0;i=t[r];r++)if(e){f=i;break}else if(e=i.selected==!
0,e&&r+1==t.length){f=t[0];break}break;case 37:for(t=u(),o=void 0,r=0,i=void
0;i=t[r];r++){if(i.selected==!0){f=o?o:t[t.length-1];break}o=i}}f&&h(f)})}function
l(n,t){i=[];var r;if(t.length==0)throw new Error("DialogBox: Empty buttons
array");i=t.map(function(n,t){var i=n;return
i.id="dialog_b"+t,i.narratorText=i.text,i.selected&&(r=i.id),i});e.updateDialogBox(
!0,n,i);r&&sb_st(function(){return _ge(r).focus()},0);f=!0}function r()
{f&&(e.updateDialogBox(!1),f=!1)}function o(){return f}function u(){return
i.forEach(function(n){return n.selected=_ge(n.id)==_d.activeElement}),i}function
s(){return u().filter(function(n){return n.selected}).shift()}function h(n){for(var
r,t=0,u=i;t<u.length;t+
+)r=u[t],r.selected=r.id==n.id,r.selected&&_ge(n.id).focus()}function a(){if(o())
{var n=s();n&&(n.action&&n.action(),r())}}function v(){}var i=[],e,f=!
1;sj_be(sj_b,"keydown",function(n){if(n.keyCode==9&&o()){var
t=u();t.length>0&&t[t.length-1].selected&&r();sj_sp(n)}},!
0);t.init=c;t.show=l;t.hide=r;t.isVisible=o;t.getSelectableItems=u;t.getSelectedIte
m=s;t.select=h;t.submit=a;t.onAfterKeyDown=v})(i=t.DialogBox||(t.DialogBox={}))})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;
(function(n){n.DialogBoxViewModel=n.DialogBox})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function c(n){return
n.includes("form=vsranf")}function l(t){var i=n.tryParseUrl(t,!0);return!!i&&/
[\?\&]q=/i.test(i.parameters)&&!/[\?\&]view=detail/i.test(i.parameters)}function
ht(t){var i=n.tryParseUrl(t,!0);return!!i&&st.test(i.parameters)}function ct(n)
{switch(n){case 1:case 0:return 1;case 13:return 2;case 14:return 3;default:throw
Error("Unsupported handoff type: "+n);}}function a(n){switch(n){case 1:return
1;case 2:return 7;case 3:return 8;default:throw Error("Unsupported vertical:
"+n);}}function v(t){var i=n.tryGetBingPathLC(t);return i?n.contains(et,i)?
2:n.contains(ot,i)?3:n.contains(n.WebSearchPaths,i)?1:null:null}var
s=t.PreviewPaneWidth-24,y="miniserp_focus",p="disableOutline",r=2,w=["tab-
active","slide"],b=["aria-
expanded"],k="videoPreview",d=300,f=30,g="IsSearchAppXYFocusEnabled",nt="WinJS",tt=
"dFocusExit",i="win-xyfocus-
suspended",e="MiniSerpContentLoaded",it=["/account/","/settings.aspx"],u=function()
{var n={};return n[37]="left",n[39]="right",n[38]="up",n[40]="down",n}
(),rt=1e4,h=800,ut=100,ft=["&form=s00037&"],et=["/images/search","/images"],ot=["/v
ideos/search","/videos"],st=/[\?\&]FORM=HDRSC[1-3]/i,lt=function(){function
i(i,r,f,o,s){var
h=this;this._host=i;this._navigationHelper=r;this._instrumentationHelper=f;this._se
quenceNumberManager=o;this._previewPaneViewModelParent=s;this._deviceScale=1;this._
previewRequestId=0;this._previousURLs=[];this.blockedMiniSERPUrls=[_w.location.orig
in+_w.location.pathname];this._root=_ge("qfPreviewPane");this._seeAllResults=_ge("s
eeAllResults");this._footer=_ge("footer");this._contentContainer=_ge("previewContai
ner");this._scrollArea=_ge("qfPreviewScrollArea");sj_be(this._scrollArea,"scroll",f
unction(t)
{h._iframe&&n.contains([2,3],h._currentVertical)&&h._iframe.contentWindow.dispatchE
vent(new
Event(t.type,t));h._calculateIFrameHeight&&h._calculateIFrameHeight()});this._foote
r&&sj_be(this._footer,"keydown",function(i){h._iframe&&n.isUpOrDownKey(i.keyCode)?
(i.keyCode==38?h.tryExecuteFocusOnMiniSerp(function(){return
h._focusHelper.moveFocusToEdgeFocusableElement(1)}):t.config.allowKeyboardNavCyclin
g&&h.tryExecuteFocusOnMiniSerp(function(){return
h._focusHelper.moveFocusToEdgeFocusableElement(0)}),sj_pd(i),sj_sp(i)):i.keyCode==1
3&&h._footer.click()});sj_be(_w,"message",function(n){var r=n.data?
n.data.msWinJSXYFocusControlMessage:null,i,f;r&&r.type==tt&&(i=r.direction,f=r.keyC
ode,h._focusHelper&&!h._focusHelper.isL2Visible()&&h._focusHelper.getXYFocusRoot()!
=h._originalMiniSerpXYFocusRoot?
(h._focusHelper.setXYFocusRoot(h._originalMiniSerpXYFocusRoot),h.tryExecuteFocusOnM
iniSerp(function(){return h._focusHelper.moveFocus(i,f)})):(i!
=u[t.getRtlAdjustedKey(39)]&&n.source.blur(),i==u[40]||
i==u[38]&&t.config.allowKeyboardNavCycling?h._footer?
h._footer.focus():h._focusHelper.moveFocusToEdgeFocusableElement(i==u[38]?1:0):i!
=u[t.getRtlAdjustedKey(37)]||h._host.searchBoxHasFocus()||
h._host.setFocusInSearchBox("previewPaneUnfocus")))});_w.addEventListener(e,functio
n()
{h._onIFrameLoadedCallback&&(h._onIFrameLoadedCallback(),h._onIFrameLoadedCallback=
null)});i.bindShown(function(){ThresholdUtilities.getCortanaHeaders(function(n)
{n&&n["X-BM-DeviceScale"]&&(h._deviceScale=+n["X-BM-
DeviceScale"]/100)});h.setVertical(1)});i.bindAppHidden(function()
{h._seeAllResults&&(h._seeAllResults.innerText="");h._currentVertical=null});i.bind
SearchBoxGotFocus(function()
{h._focusHelper&&h._focusHelper.onSearchBoxFocusChanged()})}return
i.prototype.getSelectableItems=function()
{return[]},i.prototype.getSelectedItem=function(){return
null},i.prototype.select=function(){},i.prototype.onAfterKeyDown=function()
{},i.prototype.clear=function()
{this._previewedSuggestionType=null;this._previewedSuggestionLayoutKValue=null;this
._footer&&(t.setVisibility(this._footer,!
1),this._footer.onclick=null);this.clearContent();this._previousURLs=[]},i.prototyp
e.clearContent=function()
{for(this._previewRequestId+=1,this._focusHelper=null,this._onIFrameLoadedCallback=
null;this._contentContainer.hasChildNodes();)this._contentContainer.removeChild(thi
s._contentContainer.lastChild);this._contentContainer.classList.remove("miniSerpCon
tainer");this._contentContainer.classList.remove("errorMessageContainer");this._ifr
ame&&(this._iframe=null,this._calculateIFrameHeight=null);this._mutationObserver&&(
this._mutationObserver.disconnect(),this._mutationObserver=null)},i.prototype.hasFo
cus=function(){if(this._host.searchBoxHasFocus())return!1;var
t=n.getCurrentActiveElement();return t&&t!
=this._iframe&&this._root.contains(t)},i.prototype.focus=function(){var
t=this,n;this.hasFocus()||(this._iframe?
(n=this.tryExecuteFocusOnMiniSerp(function(){return
t._focusHelper.moveFocusToLastFocusedElement()}),n?
SearchAppWrapper.CortanaApp.focusWebView():this._host.setFocusInSearchBox("MiniSERP
VM Focus failed")):this._previewPaneViewModelParent.focusPending=!
0)},i.prototype.setVertical=function(n){if(n!=this._currentVertical)
{if(this._seeAllResults)switch(n){case
1:this._seeAllResults.innerText=this._host.getLocString("SeeAllResults");break;case
2:this._seeAllResults.innerText=this._host.getLocString("SeeAllImageResults");break
;case
3:this._seeAllResults.innerText=this._host.getLocString("SeeAllVideoResults");break
;default:throw new Error("Unsupported vertical type:
"+n);}this._currentVertical=n}},i.prototype.update=function(i,r,u,f){var
e=this,o,h,s;if(this._previewPaneId=f,this._previewedSuggestionType=i.type,this._pr
eviewedSuggestionLayoutKValue=i.instItem.getLayoutKValue(),o=i.type=="MB"&&i.segmen
ts=="Organization"?
null:i.baseSearchUrl,this.setVertical(ct(i.handoffType)),this._footer&&(t.setVisibi
lity(this._footer,!0),this._footer.onclick=function(t)
{e._previewPaneViewModelParent.onBeforeItemLaunch(n.getCurrentTime(),n.getInputType
(t),3);e._host.launchSearch(i.query,e._navigationHelper.getSearchUrl(r.fullPartialQ
uery,i.query,i.type,o,i.handoffType),!
1);e._previewPaneViewModelParent.onAfterItemLaunch(3)}),t.config.th&&ClientTestHook
s.isTesthookParamSet("noSerp"))
{this.renderIframe(null,"<html><body><\/body><\/html>",
{},undefined,u);h=n.getCurrentTime();this._previewPaneViewModelParent.onResponseRec
eived(h);return}s=this._navigationHelper.getSearchUrl(r.fullPartialQuery,i.query,i.
type,o,i.handoffType,u?"WMSRPA":"WMSRPM",!
0,null,u);s+="&qfig="+this._instrumentationHelper.getImpressionGui
d(this._sequenceNumberManager.getSequenceNumber());this._previousURLs=[];this.downl
oadAndDisplayMiniSerp(s,u,i.previewCallback)},i.prototype.downloadAndDisplayMiniSer
p=function(i,r,u){var f=this,o=!
1,h,c,l,e,a;t.config.th&&(h=ClientTestHooks.getUrlValue("client"),o=h&&h.toLowerCas
e()=="windows",c=ClientTestHooks.getUrlValue("previewPaneUrlOverride"),i=c?
decodeURIComponent(c):ClientTestHooks.CopyTestParameters(_w.location.search,i),o&&(
i=ThresholdUtilities.setUrlParameter(i,"client","windowsMiniSerp")),l=ClientTestHoo
ks.getUrlValue("miniSerpBag"),l&&(i=ThresholdUtilities.setUrlParameter(i,"bag",l)))
;e=this._host.getCustomHeaders();e["X-BM-
DeviceDimensionsLogical"]=s+"x"+this._root.clientHeight;e["X-BM-
DeviceDimensions"]=String(Math.round(s*this._deviceScale))
+"x"+this._root.clientHeight;o||(e["User-Agent"]=navigator.userAgent+"
RestrictedAPI");a=++this._previewRequestId;n.fetchUrl(i,e,null,function(t){var
l=n.getCurrentTime(),h;f._previewPaneViewModelParent.onResponseReceived(l);if(t.sta
tus==200&&t.responseText)f._previousURLs.push(i),f.renderIframe(i,t.responseText,e,
o,r),u&&u();else{var
a=f._host.getLocString("PreviewPaneErrorMessage"),c=a.split("{0}"),v=n.safeExecute(
function(){return(new RegExp("[?|&]q=([^&]+?)(&|#|
$)").exec(decodeURIComponent(i).replace(/\+/g," "))||[null,""])
[1]},"decodePreviewPaneSearchUrl",""),s=sj_ce("div","previewPaneErrorMessage");s.ap
pendChild(_d.createTextNode(c[0]));h=_d.createElement("span");h.textContent=v;s.app
endChild(h);s.appendChild(_d.createTextNode(c[1]));f._contentContainer.appendChild(
s);f._contentContainer.classList.add("errorMessageContainer")}},null,function()
{return a==f._previewRequestId},!0)},i.prototype.renderIframe=function(t,i,r,u){var
f=this;this._iframe=sj_ce("iframe","miniIframeSerp");this._iframe.setAttribute("scr
olling","no");this._contentContainer.classList.add("miniSerpContainer");this._conte
ntContainer.appendChild(this._iframe);var
s=this._iframe.contentWindow,o=this._iframe.contentDocument,h=!
1;this.setIframeHeight(0);this._onIFrameLoadedCallback=function(){var
e=o.body,h=0,i;f._calculateIFrameHeight=function(){var n=e.offsetHeight;n!
=h&&n>0&&(h=f.setIframeHeight(n))};f._calculateIFrameHeight();f.overrideAjaxCalls(s
,r,u);f.captureNavigationsAndSizeEvents(t,e,s,o);f._scrollArea.scrollTop=0;n.contai
ns([2,3],f._currentVertical)&&(i={childList:!0,subtree:!0},f._mutationObserver=new
MutationObserver(function()
{f._calculateIFrameHeight&&f._calculateIFrameHeight()}),f._currentVertical===2?
f._mutationObserver.observe(o.getElementById("images"),i):f._currentVertical===3&&f
._mutationObserver.observe(o.getElementById("video"),i));f._instrumentationHelper.l
ogClientInstEvent("Select","PreviewPaneRendered",f._sequenceNumberManager.getSequen
ceNumber(),
{ppId:""+f._previewPaneId,suggestion:f._previewedSuggestionLayoutKValue})};this._if
rame.onload=function(){if(h){f.tryLaunchUrl(t,s.location.href,0);return}h=!
0;f.overrideAjaxCalls(s,r,u)};o.open();o.write(i);o.write("<base href='"+t+"'
target='_parent' />");o.write("<script>var evt; if (typeof Event === 'function')
{ evt = new Event('"+e+"') } else { evt = document.createEvent('Event');
evt.initEvent('"+e+"', true, true) };
window.parent.dispatchEvent(evt)<\/script>");o.close()},i.prototype.setIframeHeight
=function(n){return
n<h&&(n=h),this._iframe.style.height=n+"px",n},i.prototype.overrideAjaxCalls=functi
on(n,t,i){var r=this;n.sj_gx=function(){var n=sj_gx(),u=n.open;return
n.open=function(f,e,o,s,h){if(r.blockedMiniSERPUrls.some(function(n){return
e.startsWith(n)}))throw new Error("MiniSERP blocked URL request: iFrame URL:
"+r._iframe.contentDocument.baseURI+" requestUrl:
"+e);f=="GET"&&i&&(e=ThresholdUtilities.setUrlParameter(e,"client","windowsMiniSerp
"));u(f,e,o,s,h);for(var c in
t)n.setRequestHeader(c,t[c])},n}},i.prototype.captureNavigationsAndSizeEvents=funct
ion(t,i,r,u){var
f=this,h;this._focusHelper=this.createFocusHelper(r,u);this._focusHelper&&(this._or
iginalMiniSerpXYFocusRoot=this._focusHelper.getXYFocusRoot());this._previewPaneView
ModelParent.focusPending&&(this._previewPaneViewModelParent.focusPending=!
1,this.focus());this._iframe.contentWindow.overlay_onBeforeContentLoad=function()
{f.setIframeHeight(rt)};this._iframe.contentWindow.overlay_onBeforeSuccess=function
(n){f.setIframeHeight(n.clientHeight+ut)};var e=function(){r.sj_lc=function(n)
{if(n)f.tryLaunchUrl(t,n,0);else{var i=f._previousURLs[f._previousURLs.length-
2];f._previousURLs.splice(f._previousURLs.length-
2,2);f.tryLaunchUrl(t,i,0)}};r.MiniSerp=!
0;f._calculateIFrameHeight()},s=function(n)
{f._focusHelper.setXYFocusRoot(n);f._focusHelper.moveFocusToEdgeFocusableElement(0)
},o=r.sj_evt;o?(h=["onP1","ajaxReady"],h.forEach(function(n){return
o.bind(n,e)}),o.bind("l2_overlay_visible",function(n){e();var
t=f._iframe.contentDocument.getElementById(n[1]);t&&(f._focusHelper.setIsL2Visible(
!0),s(t))}),o.bind("l2_overlay_hidden",function()
{e();f._focusHelper.setIsL2Visible(!
1);s(f._iframe.contentDocument.body)})):e();r.open=function(n){return
f.tryLaunchUrl(t,n,0),null};i.onclick=function(i){for(var r=i.target;r&&!
r.href;)r=r.parentNode;r&&f.tryLaunchUrl(t,r.href,n.getInputType(i))==0&&i.preventD
efault()}},i.prototype.navigateInPlace=function(n,t,i,r){var
u=this,f=a(r),e;this._previewPaneViewModelParent.onBeforeItemLaunch(t,i,f);this._fo
oter&&(this._footer.onclick=function(){return
u._host.launchSearch(null,u.enrichBingSearchUrlParameters(n),!
1)});this.clearContent();this._previewPaneViewModelParent.focusPending=!
0;this._previewPaneViewModelParent.startLoadingScreen();e=this.enrichBingSearchUrlP
arameters(n,!
0);this.setVertical(r);this._instrumentationHelper.logClientInstEvent("Select","Nav
igateInPlace",this._sequenceNumberManager.getSequenceNumber(),
{destinationVertical:r.toString(),url:n});this.downloadAndDisplayMiniSerp(e,!
1);this._previewPaneViewModelParent.onAfterItemLaunch(f)},i.prototype.tryLaunchUrl=
function(i,r,u){var s,f,h,e,y,o;if(!r)return
1;if(s=n.getCurrentTime(),r=r.trim(),f=r.toLowerCase(),h=v(r),h!==null&&l(r)&&!
c(f)&&(t.config.navigateRequeriesInsideMiniSERP||ht(r))&&h!
==this._currentVertical)return
this.navigateInPlace(r,s,u,h),0;if(f.startsWith("javascript:location.reload"))retur
n 0;if(r==i+"#"||f.startsWith("javascript:"))return 1;if(f=="/loading")return
0;if(r.startsWith(window.location.href))return
SharedLogHelper.LogError("previewPane.tryLaunchUrl",i,new Error("Anchor navigation
on PreviewPane")),0;if(r.startsWith("/")&&(r=n.getWindowProtocol()
+"//"+n.getWindowHost()+r),e=v(r),e)
{if(e==this._currentVertical&&l(r)&&(t.config.navigateRequeriesInsideMiniSERP||
ft.some(function(n){return f.includes(n)})))return
this.navigateInPlace(r,s,u,e),0;r=this.enrichBingSearchUrlParameters(r)}y=e?
a(e):2;this._previewPaneViewModelParent.onBeforeItemLaunch(s,u,y);o=n.tryGetBingPat
hLC(r);o?it.some(function(n){return o.startsWith(n)})||c(f)?
this._host.launchUrl(t.config.settingsUri):o.startsWith("/profile/interests")?
this._host.launchCat1(null,"ms-
cortana://navigate/Notebook",null):o.startsWith("/fd/auth/")?
t.isCortanaPersonalized?SharedLogHelper.LogError("previewPane.tryLaunchUrl",i,new
Error("Redirecting to sign in page when already signed
in")):this._host.launchUrl("ms-cortana://CapabilitiesPrompt/?
RequestedCapabilities=Personalization"):this._host.launchUrl(r):this._host.launchUr
l(r);this._previewPaneViewModelParent.onAfterItemLaunch(y);return
0},i.prototype.enrichBingSearchUrlParameters=function(n,t){return t===void 0&&(t=!
1),n=this._navigationHelper.enrichUrlWithMarketInfo(n),n=this._navigationHelper.enr
ichUrlWithDeviceInfo(n),n=this._navigationHelper.enrichUrlWithCvid(n),n=this._navig
ationHelper.enrichUrlWithSuggestionType(n,this._previewedSuggestionType),t||
(n=this._navigationHelper.enrichUrlWithMuidInfo(n),n=this._navigationHelper.enrichU
rlWithSafeSearchInfo(n)),n},i.prototype.createFocusHelper=function(n,t){var
i=this.getSearchAppWinJSXYFocus(n);return!
i&&SearchAppWinJS&&SearchAppWinJS.initXYFocus&&(SearchAppWinJS.initXYFocus(n),i=thi
s.getSearchAppWinJSXYFocus(n),n[g]=i?!0:!1),i?new
o(t,n,i,this._scrollArea,this._currentVertical):null},i.prototype.getSearchAppWinJS
XYFocus=function(n){var i,t=n[nt];return
t&&t.UI&&(i=t.UI.XYFocus),i},i.prototype.tryExecuteFocusOnMiniSerp=function(n){var
t=!1;return this._focusHelper&&(t=n()),t||this._footer&&(this._footer.focus(),t=!
0),t},i}(),o;t.MiniSerpViewModel=lt;o=function(){function n(n,i,r,u,f,e){var
o=this;this._targetDocument=n;this._targetWindow=i;this._searchAppXYFocus=r;this._s
crollArea=u;this._verticalType=f;this._useStickyFocusOverride=e;this._isL2Visible=!
1;this._useStickyFocus=!
1;_w.ClientTestHooks&&ClientTestHooks.isTesthookParamSet("stickyFocus")===!
0&&(this._useStickyFocus=!0);this._useStickyFocusOverride!
=null&&(this._useStickyFocus=this._useStickyFocusOverride);var s="b_hide",h="acc-
inactive",c=".b_slidebar";this._focusDiv=sj_ce("div",y,s);n.body.appendChild(this._
focusDiv);sj_be(n,"blur",function(n){o._useStickyFocus?(!
n.srcElement.offsetParent||n.srcElement.classList.contains("b_hide")||
n.relatedTarget)&&t.setVisibility(o._focusDiv,!1):t.setVisibility(o._focusDiv,!
1)},!0);sj_be(n,"focus",function(){return
o.updateFocusedElementAndOutline(o._targetDocument.activeElement)},!
0);sj_be(n,"scroll",function(n)
{o._lastElementFocused&&(n.srcElement==o._lastElementFocused||
o._lastElementFocused.compareDocumentPosition(n.srcElement)&Node.DOCUMENT_POSITION_
CONTAINS)&&o.updateFocusedElementAndOutline(o._lastElementFocused)},!
0);sj_be(n,"transitionend",function(n){var t=o._targetDocument.activeElement;
(n.propertyName=="height"||n.srcElement==t.closest(c))&&(o._focusOutlineTimeout?
(o.clearFocusOutlineTimeout(),o.outlineElementAndScrollIntoView(t)):o._focusDiv.cla
ssList.contains(s)||
o.outlineElementAndScrollIntoView(t),n.srcElement.style.height=="0px"?
n.srcElement.classList.add(h):n.srcElement.classList.remove(h))});this._searchAppXY
Focus.keyCodeMap.home.push(36);this._searchAppXYFocus.keyCodeMap.end.push(35)}retur
n
n.prototype.getXYFocusRoot=function(){return
this._searchAppXYFocus.focusRoot},n.prototype.isL2Visible=function(){return
this._isL2Visible},n.prototype.setIsL2Visible=function(n)
{this._isL2Visible=n},n.prototype.setXYFocusRoot=function(n)
{this._searchAppXYFocus.focusRoot=n},n.prototype.moveFocus=function(n,t){return
this._searchAppXYFocus._xyFocus(n,t)},n.prototype.moveFocusToEdgeFocusableElement=f
unction(n,t){var i,h;if(t===void 0&&(t=!
1),this._targetWindow.focus(),t&&n==0)i=this.focusFirstSerpElement();else{var
f=void 0,e=void 0,r=void
0,o=this._targetWindow.innerWidth,s=this._targetWindow.innerHeight;n==0?(f=-
1,e=0,r=40):n==1&&(f=s,e=s+1,r=38);h={top:f,bottom:e,right:o,left:0,height:1,width:
o};i=this._searchAppXYFocus._xyFocus(u[r],r,h)}return
i&&(this.scrollTo(n),this.updateFocusedElementAndOutline(this._targetDocument.activ
eElement)),i},n.prototype.onSearchBoxFocusChanged=function()
{this._targetDocument.hasFocus()?
this.updateFocusedElementAndOutline(this._targetDocument.activeElement):this._useSt
ickyFocus||t.setVisibility(this._focusDiv,!1)},n.prototype.isVisible=function(n)
{var t=_w.getComputedStyle(n);return!(t.visibility=="hidden"||t.display=="none"||
n.offsetWidth===0&&n.offsetHeight===0)},n.prototype.moveFocusToLastFocusedElement=f
unction(){return
this._lastElementFocused&&this.isVisible(this._lastElementFocused)?
(this._lastElementFocused.focus(),this.updateFocusedElementAndOutline(this._lastEle
mentFocused),!0):this.moveFocusToEdgeFocusableElement(0,!
0)},n.prototype.updateFocusedElementAndOutline=function(n){var i=this,r;n&&n!
=this._targetDocument.body&&(this.processFocusedElement(n),r=this._lastElementFocus
ed&&n.elementType&&n.elementType==this._lastElementFocused.elementType&&n.parentEle
ment==this._lastElementFocused.parentElement?d:0,r?
(t.setVisibility(this._focusDiv,!1),this._focusOutlineTimeout=sb_st(function()
{i._targetDocument.activeElement==n&&i.outlineElementAndScrollIntoView(n);i.clearFo
cusOutlineTimeout()},r)):this.outlineElementAndScrollIntoView(n),this._lastElementF
ocused=n)},n.prototype.outlineElementAndScrollIntoView=function(n){var u,o,s;if(n!
=this._targetDocument.body&&(this._useStickyFocus||
this._targetDocument.hasFocus())){var
i=n.getBoundingClientRect(),y=this._targetDocument.documentElement.scrollWidth-
r*2,p=this._targetDocument.documentElement.scrollHeight-
r*2,h=i.top+this._targetWindow.pageYOffset,e=i.left+this._targetWindow.pageXOffset,
w=y-e,b=p-h,c=e<0?Math.floor(i.width+e-r):i.width;if(c<=0)
{t.setVisibility(this._focusDiv,!
1);return}if(u=i.height,u<=0&&n.children.length>0)for(o=0;o<n.children.length;o+
+)s=n.children[o].getBoundingClientRect(),s.height>u&&(u=s.height,h=s.top);this._fo
cusDiv.style.top=Math.max(r,h)
+"px";this._focusDiv.style.left=Math.max(this.isL2Visible?r:r*4,e)
+"px";this._focusDiv.style.width=Math.min(w,c)
+"px";this._focusDiv.style.height=Math.min(b,u)
+"px";t.setVisibility(this._focusDiv,!0);var
l=n.getBoundingClientRect(),a=this._scrollArea.offsetHeight+this._scrollArea.scroll
Top-l.bottom-f,v=l.top-this._scrollArea.scrollTop-f;a<0?
this._scrollArea.scrollTop+=f-a:v<0&&(this._scrollArea.scrollTop+=v-
f)}},n.prototype.scrollTo=function(n){var
t=0;n==1&&(t=this._scrollArea.scrollHeight);this._scrollArea.scrollTop=t},n.prototy
pe.processFocusedElement=function(n){var r=this,u,e,o,c,f,s,h;n.isProcessed||
(u=n.tagName.toLocaleLowerCase(),e=n.getAttribute("type"),u=="select"&&(sj_be(n,"ke
ydown",function(t){t.keyCode==32?
n.classList.add(i):t.keyCode==13&&n.classList.remove(i)},!
0),this.reactivateXYFocusOnBlur(n)),u=="input"&&e=="range"&&(sj_be(n,"keydown",func
tion(t){var
r=t.target,f=+r.getAttribute("min"),e=+r.getAttribute("step"),u=t.keyCode==37,o=t.k
eyCode==39,s=+r.value-e<f&&u;t.keyCode==38||t.keyCode==40||s?n.classList.remove(i):
(u||o)&&n.classList.add(i)},!0),this.reactivateXYFocusOnBlur(n)),o=function(t,r)
{var u;if(!r.readOnly){if(u=r.selectionStart!=r.selectionEnd,u)
{n.classList.add(i);return}var
f=r.selectionEnd==0,e=r.selectionEnd==r.value.length,o=t.keyCode==36&&!
f,s=t.keyCode==35&&!e,h=t.keyCode==37&&!f,c=t.keyCode==39&&!e;h||c||o||s?
n.classList.add(i):n.classList.remove(i)}},u=="textarea"&&(sj_be(n,"keydown",functi
on(n){return o(n,n.target)},!
0),this.reactivateXYFocusOnBlur(n)),u=="input"&&(e=="number"||
e=="text")&&(sj_be(n,"keydown",function(n){return o(n,n.target)},!
0),this.reactivateXYFocusOnBlur(n)),w.some(function(t){return
n.classList.contains(t)})?
(n.elementType="slide",c=Array.prototype.slice.call(n.querySelectorAll("a:not([oncl
ick='TestHooks.HideShowTestHooks(this);']):not([disabled])"),0),f=c.filter(function
(n){return
r.isVisible(n)&&n.offsetHeight>0&&n.offsetWidth>0}),f&&sj_be(n,"keydown",function(t
){var i=r.countUniqueHrefs(f),u=t.keyCode;t.srcElement==n&&(i>1&&u==40?
(t.preventDefault(),r._searchAppXYFocus.focusRoot=n,f[0].focus()):i==1&&u==13&&f[0]
.click())})):b.some(function(t){return n.hasAttribute(t)})?
(n.elementType="expansion",s=function(){t.setVisibility(r._focusDiv,!
1);r.updateFocusedElementAndOutline(r._targetDocument.activeElement)},sj_be(n,"keyu
p",function(n){n.keyCode==13&&s()},!0),sj_be(n,"click",function()
{s()})):n.classList.contains(k)&&(h=function(){var
t=r._targetDocument.getElementById("vidPreStopButton"),i,u;t&&t.focus();i=function(
){n.focus()};sj_be(t,"click",i);sj_be(t,"keydown",function(n)
{n=sj_ev(n);n.keyCode===13&&i()});u=r._targetDocument.getElementsByTagName("video")
[0];sj_be(u,"ended",i)},sj_be(n,"keydown",function(n){n.keyCode==13&&h()},!
0),sj_be(n,"click",function(){h()})),n.classList.add(p),n.isProcessed=!
0)},n.prototype.countUniqueHrefs=function(n){var
r={},t,i;if(n)for(t=0;t<n.length;t++)i=n[t],i&&(r[i.href]=!0);return
Object.keys(r).length},n.prototype.reactivateXYFocusOnBlur=function(n)
{sj_be(n,"blur",function()
{n.classList.remove(i)})},n.prototype.focusFirstSerpElement=function(){var
n,i,t,r;switch(this._verticalType){case
1:n=this._targetDocument.getElementById("b_content");break;case
2:n=this._targetDocument.getElementById("images");break;case
3:n=this._targetDocument.getElementById("video");break;default:throw Error("Unknown
vertical type
"+this._verticalType);}if(n)for(i=n.querySelectorAll('a:not([onclick=\'TestHooks.Hi
deShowTestHooks(this);\']):not([disabled]):not([tabindex="-1"]),
button:not([disabled]), input[type=text]:not([disabled]), textarea:not([disabled]),
select:not([disabled]):not(#tta_sl), [tabindex]:not([disabled]):not([tabindex="-
1"])'),t=0;t<i.length;t++)if(r=i[t],this.isVisible(r))return r.focus(),!0;return!
1},n.prototype.clearFocusOutlineTimeout=function()
{sb_ct(this._focusOutlineTimeout);this._focusOutlineTimeout=null},n}
();t.WSBMiniSerpFocusHelper=o})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function i(n){switch(n)
{case"arrowRight":case"button":return!
1;case"autoContent":case"keepOpen":case"alwaysWide":case"arrowUpOrDown":return!
0}throw new Error("Unknown open type: "+n);}var r=function(){function r(i,r,u,f,e)
{var
o=this;this._page=i;this._host=r;this._instrumentationHelper=f;this._sequenceNumber
Manager=e;this._previewPaneId=1;this._beforeItemLaunchEventHandlers=[];this._afterI
temLaunchEventHandlers=[];this._scrollArea=_ge("qfPreviewScrollArea");this._loading
Screen=_ge("loadingScreen");var s=function(n,t,i,r)
{o._clickLoggedForCurrentPreviewPane||
o._beforeItemLaunchEventHandlers.forEach(function(u){return
u(n,o._previewedSuggestion,t,i,r)})},h=function(n)
{o._clickLoggedForCurrentPreviewPane||
(o._afterItemLaunchEventHandlers.forEach(function(t){return
t(o._previewedSuggestion,o._queryForPreviewedSuggestion,n)}),o._clickLoggedForCurre
ntPreviewPane=!0)},c=function(n)
{o._previewPaneResponseReceivedTimeStamp=n;o.resetLoadingScreen()};this._previewPan
eViewModelParent={focusPending:!
1,onBeforeItemLaunch:s,onAfterItemLaunch:h,startLoadingScreen:function(){return
o.startLoadingScreen()},onResponseReceived:c};t.WSBLocalPreviewPaneViewModel&&(this
._localPreviewPaneViewModel=new
t.WSBLocalPreviewPaneViewModel(i,r,f,e,this._previewPaneViewModelParent));this._min
iSerpViewModel=new
t.MiniSerpViewModel(r,u,f,e,this._previewPaneViewModelParent);r.bindKeyDown(functio
n(t,i){o._previewPaneViewModelParent.focusPending=!1;o.hasFocus()&&(t==27||
t==115&&i.altKey)&&n.safeExecute(function(){return
SearchAppWrapper.CortanaApp.dismissApp()},"dismissApp")});r.bindSearchBoxGotFocus(f
unction(){return o._previewPaneViewModelParent.focusPending=!
1});SearchAppWrapper.CortanaApp.addEventListener("resettingtodefaultsize",function(
){return o.dismiss()});r.bindQueryChangedOrInitialized(function(n){return
o._currentQuery=n},!0)}return r.prototype.init=function(n)
{this._selectionHandler=n},r.prototype.getSelectableItems=function(){return
this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.getSelectableItems():
[]},r.prototype.getSelectedItem=function(){return this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.getSelectedItem():null},r.prototype.select=functio
n(n,t)
{this._activePreviewPaneViewModel&&this._activePreviewPaneViewModel.select(n,t)},r.
prototype.onAfterKeyDown=function(n,t,i)
{if(this._activePreviewPaneViewModel)this._activePreviewPaneViewModel.onAfterKeyDow
n(n,t,i)},r.prototype.getPreviewedSuggestionToForceTopHit=function(){return
this._forceTopHitForPreviewedSuggestion&&!this._closeTimer?
this._previewedSuggestion:null},r.prototype.showPreview=function(n,r,u,f,e)
{if(u===void 0&&(u="button"),f===void 0&&(f=!1),e===void
0&&(e=0),this._previewPaneOpenedForThisQuery=!
0,this.clearOpenTimer(),this.clearCloseTimer(),r!=this._previewedSuggestion||f)
{t.alwaysWide||this._page.setPreviewPaneVisibility(!0);var
o={ppId:""+this._previewPaneId,openType:u,suggestion:r.instItem.getLayoutKValue()};
e&&(o.openDelay=""+e);this._instrumentationHelper.logClientInstEvent("Select","Prev
iewPaneOpened",this._sequenceNumberManager.getSequenceNumber(),o);this.setPreviewPa
neContent(n,r,i(u),this._previewPaneId)}u!
="button"&&this._selectionHandler.updateSelectionState(r)},r.prototype.dismiss=func
tion(){this.close(!0)},r.prototype.startLoadingScreen=function(){t.setVisibility(t
his._scrollArea,!1);t.setVisibility(this._loadingScreen,!
0)},r.prototype.resetLoadingScreen=function(){t.setVisibility(this._loadingScreen,!
1);t.setVisibility(this._scrollArea,!0)},r.prototype.close=function(i){var
u=this,r;this.clearOpenTimer();r=i?0:t.config.closePreviewPaneDelay;r?
this._closeTimer||(this._closeTimer=sb_st(function()
{u._closeTimer=null;n.safeExecute(function(){return
u.innerClose(i)},"ppCloseTimer")},r)):
(this.clearCloseTimer(),this.innerClose(i))},r.prototype.innerClose=function(i){var
r,u;this._previewedSuggestion&&(r=!0,i&&(this._clickLoggedForCurrentPreviewPane?r=!
1:this._previewPaneResponseReceivedTimeStamp&&n.getCurrentTime()>this._previewPaneR
esponseReceivedTimeStamp+1e3&&(r=!1)),r&&(u=i?
{fromQFDismiss:"1"}:undefined,this._instrumentationHelper.logClientInstEvent("Unsel
ect","PreviewPaneClosed",this._sequenceNumberManager.getSequenceNumber(),u)),t.alwa
ysWide||i||this._page.setPreviewPaneVisibility(!
1),this.resetLoadingScreen(),this.clear())},r.prototype.clear=function()
{this._previewedSuggestion&&(this._previewedSuggestion.hasPreviewPaneOpened=!
1,this._selectionHandler.updateSelectionState(this._previewedSuggestion),this._prev
iewedSuggestion=null,this._queryForPreviewedSuggestion=null,this._previewPaneRespon
seReceivedTimeStamp=null,this._forceTopHitForPreviewedSuggestion=!
1,this._clickLoggedForCurrentPreviewPane=!
1,this._activePreviewPaneViewModel.clear(),this._activePreviewPaneViewModel=null,th
is._previewPaneViewModelParent.focusPending=!
1)},r.prototype.onQueryChanged=function(n){var
i,r;if((this._previewPaneOpenedForThisQuery=!
1,i=this._queryForPendingPreviewedSuggestion||
this._queryForPreviewedSuggestion,this._queryIsContinuationOfPreviousQuery=i&&n.que
ryToFetch.toLocaleLowerCase().startsWith(i.queryToFetch.toLocaleLowerCase()),i&&n.q
ueryToFetch.toLocaleLowerCase()!
=i.queryToFetch.toLocaleLowerCase())&&(r=this._pendingPreviewedSuggestion&&this._pe
ndingPreviewedSuggestion.updateFromQuery?
this._pendingPreviewedSuggestion:this._previewedSuggestion&&!
this._closeTimer&&this._previewedSuggestion.updateFromQuery?
this._previewedSuggestion:null,r)){if(t.alwaysWide)
{this.autoOpen(n,r,"alwaysWide",!
0);return}this._queryIsContinuationOfPreviousQuery?
(this._forceTopHitForPreviewedSuggestion=!1,this.autoOpen(n,r,"keepOpen",!
0)):this.close(!1)}},r.prototype.clearOpenTimer=function()
{this._openTimer&&(sb_ct(this._openTimer),this._openTimer=null,this._pendingPreview
edSuggestion=null,this._queryForPendingPreviewedSuggestion=null,this.resetLoadingSc
reen())},r.prototype.clearCloseTimer=function()
{this._closeTimer&&(sb_ct(this._closeTimer),this._closeTimer=null)},r.prototype.onT
opHitUpdated=function(i,r,u,f){if(u){if(!this._closeTimer)
{if(this._openTimer&&this._pendingPreviewedSuggestion!
=u&&this.clearOpenTimer(),this._pendingPreviewedSuggestion&&t.isEquivalentForPrevie
wPanePurposes(i,this._pendingPreviewedSuggestion,u))
{this._pendingPreviewedSuggestion=u;this._queryForPendingPreviewedSuggestion=i;u.ha
sPreviewPaneOpened=!
0;return}if(this._previewedSuggestion&&t.isEquivalentForPreviewPanePurposes(i,this.
_previewedSuggestion,u)){n.contains(f,r)||
(this._previewedSuggestion=u,this._queryForPreviewedSuggestion=i,u.hasPreviewPaneOp
ened=!
0,this.refreshLocalContent(i,u));return}}if(this._forceTopHitForPreviewedSuggestion
=!1,t.supportsPreview(u)!=0){if(t.alwaysWide){this.autoOpen(i,u,"alwaysWide",!
1);return}if(u==f[0]&&!this._previewPaneOpenedForThisQuery)
{if(u.autoOpenPreviewPaneWhenOnTopHit){this.autoOpen(i,u,"autoContent",!
1);return}if(this._previewedSuggestion&&this._queryIsContinuationOfPreviousQuery)
{this.autoOpen(i,u,"keepOpen",!
1);return}}}}this._openTimer&&this.clearOpenTimer();this._previewedSuggestion&&this
.close(!1)},r.prototype.getDelayForMiniSerp=function(n,i){switch(n)
{case"keepOpen":case"alwaysWide":return t.alwaysWide?i.isAnswer?
0:t.config.autoOpenMiniSerpDelay:t.config.keepMiniSerpOpenDelay;case"arrowUpOrDown"
:return t.config.openOnKeybNavMiniSerpDelay}return
0},r.prototype.autoOpen=function(i,r,u,f){var e=this,s=t.supportsPreview(r)==1,o=s?
this.getDelayForMiniSerp(u,r):0;o?
(this.clearOpenTimer(),this.clearCloseTimer(),this._pendingPreviewedSuggestion=r,th
is._queryForPendingPreviewedSuggestion=i,this._openTimer=sb_st(function()
{e._openTimer=null;r=e._pendingPreviewedSuggestion;e._pendingPreviewedSuggestion=nu
ll;e._queryForPendingPreviewedSuggestion=null;n.safeExecute(function(){return
e.showPreview(i,r,u,f,o)},"ppOpenTimer")},o),s&&this.startLoadingScreen()):this.sho
wPreview(i,r,u,f)},r.prototype.onAfterKeyDownWhenSuggestionSelected=function(n,i,r)
{t.alwaysWide&&t.config.openOnKeybNavMiniSerp&&(n==40||
n==38)&&t.supportsPreview(r)!=0?this._previewedSuggestion!
=r&&this.autoOpen(i,r,"arrowUpOrDown",!
1):n==t.getRtlAdjustedKey(39)&&this._currentQuery.originalCursorPosition==this._cur
rentQuery.originalQuery.length&&t.supportsPreview(r)!
=0&&this._host.searchBoxHasFocus()?((this._previewedSuggestion!=r||
this._closeTimer)&&this.showPreview(i,r,"arrowRight"),this._activePreviewPaneViewMo
del.focus(),this._forceTopHitForPreviewedSuggestion=!
0):n==t.getRtlAdjustedKey(37)&&this._activePreviewPaneViewModel&&this._activePrevie
wPaneViewModel.hasFocus()&&this._host.setFocusInSearchBox("previewPaneUnfocus")},r.
prototype.refreshLocalContent=function(n,i)
{t.supportsPreview(i)==2&&this._localPreviewPaneViewModel.update(i,n,!0,undefined,!
0)},r.prototype.setPreviewPaneContent=function(n,i,r)
{this.clear();this._previewedSuggestion=i;this._previewedSuggestion.hasPreviewPaneO
pened=!
0;this._previewPaneResponseReceivedTimeStamp=null;this._queryForPreviewedSuggestion
=n;t.supportsPreview(i)==2?
(this._activePreviewPaneViewModel=this._localPreviewPaneViewModel,this._localPrevie
wPaneViewModel.update(i,n,r,this._previewPaneId++)):
(this.startLoadingScreen(),this._activePreviewPaneViewModel=this._miniSerpViewModel
,this._miniSerpViewModel.update(i,n,r,this._previewPaneId+
+))},r.prototype.bindBeforeItemLaunch=function(n)
{this._beforeItemLaunchEventHandlers.push(n)},r.prototype.bindAfterItemLaunch=funct
ion(n){this._afterItemLaunchEventHandlers.push(n)},r.prototype.hasFocus=function()
{return this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.hasFocus():!1},r}();t.PreviewPane=r})(t=n.WSB||
(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var
i=SearchAppWrapper.CortanaApp,e=21600,o="/account/permissions/sso?",u="/agents/oaut
h?",r="Office365",f="Outlook",s="0a0a29f9-0a25-49c7-94bf-
c53c3f8fa69d",h="6df4d00742ec458795c9588001737872-fbbe95f5-f25d-4197-9d6f-
7c3eb54c745f-6908",c=function(){function c(i){var r=this;this._triggerSSO=!
0;t.WebTelemetry&&t.WebTelemetry.init(h);sj_be(_w,"load",function()
{r.launchSSO()});t.config.enablePeriodicalSSO&&(c._latestSSOTimestamp||
(c._latestSSOTimestamp=n.getCurrentTime()),i.bindAppHidden(function()
{r.launchPeriodicalSSO()}))}return c.prototype.launchPeriodicalSSO=function(){var
t=(n.getCurrentTime()-c._latestSSOTimestamp)/1e3;t>=e&&(this._triggerSSO=!
0,this.launchSSO(),c._latestSSOTimestamp=n.getCurrentTime())},c.prototype.launchSSO
=function(){var u=this,e=function(){var e=i.isCortanaEnabled?
n.safeExecute(function(){return
i.getCortanaCapabilities()},"getCortanaCapabilities","").split(","):
[],o=n.contains(e,"Personalization");i.currentState==0&&u._triggerSSO&&o&&(u._trigg
erSSO=!1,t.config.wamSupported?
t.Promise.safeChain("enumerateAccountAuthorityAsync",function(){return
i.authenticationManager.enumerateAccountAuthorityAsync()},function(n){var
i=n.Windows,e=n.Cortana;t.WebTelemetry&&t.WebTelemetry.logSignInAccountEvent(i,e);i
=="organizations"?
u.silentSignIn(r):i=="consumers"&&e=="consumers"&&u.silentSignIn(f)}):t.Promise.saf
eChain("getQueryHeadersAsync",function(){return
i.getQueryHeadersAsync()},function(n){n&&(u.silentSignIn(r),n["X-Search-
RPSToken"]&&u.silentSignIn(f))}))};n.isBrowserOnline()?
e():sj_be(_w,"online",function(){e()})},c.prototype.silentSignIn=function(f){var
c=this,e=o+"campaign_source=WSB&provider="+f,h;t.config.th&&(e=ClientTestHooks.Copy
TestParameters(_w.location.search,e));h=function(e){var
h,o;t.WebTelemetry&&t.WebTelemetry.logShouldSSOEvent(f,e?!0:!1);e&&(h=function(n)
{var i=n&&!
n.IsError;t.WebTelemetry&&t.WebTelemetry.logAuthCompleteEvent(f,f==r&&t.config.wamS
upported?"assertion":"code",i)},n.isBrowserOnline()&&i.currentState==0&&(t.config.w
amSupported&&f==r?
(o=i.authenticationManager.createAuthenticateRequest(),o.accountType="Windows",o.re
source=s,t.Promise.safeChain("authenticateAsyncOBO",function(){return
i.authenticationManager.authenticateAsync(o)},function(i){var
r=i&&i.token,e,o;t.WebTelemetry&&(e=r?0..toString():i&&i.status!=0?
i.status.toString():"-
1",t.WebTelemetry.logClientAuthEvent(f,"WAM",e));r&&(o=u+"provider="+f+"&campaign_s
ource=WSB&assertion="+i.token,n.fetchUrlJson(o,
{},null,h))})):c.refreshOAuthToken(f,e.AuthUrl,e.CallbackUrl,e.Options||
1,h)))};n.fetchUrlJson(e,
{},null,h)},c.prototype.refreshOAuthToken=function(r,f,e,o,s)
{t.Promise.safeChain("authenticateAsyncSSO",function(){return
i.authenticateAsync(o,f,e)},function(i)
{if(t.WebTelemetry&&t.WebTelemetry.logClientAuthEvent(r,"WAB",i?0..toString():"-
1"),i){var f=i.split("?")[1],e=u+f;n.fetchUrlJson(e,{},null,s)}})},c}
();t.ProactiveSSO=c})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}));__extends=this&&this.__extends||function(){var
n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var
i=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return
__extends(r,i),r.prototype.fetchUrl=function(i,r,u,f,e,o){var
h=this,s;if(n.isBrowserOnline()){var v=u?
1:0,c=SearchAppWrapper.CortanaApp,l=c.createStringMap(),a=c.createStringMap();if(r)
for(s in r)s.toLowerCase().startsWith("content")?
a[s]=r[s]:l[s]=r[s];t.Promise.safeChain("makeHttpRequestAsync",function(){return
c.makeHttpRequestAsync(v,i,l,u,a)},function(i){o()&&(i.statusCode===200?
t.Promise.safeChain("readResponse",function(){return
i.readAsStringAsync()},function(i){if(o()){t.config.th&&i&&(i=i.replace(new
RegExp("<!--[^]*?-->","gm"),""));var r=i?n.safeExecute(function(){return
JSON.parse(i)},"parseCortanaHttpResponse",null,null):null;r!=null?
f(h._dataSource,r,null):f(h._dataSource,null,null)}},function(){return
f(h._dataSource,null,null)},e):f(h._dataSource,null,i.statusCode.toString()))},func
tion(){return f(h._dataSource,null,null)},e)}else
f(this._dataSource,null,null,null,!0)},r}
(n.JsonDataProvider);t.CortanaJsonDataProvider=i})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={}));__extends=this&&this.__extends||function(){var
n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var
f="NT",r="https://substrate.office.com{0}/api/v1/",p=r+"events",w=r+"init",b=r+"sug
gestions?
query=",k=r+"query",d=r+"recommendations",h="SubstrateSearchService",g="https://out
look.office365.com/autodiscover/autodiscover.json/v1.0/{0}?
Protocol={1}",u="AutoDiscoveryKey",c="3sflights",nt="3sdebug",e="gwsflt.",tt="textd
ecorations",l="scenario",it="setflight",rt="debug",a="entitytypes",ut="1",ft="scope
s",et="people.directorysearch",ot="Authorization",o="Content-Type",st="X-
AnchorMailbox",ht="X-Client-Language",ct="X-Client-LocalTime",v="Client-Request-
Id",lt="User-Agent",at="X-Debug-ExternalExp",vt="X-Client-
Flights",s="application/json",yt=6e4,i,y=!1,pt=function(r){function pt(f,o,s,h,l,a)
{var v=r.call(this,pt.getDataSource(h,l))||this,b,k,d,p;return
v._host=f,v._accessTokenManager=o,v._instrumentationHelper=s,v._authType=h,v._provi
derType=l,v._storage=a,v._autoDiscoveryData={stem:"/search",timestamp:-1},y||(y=!
0,k=function(n){return n.split(",").filter(function(n){return
n.toLocaleLowerCase().startsWith(e)}).map(function(n){return
n.substr(e.length)}).join(",")},t.config.th&&(i=k(ClientTestHooks.getUrlValue(c,"")
)),ThresholdUtilities.getCortanaHeaders(function(n){var t,r;n&&(t=n["X-BM-
ClientFeatures"],t&&(r=k(t),r&&(i=(i?i+",":"")
+r)))})),t.config.th&&ClientTestHooks.isTesthookParamSet("clearAutoDCache")&&v._sto
rage.removeItem(u),d=v._storage.getItem(u),d&&(p=n.safeExecute(function(){return
JSON.parse(d)},"parseAutoDiscovery",null),p&&!p.errorState?
v._autoDiscoveryData=p:v._storage.removeItem(u)),v._host.bindAccessTokenAvailable(f
unction(t){var r,f,i;if(t==v._authType){if(v._providerType==0)
{if(r=n.getCurrentTime(),b&&(f=r-b,f<yt))return;b=r;v.fetchUrl(w,null,"",function()
{},null,function(){return!0})}i=n.getCurrentDate();i.setDate(i.getDate()-
1);v._autoDiscoveryData.timestamp<i.getTime()&&v.getStem()(t,function(t)
{t.timestamp=n.getCurrentTime();v._autoDiscoveryData=t;t.errorState||
v._storage.setItem(u,JSON.stringify(t))})}}),v}return
__extends(pt,r),pt.prototype.getName=function(){return"SubstrateDataProvider
"+this._dataSource},pt.prototype.createUrl=function(i)
{if(this._providerType==1)return i.queryToFetch?
this.getBaseUrl():d;if(i.scope==t.Scope.Documents){var
u=t.getEffectiveQuery(i);if(u!=i.queryToFetch)return this.getBaseUrl()
+n.encodeQueryParameter(u.toLocaleLowerCase())}return
r.prototype.createUrl.call(this,i)},pt.prototype.getBaseUrl=function(){return
this._providerType==1?k:b},pt.getDataSource=function(n,t){return t==0?
n==1?"SSUE":"SSUC":n==1?"SSEE":"SSEC"},pt.prototype.getPostBody=function(n){var
i,u,f,r;if(this._providerType==1){i=void 0;u=t.getEffectiveScope(n);switch(u){case
t.Scope.Emails:f=[{Score:
{SortDirection:"Desc",Count:t.config.maxNumberOfEmailsInTopResult}},{Time:
{SortDirection:"Desc"}}];i=this.buildPostBodyForQueryEndpoint(n,"Message",
["Exchange"],f);break;case t.Scope.Documents:if(r=void 0,n.queryToFetch)
{switch(t.config.queryProvenances){case 0:r=["SharePoint"];break;case
1:r=["OneDriveBusiness"];break;case
2:r=["SharePoint","OneDriveBusiness"];break;default:throw new Error("Unexpected
query provenances:
"+t.config.queryProvenances);}i=this.buildPostBodyForQueryEndpoint(n,"Documents",r,
[{Score:"Desc"}])}else
i=this.buildPostBody("Document","OpenFile");break;default:throw new
Error("Unsupported scope "+n.scope);}return
JSON.stringify(i)}return""},pt.prototype.buildPostBodyForQueryEndpoint=function(n,t
,i,r){return
this.buildPostBody(t,"WindowsSearchBoxL2",n.queryToFetch,i,r,"ProvenanceOptimized",
"Forward")},pt.prototype.buildPostBody=function(n,t,i,r,u,f,e)
{return{EntityRequests:[{Query:i?
{QueryString:i}:undefined,EntityType:n,Provenances:r,Sort:u,PropertySet:f}],Cvid:th
is._host.getConversationId(),TextDecorations:e,Scenario:
{Name:t}}},pt.prototype.getStem=function(){var i=this;return
t.Promise.safeChainWithGlobalCaching("getStem",function(u){return
ThresholdUtilities.createPromise(function(e)
{i._accessTokenManager.getAccount(u,t.getSubstrateResourceOrScope(u),!1,!
0,function(t){var c,u,l;t&&t.UserName?(c=n.formatString(g,
[t.UserName,h]),u={},u[o]=s,u[v]=i._host.getConversationId(),l=function(t,i,r){var
u,f,o;if(r){e({stem:"",errorState:r});return}if(u=i,!u){e({stem:""});return}if(!
u.Url){e({stem:"",errorState:"NAU"});return}if(u.Protocol!=h)
{e({stem:"",errorState:"NAP"});return}if(f=n.tryParseUrl(u.Url,!0),o=f?
f.path:null,!o)
{e({stem:"",errorState:"NAS"});return}e({stem:o})},r.prototype.fetchUrl.call(i,c,u,
"",l,null,function(){return!
0})):e({stem:"",errorState:f})},t.getAuthAccountForCloudContent())})},function()
{return"autoDiscovery"})},pt.prototype.fetchUrl=function(i,u,e,o,s,h){var
c=this,l;if(!this._autoDiscoveryData.stem)
{o(this._dataSource,null,this._autoDiscoveryData.errorState,null,!
0);return}i=n.formatString(i,[this._autoDiscoveryData.stem]);u||
(u={});l=function(n){if(n){var l=n.Token;l?(u[ot]="Bearer "+l,c._authType==1&&!
t.SubstrateTenantName&&n.TenantName&&(t.SubstrateTenantName=n.TenantName),u[st]=n.R
outingHint,r.prototype.fetchUrl.call(c,i,u,e,o,s,h)):o(c._dataSource,null,f)}else
o(c._dataSource,null,f)};this._accessTokenManager.getAccount(this._authType,t.getSu
bstrateResourceOrScope(this._authType),!1,!
0,l,t.getAuthAccountForCloudContent())},pt.prototype.fetch=function(u,f,e,h,c,l)
{var p=this,y,w,b;if(n.isDataSourceEnabled(this._dataSource,u))
{if(y={},y[ht]=t.uiLanguageCache,y[ct]=n.getDateWithTimezone(),y[lt]=navigator.user
Agent,typeof _CachedFlights!
="undefined"&&_CachedFlights.sort&&(y[at]=_CachedFlights.sort().join(",")),y[v]=thi
s._instrumentationHelper.getImpressionGuid(e),w=this.buildParams(l,u.scope),this._p
roviderType==0){if(!w[a])return}else y[o]=s;i&&(y[vt]=i);b=function(n,i,r){var
u=parseInt(r);(u==403||u==401)&&sb_st(function(){return
p._accessTokenManager.getAccount(p._authType,t.getSubstrateResourceOrScope(p._authT
ype),!0,!0,function()
{},t.getAuthAccountForCloudContent())},0);f(n,i,r)};r.prototype.fetch.call(this,u,b
,e,h,c,w,y)}},pt.prototype.buildParams=function(i,r){var u={},f;return
this._providerType==0&&(u[n.Service.QueryParams.ConversationId]=i[n.Service.QueryPa
rams.ConversationId],u[tt]=ut,t.config.peopleSearchEntireDirectoryInL2&&r==t.Scope.
People&&this._authType==1?u[l]=et:r!
=t.Scope.All&&(u[l]=ft),u[a]=this.getEntityTypes(r)),t.config.th&&(f=ClientTestHook
s.getUrlValue(c,"").split(",").filter(function(n){return!
n.toLocaleLowerCase().startsWith(e)}).join(","),f&&(u[it]=f),ClientTestHooks.isTest
hookParamSet(nt)&&(u[rt]="1")),u},pt.prototype.getEntityTypes=function(n){var
i,r;switch(n){case t.Scope.Documents:i="Documents";break;case
t.Scope.People:i="People";break;case
t.Scope.All:r=[];this._authType==1&&r.push("Documents");(this._authType==1||
t.qfMode!=3)&&r.push("People");i=r.join(",");break;default:throw new
Error("Unsupported scope "+n);}return i},pt.prototype.instrumentClick=function(t,i)
{if(t&&i){var u=[{Key:t,Value:[{Name:"entityclicked",Attributes:
[{Key:"id",Value:i},
{Key:"localtime",Value:n.getDateWithTimezone()}]}]}],r={};r[o]=s;this.fetchUrl(p,r,
JSON.stringify(u),function(){},null,function(){return!0})}},pt}
(t.CortanaJsonDataProvider);t.SubstrateDataProvider=pt})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function v(n,i,r)
{var u=t.OfficeTypeExtensionConfigs[n];u?
t.LocalDataProvider.getApps(u.appIds,function(n){var f=!t.Map.isEmpty(n);f?
i(u.uri):r()}):r()}function y(n,t,i){v(t,function(t){return
i.launchUrl(t+n)},function(){return i.launchUrl(n+"?web=1")})}function p(n,i,r,u,f)
{t.setExtraVerbs(n,function(){var t=[];return
t.push({verb:"OpenInBrowser",displayName:f.getLocString("OpenInBrowser"),executeSyn
c:function(){return f.launchUrl(r)},icon:
{type:1,content:"&#xE774"}}),n.locationUrl&&t.push({verb:"OpenFileLocationInBrowser
",displayName:f.getLocString("OpenFileLocationIn",u),executeSync:function(){return
f.launchUrl(n.locationUrl)},icon:
{type:2,content:"&#xE838"}}),n.url&&SearchAppWrapper.CortanaApp.copyToClipboard&&t.
push({verb:"CopyFullPath",displayName:f.getLocString("CopyFullPath"),executeSync:fu
nction(){return SearchAppWrapper.CortanaApp.copyToClipboard(n.url,"")},icon:
{type:1,content:"&#xE8C8"}}),t},!1)}function w(n,t,i,r){var
f,e=t.toLocaleLowerCase(),s=decodeURI(i).toLocaleLowerCase().indexOf(e),u,o;s!=-
1&&(f=i.substr(0,s-
1),e.endsWith(".one")&&(f=f.substr(0,f.lastIndexOf("/"))));u=decodeURI(i).split("/"
);r?(o="OneDrive for
Business:\\",u.length>5&&u[3].toLocaleLowerCase()=="personal"&&u[5].toLocaleLowerCa
se()=="documents"&&(u=u.slice(6))):
(u=u.slice(3),o="SharePoint:\\");e.endsWith(".one")&&u.splice(u.length-
2,1);n.path=o+u.join("\\");n.url=i;f&&(n.locationUrl=f)}function
c(i,r,u,f,e,o,s,h,c,l,a,v,b,k,d,g,nt,tt){var
ut=t.ScopeConfig[t.Scope.Documents].icon,ft=i+"?web=1",it,rt;return
u=HitHighlightingParser.removeMarkers(u),f&&(f=f.toLocaleLowerCase()),it=t.createSu
ggestion(r,t.getIconForTypeAsync(ut,"."+f),ut,"FL",u,n.InstrumentedItem.createInstr
umentedItem(v),8,v,!0),it.instrumentPingBack=a,it.click=function(){return

y(i,f,d)},it.extensionLC="."+f,it.lastModifiedDate=t.toDate(o),it.lastModifiedBy=s,
it.author=h,it.matchedOnlyOnAuthor=c,it.matchedOnlyOnContent=l,it.textContentIfMatc
hed=g,rt=e?3:4,w(it,u,i,e),e||(it.siteTitle=tt),c?
it.match=t.createMatch(t.MatchType.Author,h):r.includes(HitHighlightingParser.start
Marker)||(it.match=t.tryGetLocationMatch(it.path,b)||
nt),it.sourceForGroup=rt,t.setFileTemplate(b,k,it,d),p(it,f,ft,t.getGroupSourceDisp
layName(rt,d),d),it}var o=/[0-9a-zA-Z]/,l=/\s+/g,u={Word:{appIds:
["Microsoft.Office.WINWORD.EXE.15","Microsoft.Office.WINWORD.EXE.16","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office15\\WINWORD.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft Office\\Office15\\WINWORD.EXE","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office16\\WINWORD.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft
Office\\Office16\\WINWORD.EXE","Microsoft.Office.Word_8wekyb3d8bbwe!
microsoft.word"],uri:"ms-word:ofe|u|"},Excel:{appIds:
["Microsoft.Office.EXCEL.EXE.15","Microsoft.Office.EXCEL.EXE.16","{6D809377-6AF0-
444B-8957-A3773F02200E}\\Microsoft Office\\Office15\\EXCEL.EXE","{7C5A40EF-A0FB-
4BFC-874A-C0F2E0B9FA8E}\\Microsoft Office\\Office15\\EXCEL.EXE","{6D809377-6AF0-
444B-8957-A3773F02200E}\\Microsoft Office\\Office16\\EXCEL.EXE","{7C5A40EF-A0FB-
4BFC-874A-C0F2E0B9FA8E}\\Microsoft
Office\\Office16\\EXCEL.EXE","Microsoft.Office.Excel_8wekyb3d8bbwe!
microsoft.excel"],uri:"ms-excel:ofe|u|"},PowerPoint:{appIds:
["Microsoft.Office.POWERPNT.EXE.15","Microsoft.Office.POWERPNT.EXE.16","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office15\\POWERPNT.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft Office\\Office15\\POWERPNT.EXE","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office16\\POWERPNT.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft
Office\\Office16\\POWERPNT.EXE","Microsoft.Office.PowerPoint_8wekyb3d8bbwe!
microsoft.pptim"],uri:"ms-powerpoint:ofe|u|"},Visio:{appIds:["{7C5A40EF-A0FB-4BFC-
874A-C0F2E0B9FA8E}\\Microsoft Office\\Office15\\VISIO.EXE","{7C5A40EF-A0FB-4BFC-
874A-C0F2E0B9FA8E}\\Microsoft Office\\Office14\\VISIO.EXE","{6D809377-6AF0-444B-
8957-A3773F02200E}\\Microsoft Office\\Office16\\VISIO.EXE","{7C5A40EF-A0FB-4BFC-
874A-C0F2E0B9FA8E}\\Microsoft
Office\\Office16\\VISIO.EXE","Microsoft.Office.VISIO.EXE.15"],uri:"ms-visio:ofe|
u|"},OneNote:{appIds:
["Microsoft.Office.ONENOTE.EXE.15","Microsoft.Office.ONENOTE.EXE.16","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office15\\ONENOTE.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft Office\\Office15\\ONENOTE.EXE","{6D809377-
6AF0-444B-8957-A3773F02200E}\\Microsoft Office\\Office16\\ONENOTE.EXE","{7C5A40EF-
A0FB-4BFC-874A-C0F2E0B9FA8E}\\Microsoft
Office\\Office16\\ONENOTE.EXE","Microsoft.Office.OneNote_8wekyb3d8bbwe!
microsoft.onenoteim"],uri:"onenote:"}},a=["Microsoft.Office.lync.exe.15","{6D809377
-6AF0-444B-8957-A3773F02200E}Microsoft OfficeOffice15lync.exe","{6D809377-6AF0-
444B-8957-A3773F02200E}Microsoft OfficeOffice16lync.exe","{7C5A40EF-A0FB-4BFC-874A-
C0F2E0B9FA8E}Microsoft OfficeOffice15lync.exe","{7C5A40EF-A0FB-4BFC-874A-
C0F2E0B9FA8E}Microsoft OfficeOffice16lync.exe","{6D809377-6AF0-444B-8957-
A3773F02200E}MSOfficeOffice15lync.exe","{6D809377-6AF0-444B-8957-
A3773F02200E}MSOfficeOffice16lync.exe","{7C5A40EF-A0FB-4BFC-874A-
C0F2E0B9FA8E}MSOfficeOffice15lync.exe","{7C5A40EF-A0FB-4BFC-874A-
C0F2E0B9FA8E}MSOfficeOffice16lync.exe",],i=u.Word,r=u.Excel,f=u.PowerPoint,s=u.Visi
o,e,h;t.OfficeTypeExtensionConfigs={doc:i,dot:i,dotx:i,docx:i,docm:i,docb:i,xls:r,x
lm:r,xlsx:r,xlsm:r,xlsb:r,xltx:r,ppt:f,pps:f,pptx:f,pptm:f,vsd:s,vsdx:s,one:u.OneNo
te};e="sip:";h=function(){function i(n,i,r,u,f,e){var
o=this;this._host=n;this._substrateSuggestionsDataProvider=i;this._instrumentationH
elper=r;this._accessTokenManager=u;this._sequenceNumberReader=f;this._authType=e;th
is._mailboxLocations={};n.bindAccessTokenAvailable(function(n){if(o._authType==n)
{var i=n==1||
t.config.msaProfilePictureEnabled;i&&o.getProfilePictureToken(function()
{})}})}return i.prototype.parse=function(i,r,u,f,e,o){var
h=this,s;if(n.isDataSourceEnabled(u,i)){if(s=[],!f||!f.Groups)
{o(u,s,null);return}var l=t.qfMode!=3&&(u=="SSUE"||
t.config.msaPeopleCardHandoffEnabled),v=t.getEffectiveQuery(i),y=t.isL2(i),p=functi
on(a){for(var p,it,rt,b,nt,ut,ft,d,tt,k,w=0,g=f.Groups;w<g.length;w+
+)if(p=g[w],p.Suggestions&&p.Suggestions.length)switch(p.Type)
{case"Documents":for(it=p.Suggestions,rt=function(i){var u=n.safeExecute(function()
{return
c(i.Url,i.Text,i.FileName,i.FileExtension,i.FileSourceType=="OneDriveForBusiness",i
.DateModified,null,i.CreatedBy||
HitHighlightingParser.removeMarkers(i.Author),i.PropertyHits&&i.PropertyHits[0]=="A
uthor",!1,function(){return
h._substrateSuggestionsDataProvider.instrumentClick(f.Instrumentation.TraceId,i.Ref
erenceId)},r,v,y,h._host,"",null,i.SourceTitle||"")},"buildSubstrateDocumentSuggest
ion");u&&t.isValidSuggestion(u,"SubstrateDocumentsSuggestionsParser")&&s.push(u)},b
=0,nt=it;b<nt.length;b+
+)k=nt[b],rt(k);t.decorateSuggestionsWithParentFolder(s,h._host);break;case"People"
:for(ut=p.Suggestions,ft=function(i){var e=n.safeExecute(function(){return
h.buildPersonSuggestion(l,i,r,f.Instrumentation.TraceId,y,u,v,a)},"buildPersonSugge
stion");e&&t.isValidSuggestion(e,"SubstratePeopleSuggestionsParser")&&s.push(e)},d=
0,tt=ut;d<tt.length;d++)k=tt[d],ft(k);l&&n.safeExecute(function(){return
h.prefetchPeopleCards(s.filter(function(n){return
n.type=="PPL"}),r,e)},"prefetchPeopleCards");t.isL2(i)||
h.decorateContactsWithSameDisplayName(s,i);break;default:SharedLogHelper.LogError("
parseSubstrateResponse",p.Type,new Error("Unexpected group
type"))}o(u,s,null)};u=="SSUE"?t.LocalDataProvider.getApps(a,function(n){return p(!
t.Map.isEmpty(n))}):p(!1)}},i.prototype.prefetchPeopleCards=function(n,i,r){var
u=this;n.length&&this.getPeopleCardTokenAndMailboxLocation(function(f){var
s,e,o,h;f&&f.token&&f.location&&i==u._sequenceNumberReader.getSequenceNumber()&&r()
&&(s=f.location+"api/v1/personacards/preparePersona",e=SearchAppWrapper.CortanaApp.
createStringMap(),e.Authorization="Bearer "+f.token,e["X-
ClientCorrelationId"]=u._instrumentationHelper.getImpressionGuid(i),e["X-
ClientType"]="6",o=SearchAppWrapper.CortanaApp.createStringMap(),o["Content-
Type"]="application/json",h=JSON.stringify(n.map(function(n)
{return{Smtp:n.email,PersonaType:"User"}})),t.Promise.safeChain("prefetchPeopleCard
s",function(){return
SearchAppWrapper.CortanaApp.makeHttpRequestAsync(1,s,e,h,o)},function(n)
{if(n.statusCode!=204){var t=new Error("Prefetch request failed with status code:
"+n.statusCode);SharedLogHelper.LogError("prefetchPeopleCards",null,t)}}))})},i.pro
totype.buildPersonSuggestion=function(i,r,u,f,o,s,h,c){var p=this,d,a,g,y;if(!
r.EmailAddresses||!r.EmailAddresses[0])return null;var
nt=this.getPersonIcon(r.DisplayName),tt=r.EmailAddresses[0],v=HitHighlightingParser
.removeMarkers(tt),w=s=="SSUE",l=t.createSuggestion(r.Text,w||
t.config.msaProfilePictureEnabled?
this.getProfilePictureIcon(v,nt):null,nt,"PPL",r.DisplayName,n.InstrumentedItem.cre
ateInstrumentedItem(u),w?8:12,u,!0),b=r.Id,k;return
w&&(d=r.Id.split("@"),b=d[0],k=d[1]),l.email=v,l.emailHH=tt,l.uniqueName=v,a=r.ImAd
dress,a&&!a.startsWith(e)&&(a=a.includes(":")?
undefined:e+a),a&&(l.imAddress=a,g=a.substr(e.length),g!
=v&&(l.alternativeEmail=g)),y=b&&k&&!
i,l.tooltip=this.getPersonTooltip(r.DisplayName,r.Department,r.JobTitle,r.OfficeLoc
ation,r.CompanyName,v,l.alternativeEmail),l.instrumentPingBack=function(){return
p._substrateSuggestionsDataProvider.instrumentClick(f,r.ReferenceId)},l.click=funct
ion(n){return
p.onPersonSuggestionClick(i,y,v,l.query,u,n,b,k)},this.setPersonTemplate(l,o,r.JobT
itle,h),this.setPersonContextMenuItems(l,i||y,c),!t.alwaysWide&&(i||
y)&&(l.calculateChildSuggestions=function(){return
p.getPersonChildSuggestions(l,u,s,c)}),l},i.prototype.getPersonChildSuggestions=fun
ction(n,t,i,r){var
u=[];u.push(this.getChildSuggestion(n,"CortanaAnnotation_Email","&#xE715","mailto:"
+n.email,"PPLE",t));n.imAddress&&r&&u.push(this.getChildSuggestion(n,"SendInstantMe
ssage","&#xE8BD",n.imAddress,"PPLM",t));n.childSuggestions=u;n.calculateChildSugges
tions=null;this._instrumentationHelper.instrumentDataSource(t,i,n.childSuggestions,
null)},i.prototype.getChildSuggestion=function(i,r,u,f,e,o){var
c=this,h=this._host.getLocString(r),s=t.createSuggestion(h,null,
{type:2,content:u},e,h,n.InstrumentedItem.createInstrumentedItem(o),i.handoffType,o
,!1);return s.parent=i,s.groupType=t.GroupType.Contact,s.click=function(){return
c._host.launchUrl(f)},s.instrumentPingBack=i.instrumentPingBack,s},i.prototype.getP
rofilePictureToken=function(n)
{this._accessTokenManager.getAccount(this._authType,this._authType==1?"https://outl
ook.office.com/":"https://outlook.office.com/User.ReadWrite",!1,!0,function(t)
{return n(t?
t.Token:null)},t.getAuthAccountForCloudContent())},i.prototype.getPeopleCardTokenAn
dMailboxLocation=function(i){var
r=this;this._accessTokenManager.getAccount(this._authType,this._authType==1?"394866
fc-eedb-4f01-8536-3ff84b16be2a":"LiveProfileCard.Access",!1,!0,function(u){var
f,o,s,e;if(!u||!u.Token)
{i(null);return}if(f=u.Token,o=r._mailboxLocations[u.RoutingHint],o)
{i({token:f,location:o});return}s=SearchAppWrapper.CortanaApp.createStringMap();e=S
earchAppWrapper.CortanaApp.createStringMap();e.Authorization="Bearer "+f;e["X-
ClientType"]="6";t.Promise.safeChain("lokiConfiguration",function(){return
SearchAppWrapper.CortanaApp.makeHttpRequestAsync(0,t.config.peopleCardLokiHost+"api
/v1/configuration/cortana",e,"",s)},function(e){if(e.statusCode!==200)
{i(null);return}t.Promise.safeChain("lokiConfigurationResponse",function(){return
e.readAsStringAsync()},function(t){if(!t){i(null);return}var
e=n.safeExecute(function(){return JSON.parse(t)},"parseLokiConfiguration");if(!e||!
e.LokiUrl)
{i(null);return}r._mailboxLocations[u.RoutingHint]=e.LokiUrl;i({token:f,location:e.
LokiUrl})},function(){return
i(null)})},function(){return
i(null)})},t.getAuthAccountForCloudContent())},i.prototype.getSharePointHost=functi
on(n){for(var f,i,e,t,s,l,a,v=new DOMParser,u=0,h=n.value;u<h.length;u+
+)if(f=h[u],f.serviceElements)for(i=0,e=f.serviceElements;i<e.length;i++){var
y=e[i],p=v.parseFromString(y,"text/xml"),r=p.getElementsByTagName("ServiceParameter
"),o=void 0,c=!1;for(t=0;t<r.length;t+
+)if(s=r[t].getElementsByTagName("Name"),s[0].childNodes[0].nodeValue=="IsDefaultDa
taLocation"?
(l=r[t].getElementsByTagName("Value"),l[0].childNodes[0].nodeValue=="True"&&(c=!
0)):s[0].childNodes[0].nodeValue=="SPO_MySiteHost_AboutMeUrl"&&(a=r[t].getElementsB
yTagName("Value"),o=a[0].childNodes[0].nodeValue),c&&o)return o}return
null},i.prototype.onPersonSuggestionClick=function(i,r,u,f,e,o,s,h){var
c=this,l=function(){return c._host.launchUrl("mailto:"+u)},a=function(){var
i=function(){return c._host.launchUrl(c._sharePointSiteHostUrl+"?
aadObjectId="+s)};c._sharePointSiteHostUrl?
i():c._accessTokenManager.getAccount(1,"https://graph.windows.net/",!1,!
0,function(r){if(!r||!r.Token){l();return}var
f=SearchAppWrapper.CortanaApp.createStringMap(),u=SearchAppWrapper.CortanaApp.creat
eStringMap();u.Authorization="Bearer
"+r.Token;t.Promise.safeChain("getSharePointUrl",function(){return
SearchAppWrapper.CortanaApp.makeHttpRequestAsync(0,"https://graph.windows.net/"+h+"
/tenantDetails/"+h+"/serviceInfo?api-version=1.6-internal",u,"",f)},function(r)
{if(r.statusCode!==200)
{l();return}t.Promise.safeChain("readSharePointUrlResponse",function(){return
r.readAsStringAsync()},function(t){var r=t?n.safeExecute(function(){return
JSON.parse(t)},"parseSharePointUrlResponse"):null;if(!r)
{l();return}c._sharePointSiteHostUrl=c.getSharePointHost(r);c._sharePointSiteHostUr
l?i():l()},l)},l)},t.getAuthAccountForCloudContent())};i?
this.getPeopleCardTokenAndMailboxLocation(function(n)
{if(e==c._sequenceNumberReader.getSequenceNumber())if(n&&n.token&&n.location){var
i=n.location+"api/v1/personacard?
clientType=Cortana&userSmtp="+u+"&ClientCorrelationId="+c._instrumentationHelper.ge
tImpressionGuid(e)
+"&cts="+o+"&CultureInfoName="+t.uiLanguageCache;c._host.launchWebContent(i,f,n.tok
en)}else r?a():l()}):r?
a():l()},i.prototype.setPersonContextMenuItems=function(n,i,r){var
u=this;t.setExtraVerbs(n,function(){var
t=[],f=n.childSuggestions&&n.childSuggestions.some(function(n){return
n.displayed});return f||
(t.push({verb:"SendEmail",displayName:u._host.getLocString("CortanaAnnotation_Email
"),executeSync:function(){return u._host.launchUrl("mailto:"+n.email)},isDefault:!
i,icon:
{content:"&#xE715",type:2}}),n.imAddress&&r&&t.push({verb:"SendInstantMessage",disp
layName:u._host.getLocString("SendInstantMessage"),executeSync:function(){return
u._host.launchUrl(n.imAddress)},icon:
{content:"&#xE8BD",type:2}})),SearchAppWrapper.CortanaApp.copyToClipboard&&t.push({
verb:"CopyPersonDetails",displayName:u._host.getLocString("CopyDetails"),executeSyn
c:function(){return
SearchAppWrapper.CortanaApp.copyToClipboard(n.tooltip.replace(/\n/g,"\r\n"),"")},ic
on:{type:1,content:"&#xE8C8"}}),t},!
0)},i.prototype.setPersonTemplate=function(n,i,r,u){if(r?
n.primaryMetadata=r:n.text!=n.emailHH&&(n.primaryMetadata=n.emailHH),!
n.text.includes(HitHighlightingParser.startMarker))if(n.emailHH.includes(HitHighlig
htingParser.startMarker))n.template=1,n.primaryMetadata=n.emailHH;else
if(n.alternativeEmail){var
f=HitHighlightingParser.addMarkers(n.alternativeEmail,u);f.includes(HitHighlighting
Parser.startMarker)&&(n.template=1,n.primaryMetadata=f)}n.narratorText=t.getNarrato
rText(n);i?
(n.template=1,n.classNames.push("topResults")):n.template==1&&n.classNames.push("fo
rceNoWrapOutsideTopResult")},i.prototype.getPersonTooltip=function(n,t,i,r,u,f,e)
{var h="",c=[n,i,t,r,u],o,l,s;for(n!=f&&c.push(f),e&&n!
=e&&c.push(e),o=0,l=c;o<l.length;o++)s=l[o],s&&(h+=h?"\n"+s:s);return
h},i.prototype.getPersonIcon=function(n){var t,i=n.trim().replace(l," ").split("
",2),r,u;return i.length>0&&(r=i[0][0],o.test(r)&&(t=r),i.length==2&&(u=i[1]
[0],t&&o.test(u)?t+=u:t="")),{type:t?5:2,content:t?
t.toUpperCase():"&#xE77B",className:"peopleIcon"}},i.prototype.getProfilePictureIco
n=function(n,i){var r=this;return
t.Promise.safeChainWithGlobalCaching("getProfilePictureIcon",function(){return
ThresholdUtilities.createPromise(function(i){return
r.getProfilePictureToken(function(u){var f,e,o;if(!u)
{i(null);return}f=SearchAppWrapper.CortanaApp.createStringMap();e=SearchAppWrapper.
CortanaApp.createStringMap();f.Authorization="Bearer "+u;r._authType==0&&(f["X-
AnchorMailbox"]=n);o=r._authType==1?"https://substrate.office.com/api/v2.0/Users('"
+n+"')/photo/$value":"https://substrate.office.com/profile/v0/users/"+n+"/image/
$value";t.Promise.safeChain("getProfilePictureIcon",function(){return
SearchAppWrapper.CortanaApp.makeHttpRequestAsync(0,o,f,"",e)},function(n)
{if(n.statusCode!==200)
{i(null);return}t.Promise.safeChain("getProfilePictureIcon",function(){return
n.readAsStreamAsync()},i,function(){return i(null)})},function(){return
i(null)})})})},function(){return n+"_icon"},function(n){var
r=t.toIcon(n,"getProfilePictureIcon",i);return
r.className="peopleIcon",r},i)},i.prototype.decorateContactsWithSameDisplayName=fun
ction(n,i){for(var r,e,u,f=0;f<n.length-1;+
+f)if(r=n[f],r.type=="PPL")for(e=f+1;e<n.length;+
+e)if(u=n[e],u.type=="PPL"&&r.text.toLocaleLowerCase()==u.text.toLocaleLowerCase())
{t.isL2(i)||(r.template!
=1&&r.classNames.push("forceNoWrapOutsideTopResult"),u.template!
=1&&u.classNames.push("forceNoWrapOutsideTopResult"));r.template=u.template=1;r.pri
maryMetadata=r.emailHH;u.primaryMetadata=u.emailHH;break}},i}
();t.SubstrateSuggestionsParser=h;t.buildSubstrateDocumentSuggestion=c})(t=n.WSB||
(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function
u(n,t){return function(){return n(t)}}var
f=["Microsoft.Office.OUTLOOK.EXE.15","Microsoft.Office.OUTLOOK.EXE.16","{6D809377-
6AF0-444B-8957-A3773F02200E}Microsoft OfficeOffice15OUTLOOK.EXE","{7C5A40EF-A0FB-
4BFC-874A-C0F2E0B9FA8E}Microsoft
OfficeOffice15OUTLOOK.EXE"],i="OutlookLaunchPref",r=[0,1],e=function(){function
e(n,t,i)
{this._host=n;this._substrateSuggestionsDataProvider=t;this._lightweightStorage=i;t
his._outlookLaunchPreference={}}return e.prototype.parse=function(i,r,u,f,e,o){var
w=this,s,l,a,h,v,y,b,k,c,p,d;if(n.isDataSourceEnabled(u,i)){if(s=[],!f||!
f.EntitySets)
{o(u,s,null);return}for(l=t.getEffectiveQuery(i),a=t.getEffectiveScope(i),h=0,v=f.E
ntitySets;h<v.length;h++)if(y=v[h],y.ResultSets)for(b=function(e){var
p,o,v,b,c,y,h;if(e.Results)switch(a){case t.Scope.Emails:for(p=function(i){var
e=n.safeExecute(function(){return
w.buildMessageSuggestion(i.Source,r,u,f.Instrumentation?
f.Instrumentation.TraceId:null,i.ReferenceId,l)},"buildMessageSuggestion");e&&t.isV
alidSuggestion(e,"parseSubstrateSearchResponse_emails",!
1)&&s.push(e)},o=0,v=e.Results;o<v.length;o++)h=v[o],p(h);break;case
t.Scope.Documents:for(b=function(u){var o=n.safeExecute(function(){return
w.buildDocumentSuggestion(u.Source,r,f.Instrumentation?
f.Instrumentation.TraceId:null,u.ReferenceId,(u.Provenance||
e.Provenance)=="OneDriveBusiness",l,i)},"buildDocumentSuggestion");o&&t.isValidSugg
estion(o,"parseSubstrateSearchResponse_documents")&&s.push(o)},c=0,y=e.Results;c<y.
length;c+
+)h=y[c],b(h);t.decorateSuggestionsWithParentFolder(s,k._host);break;default:Shared
LogHelper.LogError("parseSubstrateSearchResponse",a.toString(),new
Error("Unexpected scope"))}},k=this,c=0,p=y.ResultSets;c<p.length;c+
+)d=p[c],b(d);o(u,s,null)}},e.prototype.buildDocumentSuggestion=function(n,i,r,u,f,
e,o){var w=this,a=e?
HitHighlightingParser.addMarkers(n.FileName,e):n.FileName,s=a.includes(HitHighlight
ingParser.startMarker);if(e&&!s&&(!t.config.minLengthForContentMatch||
o.queryToFetch.length<t.config.minLengthForContentMatch))return null;var
v=n.Author==null?
null:n.Author.DisplayName,c=t.matchesOnPropertyHH(v,e),b=n.Description?
t.decodeHtml(n.Description).replace(/<\/?[^>]+(>|
$)/g,""):"",y=t.tryGetTextContentMatch(b,e),k=y[0],p=y[1],l=n.LastModifiedBy==null?
null:n.LastModifiedBy.DisplayName,h;return s||c||
(t.matchesOnPropertyHH(l,e)&&(h=t.createMatch(t.MatchType.LastModifiedBy,l)),h=h||
p),t.buildSubstrateDocumentSuggestion(n.Url,a,n.FileName,n.FileExtension,f,n.LastMo
difiedDateTime,l,v,!s&&c,!s&&!c&&!!p,function(){return
w._substrateSuggestionsDataProvider.instrumentClick(r,u)},i,e,t.isL2(o),this._host,
k,h,n.SiteTitle||"")},e.prototype.buildMessageSuggestion=function(i,r,u,f,e,o){var
p=this,c,l,v,y;if(i.IsDraft)return null;if(!i.WebLink)return
SharedLogHelper.LogError("buildMessageSuggestion",null,new Error("Missing web
link")),null;if(c=i.From&&i.From.EmailAddress?i.From.EmailAddress.Name||
i.From.EmailAddress.Address:null,l=i.Sender&&i.Sender.EmailAddress?
i.Sender.EmailAddress.Name||i.Sender.EmailAddress.Address:null,!c&&!l)return
SharedLogHelper.LogError("buildMessageSuggestion",null,new Error("No valid from or
sender fields present")),null;var a=c||
l,h=i.Subject,w=u=="SSEE",s=t.createSuggestion(HitHighlightingParser.addMarkers(a,o
),null,null,"OLE",h||a,n.InstrumentedItem.createInstrumentedItem(r),w?8:12,r,!
0),b=w?1:2;return
this.setEmailContextMenuItems(s,i.ItemHexId,i.WebLink,b),s.click=function(){return
p.launchEmail(i.ItemHexId,i.WebLink,b)},s.template=1,s.classNames.push("email","for
ceNoWrapOutsideTopResult","topResults"),s.primaryMetadata=HitHighlightingParser.add
Markers(h,o),s.secondaryMetadata=HitHighlightingParser.addMarkers(i.Preview,o),s.to
oltip=a+(h?"\n"+h:""),s.hc=i.SortOrderSource=="Relevance",i.HasAttachments&&!
t.alwaysWide&&s.classNames.push("emailAttachIcon"),i.IsRead||
s.classNames.push("accentColor"),v=t.toDate(i.DateTimeReceived),y=t.getTodayTimeStr
ing(v),s.receivedDate=y?
y:v.toLocaleDateString(),s.internetMessageId=i.InternetMessageId,s.instrumentPingBa
ck=function(){return
p._substrateSuggestionsDataProvider.instrumentClick(f,e)},s.narratorText=t.getNarra
torText(s),s},e.prototype.setEmailContextMenuItems=function(n,i,r,u){var
e=this;i&&t.setExtraVerbsAsync(n,function(){var n=[];return
ThresholdUtilities.createPromise(function(o)
{t.LocalDataProvider.getApps(f,function(f){var a=!t.Map.isEmpty(f);if(a){var
h=e.getOutlookLaunchPreference(u),c="Outlook",l,s=Object.keys(f);s.length==1&&(c=f[
s[0]].deviceItem.displayName,l=f[s[0]].getIcon);n.push({verb:"OpenInOutlookWeb",dis
playName:e._host.getLocString("OpenIn","Outlook Web"),executeSync:function(){return
e.launchOutlookWeb(r,u)},isDefault:h==0,icon:
{content:"&#xE774",type:1}});n.push({verb:"LaunchOutlookNative",displayName:e._host
.getLocString("OpenIn",c),executeSync:function(){return
e.launchOutlokNative(i,u)},isDefault:h==1,getIcon:l})}o(n)})})},!
0)},e.prototype.launchOutlookWeb=function(n,t,i){var
r=this;this._host.launchUrl(n,function(){return
r.setOutlookLaunchPreference(0,t)},i)},e.prototype.launchOutlokNative=function(n,t,
i){var r=this;this._host.launchOutlook(n,function(){return
r.setOutlookLaunchPreference(1,t)},i)},e.prototype.launchEmail=function(t,i,f)
{for(var
c,e,s,l=this,v=this.getOutlookLaunchPreference(f),o=[v],h=0,a=r;h<a.length;h+
+)c=a[h],n.contains(o,c)||o.push(c);for(s=o.length-1;s>=0;s--)switch(o[s]){case
1:e=u(function(n){return l.launchOutlokNative(t,f,n)},e);break;case
0:e=u(function(n){return
l.launchOutlookWeb(i,f,n)},e)}e()},e.prototype.getOutlookLaunchPreference=function(
n){if(!this._outlookLaunchPreference[n]){var
t=parseInt(this._lightweightStorage.getItem(i+n));this._outlookLaunchPreference[n]=
isNaN(t)?r[0]:t}return
this._outlookLaunchPreference[n]},e.prototype.setOutlookLaunchPreference=function(n
,t)
{this._outlookLaunchPreference[t]=n;this._lightweightStorage.setItem(i+t,n.toString
())},e}();t.SubstrateSearchParser=e})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}))

You might also like