MSN i.delete(e),has:e=>i.has(e)});const r=”__RequestDataInstance__”;class c{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=a(“OSATE”,this.cookie),t=!!e&&”1″===e,n=a(“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=s.get(r);return e||(n.g.TEST_ENV?d({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):d({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new c(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return s.set(r,t),t}}function a(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 d=c.resetInstance,l=()=>c.getInstance();function u(){return o()?window.location.search:l().url.search}var p,h;!function(e){e.Anon=”ANON”,e.AppAnon=”APP_ANON”,e.Unknown=””}(p||(p={})),function(e){e.AnonCookieExists=”ace”,e.AppAnonCookieExists=”aace”}(h||(h={}));const g=”child”;function w(e,t){if(e){const n=new RegExp(“\b”+t+”\s*=\s*([^;]*)”,”i”).exec(e);return n&&n.length>1?n[1]:null}return null}function m(e){try{if(e)return JSON.parse(e)}catch(e){}return null}const f=”prg-pr2-“,v=”prg-pw-“,b=”prg-“,y=”prg-1sw-“;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;const n=t.length,o=[];return e&&e.length&&(e.forEach((e=>{const i=e&&e.trim();i&&i.length>=n&&i.substring(0,n).toLowerCase()===t&&o.push(i.toLowerCase())})),o.sort()),o}function S(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:””,n=b;var o,i;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?n=v:t.toLocaleLowerCase()===”windowsShell”.toLocaleLowerCase()||t.toLocaleLowerCase()===”windowsShellV2″.toLocaleLowerCase()?n=y:t.toLocaleLowerCase()!==”winWidgets”.toLocaleLowerCase()||(null===(o=window)||void 0===o||null===(o=o.location)||void 0===o||null===(o=o.search)||void 0===o?void 0:o.includes(“reqsrc=vp”))||null!==(i=window)&&void 0!==i&&null!==(i=i.location)&&void 0!==i&&null!==(i=i.search)&&void 0!==i&&i.includes(“vptest”)||(n=f),n}function C(e){var t;return document.head.dataset[e]||(null===(t=_())||void 0===t?void 0:t.dataset[e])}let A;function _(){return void 0===A&&(A=document.getElementsByClassName(“peregrine-widget-settings”)[0]||null),A}function I(e){var t;if(!e||!e.startsWith(“f:”))return;const n=(e.match(/f:s*([^;]+)/i)||[])[1];return n?null===(t=n.toLowerCase().split(“,”))||void 0===t?void 0:t.sort():[]}const q=”Authorization”;var E,L;!function(e){e.Presentation=”presentation”}(E||(E={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(L||(L={}));var O,x;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(O||(O={})),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 T=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),P=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));new Set([“chromentpnews”]);function N(){var e;return o()?m(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const R=”feed/personalize/settings”;function W(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 M=new class{constructor(){o()?(this.isDebugEnabled=(W(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(W(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 D{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=m(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 m(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;M.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[]{const e=z(Z,!0),t=e&&m(e),{login_hint:n}=t||{};return n&&t})),te=Y((()=>!!z(Z)));function ne(){try{return localStorage}catch(e){return null}}const oe=”__PageExperimentInstance__”;function ie(e){s.set(oe,e)}function se(e){if(!s.has(oe)&&o()){var t;ie(re(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=s.get(oe);return n&&n.has(e)}function re(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const ce=”uxlogin”,ae=”uxlogout”,de=”uxedit”,le=”useRedirect”,ue=”uxswitch”,pe=Y((()=>{const e=ne();return e&&”1″===e.getItem(ce)||o()&&location.search&&location.search.includes(`${ce}=1`)}));const he=Y((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(ae)}));const ge=Y((()=>{const e=ne();return e&&”1″===e.getItem(de)}));const we=Y((()=>{const e=ne(),t=!se(“prg-noredirect”)&&e&&”1″===e.getItem(le)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=m(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const me=Y((()=>{const e=ne();return e&&”1″===e.getItem(ue)}));const fe={bingHomepageMobile:”binghomepagemobile”,outlookMobile:”OnOOutlookMobile”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,freFullPage:”emmxFre”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},ve=”superappdhp”,be=[“ios”,”android”,”ipados”],ye=”_ocidIsomorphicKey”,ke=()=>(s.get(ye)||s.set(ye,Fe(“ocid”).toLowerCase()),s.get(ye)),Se=”_platformFlagKey”,Ce=”_hostAppNameKey”,Ae=”_clientTypeKey”,_e=()=>(s.get(Se)||s.set(Se,Fe(“chpltfm”)),s.get(Se)),Ie=()=>{if(!s.get(Ce)){const e=_e();s.set(Ce,e.toLowerCase().split(“-“)[0])}return s.get(Ce)},qe=()=>{if(!s.get(Ae)){const e=_e();s.set(Ae,e.toLowerCase().split(“-“)[1])}return s.get(Ae)};function Ee(){if(!o()||We())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,i=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!i)}function Le(){const e=_e()&&”outlook”===Ie()&&be.includes(qe()),t=ke()===fe.outlookMobile.toLowerCase();return e||t}function Oe(){const e=_e()&&[“office”,”union”].includes(Ie())&&be.includes(qe()),t=ke()===fe.officeMobile.toLowerCase();return e||t}function xe(){const e=ke()===fe.skype.toLowerCase()||”skype”===Ie();return o()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Te(){return!(!o()||We())&&(Ee()||ke()===fe.sapphire.toLowerCase()||ke()===ve.toLowerCase())}function Pe(){const e=Fe(“edge”);return(“emmx”===Ie()||”1″===e)&&Te()||”mmx”===ke()}function Ne(){return”3rdp”===Ie()||ke().startsWith(fe.xiaomiApp)||We()}function Re(){return[fe.launcher.toLowerCase(),fe.launcherInterests.toLowerCase()].includes(ke())&&Te()}function We(){return ke().toLowerCase()===fe.swiftKey.toLowerCase()||”swiftkey”==Ie().toLowerCase()}function Me(){return-1!==window.location.href.indexOf(“huawei”)||-1!==window.location.href.indexOf(“airfind”)||-1!==window.location.href.indexOf(“aloha”)||”vivo”===ke()&&Ne()}const De=Y((()=>Ee()||xe()||Oe()||Le()||Te()||ke()===fe.winWeatherApp.toLowerCase()||ke()===fe.winMoneyApp.toLowerCase()||Pe()||Ne()||Re()||We()||Me()||-1!==window.location.href.indexOf(“metaos=true”)));function Fe(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const Ue=N()||{},$e={newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channeldesktop:1,channelmobile:1,edgeMobile:1},je={edgeChromium:1},He={winWidgets:1},Be={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,msn:1},Je={edgeChromium:1,channeldesktop:1,channelmobile:1,cgHomePage:1,distribution:1,newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,superApp:1,edgeMobile:1},Ge=Y((()=>Ue&&Ue.apptype)),Ve=(Y((()=>o()&&Ge()in He)),Y((()=>o()&&!De()&&!(Ge()in $e)&&!Xe()&&!Qe()))),Ke=Y((()=>Ve()&&!(Ge()in je)));Y((()=>Ve()&&(!(Ge()in je)||!te()))),Y((()=>Ve()&&!et()&&!tt()));const ze=Y((()=>tt()||et())),Xe=Y((()=>!(Ge()in Be)&&nt()&&function(){if(“homePage”==Ge())return!0;const e=new URLSearchParams(u()).get(“ocid”)||(null==Ue?void 0:Ue.ocid),t=null==e?void 0:e.toLowerCase();if(P.has(t)&&se(“prg-msn-id”))return!0;const n=!P.has(t)&&!T.has(t);return n}()&&!function(){const e=”windows”==Ge()&&”windowshp”==(Ue&&Ue.pagetype)&&(o()?window.location.href:l().url.href).includes(`${R}`);return e}())),Qe=()=>o()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0;Y((()=>Ge()in Je||Xe()));function Ye(){const e=H;if(e)return M.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=J();if(t)return M.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${G()}`),t;M.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function Ze(e){const t={};return e&&(t[q]=`Bearer ${e}`),t}function et(){return Ke()&&pe()||function(){const e=Ke()&&!ot()&&!pe()&&ee()&&(“expired”==G()||ge());return e}()||he()||we()}function tt(){return Ke()&&!ee()&&me()}const nt=Y((()=>{const{browser:e}=Ue,{browserType:t=””,detected:n={}}=e||{},{browserType:o=””}=n||{};return/edgeChromium/i.test(t)||/edgeAndroid/i.test(t)||/edgeiOS/i.test(t)||/edge/i.test(o)}));Y((()=>Ke()&&!Xe()));const ot=()=>{const e=ee();if(!e)return!1;let t;switch(e.account_type){case”MSA”:t=Ke()?”ace”:”aace”;break;case”AAD”:t=Ke()?”WID”:”APP_WID”;break;default:return!1}return!!z(t)};const it=”__core_auth_authHeaderPromiseParts__”,st=()=>s.get(it);var rt;!function(){let e;const t={promise:new Promise((t=>e=t)),resolver:e};s.set(it,t)}(),function(e){e.GLOBAL=”GLOBAL”,e.GCC_MODERATE=”GCC_MODERATE”}(rt||(rt={}));let ct;function at(){return ct}const dt=Y((()=>m(z(“AL_STATE”,!0))));const lt=()=>{const e=z(“elt”,!0),t=e&&m(e),{access_token:n,account_type:o,login_hint:i,region_scope:s}=t||{};return(n||o||i||s)&&t};function ut(e){if(“undefined”==typeof window||!window.document||window.isRenderServiceEnv)return;const t=window.trustedTypes;if(!t||!t.createPolicy)return;const n=window.trustedTypePolicies||(window.trustedTypePolicies={});if(n[e])return n[e];const o=t.createPolicy(e,{createScriptURL:e=>{const t=function(e){const t=[“ntp.msn.com”,”ntp.msn.cn”,”assets.msn.cn”,”assets.msn.com”,”www.bing.com”,”assets2.msn.com”,”assets2.msn.cn”,”www.clarity.ms”,”int.msn.com”,”r.bing.com”,”business.bing.com”,”staticview.msn.com”,”staticview.msn.cn”,”edge.microsoft.com”,”edge-staging.microsoft.com”,document.location.hostname];let n;try{n=new URL(e,location.origin)}catch(e){return”about:blank#error”}if(n.hostname&&!t.includes(n.hostname))return”about:blank#error”;return e}(e);return t}});return n[e]=o,o}class pt{constructor(){this.childCookieName=”child”,this.domInfo=document.head.dataset.info,this.canvasInfo=document.head.dataset.canvasInfo||””,this.command=”command”}init(e,t){this.clientSettings=e||N(),this.authCookieName=at()||window._authCookieName||””,this.bundle=window._webWorkerBundle||””,t=t||{};const n=this.buildWebWorkerUrl(this.clientSettings,t),o=this.clientSettings.apptype;let i;if(o&&”edgeChromium”===o){if(i=this.tryGetWebWorkerUsingPolicy(n,”webWorkerUrlPolicy”),!i)return void console.warn(“Error in creating trusted types compliant web worker”)}else i=window.webWorker=new Worker(n,{name:”web-worker”});const…
Continue reading