MSN 3&&void 0!==arguments[3]?arguments[3]:p.Alert,s=arguments.length>4?arguments[4]:void 0;try{const c=function(){if(!o){const e=document.head.getAttribute(“data-client-settings”);e&&(o=JSON.parse(e))}return o}(),l=a(),u=function(e){if(e){const{pcsInfo:t,pageGenTime:n}=e,o=new Date(n).getTime(),i=!t||[“prod”,”prod-ssr”,”prod-ssrntp”].includes(t.env);r=i?”browser.events.data.msn.com”:”events-sandbox.data.msn.com”;return{cors:”true”,”content-type”:”application/x-json-stream”,”client-id”:”NO_AUTH”,”client-version”:”1DS-Web-JS-2.2.2″,apikey:i?”0ded60c75e44443aa3484c42c1c43fe8-9fc57d3f-fdac-4bcf-b927-75eafe60192e-7279″:”f8857dedc6f54ca8962cfb713e01e7d7-e9250191-fe0b-446f-95ae-07516262f98c-7028″,”upload-time”:o,w:”0″,anoncknm:”app_anon”}}return null}(c);let g=””;u&&u.apikey&&””!==u.apikey&&(g=function(e){if(e){const t=e.indexOf(“-“);if(t>0)return e.substring(0,t)}return””}(u.apikey));const m=function(e,t,n,o,i,s){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:p.Alert;if(n){i=i||{};const{apptype:c,audienceMode:l,pagetype:u,pageGenTime:p,bundleInfo:h,deviceFormFactor:g=””,fd_muid:m,os:f}=n;i.pageGenTime=p,i.build=h&&h.v,i.appType=c;const b=function(e,t,n){const o=n&&”phone”===n.toLowerCase(),i=t&&”enterprise”===t;return{bingHomepage:”binghomepage”,mmx:”emmx”,edge:”spartan”,edgeChromium:i?”entnews”:”anaheim”,hybrid:”spartan”,hub:o?”prime_mobile”:”prime”,microsoftNews:”msnews”,office:”entnews”,views:o?”prime_mobile”:”prime”,windowsShell:”windowsshell”}[e]}(c,l,g),v=b||c,y=document.getElementsByTagName(“html”)[0].getAttribute(“lang”);let k,S=””,A=”muid”;try{if(“edgeChromium”===c&&”object”==typeof window&&window.location&&window.location.search){const e=new URLSearchParams(window.location.search);k=e.has(“startpage”)?”msedgdhp”:”msedgntp”,”enterprise”===l?k=”entnewsntp”:”xbox”===f&&(k=”xboxntp”)}window&&window.getCookieConsentRequired&&”function”==typeof window.getCookieConsentRequired&&window.getCookieConsentRequired()||(S=d(“muid”))}catch{}S||(S=n.aid,A=”aid”);const C={name:”MS.News.Web.AppError”,time:p,ver:”4.0″,iKey:`o:${o}`,data:{baseData:{},baseType:”MS.News.Web.Base”,page:{name:”default”,product:v,type:w(u),content:{category:”standaloneError”},ocid:k},browser:{clientId:S,clientIdType:A},flight:{id:s},request:{activityId:n.aid,requestId:n.aid,afdMuid:m},locale:{mkt:y},extSchema:{id:e,severity:r,pb:i,message:t}}};var a;if(S&&”muid”===A)C.ext={…null==C?void 0:C.ext,user:{…null==C||null===(a=C.ext)||void 0===a?void 0:a.user,localId:`t:${S}`}};return C.data.flight.tmpl=””,i.isSSRScope&&(C.data.flight.tmpl+=”ssrscope:1″),”object”==typeof window&&(window.isSSREnabled&&(C.data.flight.tmpl+=”;ssr-enabled:1″),window.isSSRCompleted&&(C.data.flight.tmpl+=”;ssr-completed:1″)),C?JSON.stringify(C):null}return null}(t,e,c,g,n,l,i);if(u&&m){console.error(m),h.push(m);const e=”https://”+r+”/OneCollector/1.0″+function(e){return”?”+Object.keys(e).map((function(t){return t+”=”+encodeURIComponent(e[t])})).join(“&”)}(u);if(s&&!performance.getEntriesByType(“visibility-state”).some((e=>”visible”===e.name))){const t=()=>{“visible”===document.visibilityState&&navigator.sendBeacon(e,m)};document.addEventListener(“visibilitychange”,t,{once:!0})}else navigator.sendBeacon(e,m)}}catch{}}function w(e){let t=e;switch(e){case”windowsshellhp”:t=”dhp”;break;case”video”:t=”watch”}return t}const m=”visibilitychange”;function f(){return”visible”===document.visibilityState?Promise.resolve():new Promise((e=>{document.addEventListener(m,(()=>{“visible”===document.visibilityState&&e()}))}))}function b(e){const t=window&&window.chrome&&window.chrome.ntpSettingsPrivate;t&&t.logLoadingError&&f().then((()=>{t.logLoadingError(e)}))}function v(e){try{if(e)return JSON.parse(e)}catch(e){}return null}function y(){return!(“undefined”==typeof window||!window.document||!window.document.createElement||window.isRenderServiceEnv)}const k=”Authorization”;var S,A;!function(e){e.Presentation=”presentation”}(S||(S={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(A||(A={}));var C,x;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(C||(C={})),function(e){e.Init=”init”,e.Config=”config”,e.Targeted=”targeted”,e.Sticky=”sticky”,e.NoSticky=”no_sticky”,e.Admin=”admin”,e.Forced=”forced”,e.Manual=”manual”}(x||(x={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const I=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),_=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));function q(){var e;return y()?v(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const E=”feed/personalize/settings”;function O(e,t){const n=t.replace(/[[]]/g,”\$&”),o=new RegExp(“[?&]”+n+”(=([^&#]*)|&|#|$)”).exec(e);if(!o)return null;const i=o[2];return decodeURIComponent(i.replace(/+/g,” “))||””}let N=new class{constructor(){y()?(this.isDebugEnabled=(O(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(O(window.location.href,”reqsrc”)||””).toLowerCase(),this.isDebugEnabled&&!n.g.TEST_ENV&&(window.webpackRequire=n)):this.isDebugEnabled=!1}getLoggingService(){return null}isDebug(){return this.isDebugEnabled}setDebug(e){this.isDebugEnabled=e}setTags(e){}log(e,t){this.isDebug()&&console.info(e)}logError(e){console.error(e)}logCallback(e){this.isDebug()&&console.info(e())}logObjects(){this.isDebug()&&console.log(…arguments)}logSingleObject(e,t){this.isDebug()&&console.log(e)}};class T{get supported(){return!!this.storage}constructor(e){this.storage=e}getItem(e){if(this.supported)return this.storage.getItem(e)}getObject(e,t){const n=this.getItem(e);if(null!=n){const e=v(n);if(null!=e)return e}return t}key(e){if(this.supported&&e>=0)return this.storage.key(e)}keys(){return this.supported?Object.keys(this.storage):[]}setObject(e,t){void 0!==t?this.setItem(e,JSON.stringify(t)):this.removeItem(e)}removeObject(e){const t=this.removeItem(e);if(null!=t)return v(t)}setItem(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.supported)try{if(!t)throw”Attempted to store null/undefined value: “+t;this.storage.setItem(e,t)}catch(e){if(!n)throw e;N.logError(e)}else if(!n)throw new Error(“WebStorage not supported”)}get length(){if(this.supported)return this.storage.length}removeItem(e){if(this.supported){const t=this.getItem(e);return this.storage.removeItem(e),t}}clear(){this.supported&&this.storage.clear()}removeSubstringKeys(e){if(!this.supported||!e)return;const t=[];for(let n=0;n{n=!1,t=void 0}},o}!function(e){e.NotAvailable=”notAvailable”,e.Expired=”expired”,e.Valid=”valid”}(R||(R={}));const B=”currentaccount”,j=H((()=>{const e=d(B,!0),t=e&&v(e),{login_hint:n}=t||{};return n&&t})),$=H((()=>!!d(B)));let G=new Map;const J=Object.freeze({set(e,t){return G.set(e,t),this},get:function(e,t){let n=G.get(e);return void 0===n&&t&&(n=t(),G.set(e,n)),n},clear(){G.clear()},delete:e=>G.delete(e),has:e=>G.has(e)});const V=”__RequestDataInstance__”;class z{constructor(e,t){if(this.url=new URL(e.href),this.innerHeight=e.innerHeight,this.devicePixelRatio=e.devicePixelRatio,this.canUseCssGrid=e.canUseCssGrid,this.requestId=e.requestId,this.cookie=e.cookie,this.referer=e.referer,this.userAgent=e.userAgent,this.clientData=e.clientData,this.oneServiceHeaders=function(e){try{if(e)return JSON.parse(e)}catch(e){}}(e.oneServiceHeaders)||{},this.isPssrMode=t,t){const e=K(“OSATE”,this.cookie),t=!!e&&”1″===e,n=K(“OSAT”,this.cookie);if(t&&n||!e&&!n)return this.msalAuthReady=!0,void(n&&(this.oneServiceHeaders.Authorization=`Bearer ${n}`));this.msalAuthReady=!1,this.pssrRejectedReason=e&&!t?”interactiveLogin”:e&&!n?”missOSAT”:”missOSATE”}}static getInstance(){const e=J.get(V);return e||(n.g.TEST_ENV?X({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):X({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new z(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return J.set(V,t),t}}function K(e,t){if(t&&e){const n=new RegExp(“\b”+e+”\s*=\s*([^;]*)”,”i”).exec(t);return n&&n.length>1?n[1]:null}return null}const X=z.resetInstance,Y=()=>z.getInstance();function Z(){try{return localStorage}catch(e){return null}}const Q=”__PageExperimentInstance__”;function ee(e){J.set(Q,e)}function te(e){if(!J.has(Q)&&y()){var t;ee(ne(document.head.dataset.info||(null===(t=window.document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===t||null===(t=t.dataset)||void 0===t?void 0:t.info)||””))}const n=J.get(Q);return n&&n.has(e)}function ne(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const oe=”uxlogin”,ie=”uxlogout”,se=”uxedit”,re=”useRedirect”,ae=”uxswitch”,ce=H((()=>{const e=Z();return e&&”1″===e.getItem(oe)||y()&&location.search&&location.search.includes(`${oe}=1`)}));const de=H((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(ie)}));const le=H((()=>{const e=Z();return e&&”1″===e.getItem(se)}));const ue=H((()=>{const e=Z(),t=!te(“prg-noredirect”)&&e&&”1″===e.getItem(re)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=v(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const pe=H((()=>{const e=Z();return e&&”1″===e.getItem(ae)}));const he={outlookMobile:”OnOOutlookMobile”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,moto:”moto”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},ge=”superappdhp”,we=[“ios”,”android”,”ipados”];let me=Ee(“ocid”).toLowerCase(),fe=Ee(“chpltfm”),[be,ve]=fe.toLowerCase().split(“-“);function ye(){if(!y())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,o=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!o)}function ke(){const e=fe&&”outlook”===be&&we.includes(ve),t=me===he.outlookMobile.toLowerCase();return e||t}function Se(){const e=fe&&[“office”,”union”].includes(be)&&we.includes(ve),t=me===he.officeMobile.toLowerCase();return e||t}function Ae(){const e=me===he.skype.toLowerCase()||”skype”===be;return y()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Ce(){return ye()||me===he.sapphire.toLowerCase()||me===ge.toLowerCase()}function xe(){const e=Ee(“edge”);return(“emmx”===be||”1″===e)&&Ce()||”mmx”===me}function Ie(){return”3rdp”===be||me.startsWith(he.xiaomiApp)||me===he.moto.toLowerCase()||me===he.swiftKey.toLowerCase()}function _e(){return-1!==location.href.indexOf(“huawei”)||-1!==location.href.indexOf(“airfind”)||-1!==location.href.indexOf(“aloha”)||”vivo”===me&&Ie()}const qe=H((()=>ye()||Ae()||Se()||ke()||Ce()||me===he.winWeatherApp.toLowerCase()||me===he.winMoneyApp.toLowerCase()||xe()||Ie()||[he.launcher.toLowerCase(),he.launcherInterests.toLowerCase()].includes(me)&&Ce()||_e()));function Ee(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const Oe=q()||{},Ne={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channel:1,channeldesktop:1,channelmobile:1,edgeMobile:1},Te={edgeChromium:1},Le={winWidgets:1},Pe={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1},Re={edgeChromium:1,channel:1,channeldesktop:1,channelmobile:1,cgHomePage:1,distribution:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,superApp:1,edgeMobile:1},Me=H((()=>Oe&&Oe.apptype)),We=(H((()=>y()&&Me()in Le)),H((()=>y()&&!qe()&&!(Me()in Ne)&&!Fe()&&!He()))),Ue=H((()=>We()&&!(Me()in Te)));H((()=>We()&&(!(Me()in Te)||!$()))),H((()=>We()&&!Ge()&&!Je()));function De(){return Je()||Ge()}const Fe=H((()=>{const e=!(Me()in Pe)&&Ve()&&function(){const e=new URLSearchParams(y()?window.location.search:Y().url.search).get(“ocid”)||(null==Oe?void 0:Oe.ocid),t=null==e?void 0:e.toLowerCase(),n=!_.has(t)&&”homePage”!==Me()&&!I.has(t);return n}()&&!function(){const e=”windows”==Me()&&”windowshp”==(Oe&&Oe.pagetype)&&(y()?window.location.href:Y().url.href).includes(`${E}`);return e}();return e})),He=()=>y()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0,Be=H((()=>te(“prg-1s-workid”)||te(“prg-1s-sm-workid”)||te(“prg-1s-twid”)||te(“prg-1s-mm-wid-t”)));H((()=>Me()in Re||Fe()));function je(){const e=W;if(e)return N.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=U();if(t)return N.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${D()}`),t;N.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function $e(e){const t={};return e&&(t[k]=`Bearer ${e}`),t}function…
Continue reading