" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.13633 0.855846C6.87407 0.597433 6.452 0.600559 6.1936 0.862826C5.93513 1.1251 5.93827 1.5472 6.20053 1.80561L9.7808 5.3332H0.666667C0.298473 5.3332 0 5.63167 0 5.99987C0 6.36807 0.29848 6.66653 0.666667 6.66653H9.7764L6.20053 10.1898C5.93827 10.4482 5.93513 10.8703 6.1936 11.1326C6.452 11.3949 6.87407 11.398 7.13633 11.1396L11.7525 6.59133C12.0837 6.26493 12.0837 5.73053 11.7525 5.40413L7.13633 0.855846Z" fill="white"/>
</svg>
`,I=E.d`
<msn-actions-menu :referrerButton=${e=>e.actionsMenuButtonElement} :menuItems=${e=>e.actionsMenuProps.menuItems}>
</msn-actions-menu>
`,L=E.d`
    <span>&#8226;</span>&nbsp;
    ${e=>e.healthTipData.expertQualification}
`,A=E.d`
<a href="${e=>e.getPersonalizedUrl(e.healthTipData.msnArticleURL)}" target="_blank" data-t="${e=>e.healthTipDestinationTelemetryTag}"
    class="health-tip-container-link" aria-label={${e=>e.getHeaderText()+";"+e.healthTipData.healthTip}}>
    <div class="health-tip-image-container">
        <img id="healthTipImage" src="${e=>e.generateUrl()}" />
    </div>
    <div class="health-tip-gradient-container"
        style="background: linear-gradient(180deg, rgba(${e=>e.getrgbvalue()}, 0.8) -37.66%, rgba(${e=>e.getrgbvalue()}, 0) 129.93%, rgba(${e=>e.getrgbvalue()}, 0.448) 129.93%);">
    </div>
    <div class="health-tip-gradient-container"
        style="background: linear-gradient(180deg, rgba(${e=>e.getrgbvalue()}, 0.8) -37.66%, rgba(${e=>e.getrgbvalue()}, 0) 129.93%, rgba(${e=>e.getrgbvalue()}, 0.448) 129.93%); transform: matrix(1, 0, 0, -1, 0, 0);">
    </div>
    <div class="health-tip-blur-container"
        style="background: rgba(${e=>e.getrgbvalue()}, 0.1);">
    </div>
    <div class="health-tip-header-container" data-t="${e=>e.healthTipCardTelemetryTag}">
        <div class="health-tip-header-content">
            ${e=>e.getHeaderText()}
        </div>  
    </div>
    <div class="health-tip-footer-container  ${e=>e.isExpertTip()?"expert-footer-container":""}">
        <div class="health-tip-title-container">
            "${e=>e.healthTipData.healthTip}"
        </div>
        <div class="health-tip-publisher-container  ${e=>e.isExpertTip()?"expert-tip-container":""}">
            <img src="${e=>e.healthTipData.articleThumbnail.publisherIcon}" class="health-tip-image"/>
            <div class="health-tip-publisher-name">
                ${e=>e.healthTipData.publisherName}
                ${(0,P.g)((e=>e.healthTipData.expertQualification&&e.isExpertTip()),L)}
            </div>
        </div>
    </div>
</a>
<div class="health-tip-more-info">
    <fluent-button
        class= "toggle-button"
        @click=${(e,t)=>e.toggleActionMenu&&e.toggleActionMenu(!e.isActionMenuOpen,t.event)}
        title="${e=>e.strings.moreSettingsText}"
        aria-label="${e=>e.strings.moreSettingsText}"
        data-t="${e=>e.ellipsisTelemetryTag}"
    >
        ${$.Z}
    </fluent-button>
</div>
<a href="${e=>e.getPersonalizedUrl(e.healthTipData.msnArticleURL)}" target="_blank" data-t="${e=>e.healthTipDestinationTelemetryTag}"
    class="health-tip-action-link" aria-label={${e=>e.healthTipData.footerCTA}}>
    <div class="health-tip-action-container">
        ${e=>e.healthTipData.footerCTA}
        <div class="action">${k}</div>
    </div>
</a>
`,G=E.d`
<div class="health-tip-root" data-t="${e=>e.healthTipCardTelemetryTag}">
    ${A}
</div>
${(0,P.g)((e=>e.isActionMenuOpen),I)}
`;var H=i(32804),U=i(15933),W=i(53046),F=i(40082);const q=W.i`
.health-tip-title-container {
    background: ${U.H.ButtonFace};
    color: ${U.H.LinkText};
}

.health-tip-action-container,  .health-tip-action-container svg path {
    background: ${U.H.ButtonFace};
    color: ${U.H.LinkText};
    fill: ${U.H.LinkText};
}

.health-tip-header-content, .health-tip-publisher-container .health-tip-publisher-name {
    background: ${U.H.ButtonFace};
    color: ${U.H.CanvasText}
}


`,M=W.i`
:host {
    border-radius: 6px;
}

.health-tip-root {
    height: 100%;
    max-width: 300px;
    border-bottom: 1px solid ${H.dtw};
    position: relative;
    z-index: 1;
    background: #000;
    border-radius: 6px;
}

.health-tip-root a {
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.health-tip-root a:hover .health-tip-title-container {
    text-decoration: underline;
}

.health-tip-root a .health-tip-action-container:hover {
    text-decoration: underline;
}

.health-tip-root a:hover .health-tip-fullbleed-action-container {
    text-decoration: underline;
}

.health-tip-root a:hover .health-tip-fullbleed-action-container .action {
    background: rgba(0,0,0,0.3);
}

.health-tip-root a:hover .health-tip-fullbleed-title-container {
    text-decoration: underline;
}

.health-tip-container-link {
    height: calc(100% - 45px);
}

.health-tip-action-link {
    height: 45px;
}

.health-tip-container-link:focus-visible, .health-tip-action-link:focus-visible {
    outline: none;
}

.health-tip-container-link:focus-visible .health-tip-title-container, .health-tip-container-link:focus-visible .health-tip-header-content {
    outline: 1px solid;
}

.health-tip-action-link:focus-visible .health-tip-action-container {
    outline: 1px solid;
}

.health-tip-fullbleed-image-container  {
    height: 300px;
    position: absolute;
    top: 0px;
    z-index: -1;
}

 .health-tip-image-container {
    height: 304px;
    position: absolute;
    top: 0px;
    z-index: -1;
}

.health-tip-fullbleed-image-container img {
    object-fit: cover;
    height: 100%;
    border-radius: 6px 6px 0 0;
}

.health-tip-image-container img {
    object-fit: cover;
    height: 100%;
    width: 100%;
    border-radius: 6px;
}

.health-tip-gradient-container {
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 304px 300px 0px 0px;
    z-index: 0;
    position: absolute;
    top: 0;
    border-radius: 6px;
}

.health-tip-blur-container {
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 300px 300px 0px 0px;
    backdrop-filter: blur(2px);
    transform: matrix(1, 0, 0, -1, 0, 0);
    z-index: 1;
    position: absolute;
    top: 0;
    border-radius: 6px;
}

.health-tip-footer-container {
    position: absolute;
    top: 94px;
    height: calc(100% - 94px);
    width: 100%; 
    z-index: 2;
    border-radius: 0 0 6px 6px;
}

.health-tip-footer-container.expert-footer-container {
    top: auto;
    bottom: 45px;
}

.health-tip-footer-container.expert-footer-container .health-tip-title-container {
    position: absolute;
    bottom: 72px;
}

.health-tip-footer-container.expert-footer-container .expert-tip-container {
    position: absolute;
    bottom: 20px;
    width: calc(100% - 32px);
}

.health-tip-fullbleed-header-container, .health-tip-header-container {
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    font-weight: 600;
    font-size: ${H.sNp};
    line-height: ${H.vgC};
    color: #fff;
    padding: 16px 16px 0px;
    z-index: 2;
    border-radius: 6px 6px 0px 0px;
}

.health-tip-fullbleed-gradient-container {
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 60px 16px 0px;
    z-index: 0;
}

.health-tip-fullbleed-footer-container {
    position: absolute;
    bottom: 0px;
    width: 100%;
    top: auto;
}

.health-tip-publisher-container {
    padding: 16px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.health-tip-fullbleed-publisher-container {
    height: 38px;
    padding: 5px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.health-tip-publisher-container img, .health-tip-fullbleed-publisher-container img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 4px;
}

.health-tip-publisher-container.expert-tip-container img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-right: 4px;
}


.health-tip-title-container {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    overflow: hidden;
    -webkit-box-orient: vertical;
    padding: 0px 16px 0;
    font-weight: 600;
    font-size: ${H.ipv};
    line-height: ${H.yGZ};
}

.health-tip-publisher-container .health-tip-publisher-name, .health-tip-fullbleed-publisher-container .health-tip-publisher-name {
    font-size: ${H.sNp};
    line-height: ${H.vgC};
    font-weight: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.health-tip-fullbleed-title-container {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    overflow: hidden;
    -webkit-box-orient: vertical;
    padding: 5px 16px 0;
    height: 50px;
    font-weight: 600;
    font-size: ${H.PwC};
    line-height: ${H.b3W};
}

.health-tip-action-container {
    position: absolute;
    bottom: 0;
    z-index: 3;
}

.health-tip-action-container .action {
    margin-left: 6px;
    display: flex;
    align-center: center;
}

.health-tip-action-container , .health-tip-fullbleed-action-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 5px 16px 20px;
    font-size: ${H.cSu};
    line-height: ${H.RUt};
    font-weight: normal;
}

.health-tip-fullbleed-action-container .action {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.21);
    margin-right: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.health-tip-more-info {
    border-radius: 50%;
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 3;
}

.health-tip-more-info .toggle-button {
    border-radius: 50%;
    background: rgba(255,255,255,0.09);
    color: #fff;
    height: 24px;
    width: 24px;
    min-width: 24px;
}

.health-tip-more-info .toggle-button:hover {
    background: rgba(255,255,255,0.2);
}
`.withBehaviors((0,F.vF)(q)),j={experienceConfigSchema:o}},30113:function(e,t,i){var r;i.d(t,{m:function(){return r}}),function(e){e.small="OneByOne",e.medium="OneByTwo",e.large="OneByThree"}(r||(r={}))},11708:function(e,t,i){var r;i.d(t,{f:function(){return r}}),function(e){e.AiCharacter="aicharacterCardEnabled",e.AutosMarketplaceCard="autosmarketplaceCardEnabled",e.HoroscopeCard="horoscopeCardEnabled",e.WeatherCard="weatherCardEnabled",e.SportsCard="sportsCardEnabled",e.MoneyCard="moneyCardEnabled",e.FinanceCard="financeCardEnabled",e.OnThisDayCard="onthisdayCardEnabled",e.ShoppingCard="shoppingCardEnabled",e.ShoppingEventCard="eventSDCardShoppingEnabled",e.TrafficCard="trafficCardEnabled",e.EsportsCard="esportsCardEnabled",e.EsportsStreamsCard="esportsStreamsCardEnabled",e.ElectionsCard="genericelectionCardEnabled",e.LotteryCard="lotteryCardEnabled",e.QnaCard="qnaCardEnabled",e.RecipesCard="recipeCardEnabled",e.InspirationCard="inspirationCardEnabled",e.TravelCard="travelCardEnabled",e.HealthCard="healthCardEnabled",e.TopStoriesCard="topstoriesCardEnabled",e.TrendingTopics="TrendingTopicsUpsellEnabled",e.LocalGuideCard="localGuideCardEnabled",e.GroceryCard="groceryCardEnabled",e.RewardsCard="rewardsCardEnabled",e.RecommendedSearchesCard="recommendedSearchesCardEnabled",e.PersonalizedOffersCard="personalizedoffersCardEnabled",e.PollsCard="pollsCardEnabled",e.MarketPlaceCard="marketplaceCardEnabled",e.QuizCard="quizCardEnabled",e.CasualGamesCard="esportsCardEnabled",e.CommuteCard="commuteCardEnabled",e.Crypto="CryptoCard",e.MarketBrief="MarketBriefCard"}(r||(r={}))},83152:function(e,t,i){var r;i.d(t,{L:function(){return r}}),function(e){e.Location="Location",e.Weather="Weather",e.Finance="Finance",e.Team="Team",e.League="League",e.Player="Player",e.Traffic="Traffic",e.Widget="Widget",e.TopicFeed="TopicFeed"}(r||(r={}))},791:function(e,t,i){i.d(t,{N:function(){return T}});var r=i(33940),n=i(33954),a=i(26415),o=i(68364),s=i(33799),d=i(16517),h=i(94788),c=i(67267),l=i(63535),u=i(87298),p=i(83152),g=i(11708),v=i(30113),f=i(65135),y=i(33379),m=i(51671);const T=new class extends class{constructor(e){this.fetchImpl=e,this.userUpdateEndpoint="msn/user",this.pdpServiceEndpoint="graph/actions",this.locationsServiceEndPoint="v1/news/users/me/locations",this.userActionServiceEndPoint="news/users/me/actions",this.ocid="Peregrine",this.ocidOverride=!1}getUserDefaultLocation(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t={method:"GET",headers:yield c.$.getOneServiceHeaders(),credentials:"include"},i=(0,l.PH)(this.locationsServiceEndPoint);let n;[...c.$.getCommonParams2(this.ocid,!this.ocidOverride),{key:"autodetect",value:e&&`${e}`}].forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{n=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(i.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: getUserDefaultLocation}`;throw new Error(t)}return e}))),"getUserDefaultLocation")}catch(e){return n}return n}))}addToFavoriteLocation(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){const i="Location",n="Follow",a={method:"POST",body:JSON.stringify({actionType:n,targetType:i,definitionName:t,degree:"FavoriteLocation",metaData:e}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},o=(0,l.PH)(this.pdpServiceEndpoint);let h;((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{h=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,a);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: Location`;throw new Error(t)}return e.json()}))),"addToFavoriteLocation")}catch(e){return!1}return!0}))}removeFavoriteLocation(e){return(0,r.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}removeLocation(e){return(0,r.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}updatePdpHomeLocation(e,t,i={},n){return(0,r.mG)(this,void 0,void 0,(function*(){const a=p.L.Location,o="Follow",h=yield this.getRequestInit({method:"POST"},i);h.body=JSON.stringify({actionType:o,targetType:a,definitionName:t,degree:"DefaultLocation",metaData:e});const g=(0,l.PH)(this.pdpServiceEndpoint);return((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&g.searchParams.set(e.key,e.value)})),yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(g.href,h);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${a}`;throw new Error(t)}return e}))),"setPdpHomeLocation"),this.tryInvalidateBulkFetchedPdpTargetType(a),!0}))}updateTrafficMyRoutes(e,t,i,a,o,s){return(0,r.mG)(this,void 0,void 0,(function*(){const d=i.replace(/[^a-zA-Z0-9\-.,_]/g,""),h=p.L.Traffic,l="Follow",g={method:"POST",body:JSON.stringify({actionType:l,targetType:h,targetId:d,degree:e,definitionName:t,metadata:a,createdDateTime:s}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},v=yield this.getTrafficPdpUrl(null,null,o);try{yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(v.href,g);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${h}`;throw new Error(t)}return e.json()}))),"updateTrafficMyRoutes");this.tryInvalidateBulkFetchedPdpTargetType(h)}catch(e){return n.k.logError(e.message),!1}return!0}))}deleteTrafficMyRoutes(e,t,i){return(0,r.mG)(this,void 0,void 0,(function*(){const n={method:"DELETE",headers:yield this.getOneserviceHeaders(),credentials:"include"},a=yield this.getTrafficPdpUrl(e,t,i);try{yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(a.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"deleteTrafficFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Traffic)}catch(e){return!1}return!0}))}getTrafficMyRoutes(e,t){var i;return(0,r.mG)(this,void 0,void 0,(function*(){const n={method:"GET",headers:yield this.getOneserviceHeaders(),credentials:"include"},a=yield this.getTrafficPdpUrl(e,null,t);try{const e=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(a.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"getTrafficFromPdp");return null===(i=yield e.json())||void 0===i?void 0:i.value}catch(e){return null}}))}getTrafficPdpUrl(e,t,i){return(0,r.mG)(this,void 0,void 0,(function*(){const r=(0,l.PH)(this.pdpServiceEndpoint),n=(yield(0,m.XJ)())===s.Hy.SignedIn,a=(0,d.Yq)().UserId,o=n?c.$.getOneServiceParamsWithAuth(a,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(a,this.ocid,!this.ocidOverride);if(e||t){const i=`targetType eq '${p.L.Traffic}'`,n=e?`degree eq '${e}'`:"",a=t?`definitionName eq '${t}'`:"";r.searchParams.set("$filter",`actionType eq 'Follow' and (${i})${n?` and (${n})`:""}${a?` and (${a})`:""}`)}return[...o,...i||[]].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)})),r}))}addToWatchList(e,t=0,i={},n={}){return(0,r.mG)(this,void 0,void 0,(function*(){const a=p.L.Finance,o="Follow",h={method:"POST",body:JSON.stringify({actionType:o,targetType:a,targetId:e,metadata:Object.assign({securityType:t,tickerId:this.generateUUID()},n)}),headers:yield this.getOneserviceHeaders(i),credentials:"include"},g=(0,l.PH)(this.pdpServiceEndpoint),v="zh-cn"!==(0,d.Yq)().CurrentMarket;let f;((yield(0,m.XJ)())===s.Hy.SignedIn&&v?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&g.searchParams.set(e.key,e.value)}));try{f=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(g.href,h);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${a}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(a)}catch(e){return!1}return!0}))}addListToWatchList(e,t={},i={}){return(0,r.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,a="Follow",o={method:"POST",body:JSON.stringify(e.map((e=>({actionType:a,targetType:n,targetId:e.key,metadata:Object.assign({securityType:e.value,tickerId:this.generateUUID()},i)})))),headers:yield this.getOneserviceHeaders(t),credentials:"include"},h=(0,l.PH)(this.pdpServiceEndpoint),g="zh-cn"!==(0,d.Yq)().CurrentMarket;let v;((yield(0,m.XJ)())===s.Hy.SignedIn&&g?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)}));try{v=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(h.href,o);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(n)}catch(e){return!1}return!0}))}generateUUID(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))}sortWatchList(e,t={}){var i;return(0,r.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,a="Follow",o=yield T.readPdpWithTargetType(p.L.Finance,!0,200,t),h=o&&(null===(i=o.value)||void 0===i?void 0:i.filter((e=>e.actionType===a&&e.targetId)));if(!h||h.length<e.length)return!1;const g={};let v=e.length;h.forEach((t=>{let i=e.findIndex((e=>e===t.targetId));i<0&&(i=v,v++),g[t.targetId]=JSON.stringify({actionType:a,targetId:t.targetId,targetType:n,rank:i,metadata:t.metadata})}));const f={method:"PUT",body:JSON.stringify(g),headers:yield this.getOneserviceHeaders(t),credentials:"include"},y=(0,l.PH)(this.pdpServiceEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&y.searchParams.set(e.key,e.value)}));try{yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(y.href,f);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"sortWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Finance)}catch(e){return!1}return!0}))}updateWeatherInterests(e,t,i,a={},o){return(0,r.mG)(this,void 0,void 0,(function*(){const t=p.L.Weather,r={method:"POST",body:JSON.stringify({actionType:"Follow",targetType:t,targetId:e,metadata:{UserAction:{0:{UpdateTime:new Date,Location:i}}}}),headers:yield this.getOneserviceHeaders(a),credentials:"include"},h=(0,l.PH)(this.pdpServiceEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(h.href,r);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather interests call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateWeatherSettings(e,t,i={},n){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!t)return!0;let r="";r=e&&!t?'{"weatherDisplayUnit":"'+e+'"}':!e&&t?'{"userSettings":{"weatherLocationSettingMode":"'+t+'"}}':'{"weatherDisplayUnit":"'+e+'","userSettings":{"weatherLocationSettingMode":"'+t+'"}}';const a=yield this.getRequestInit({method:"POST"},i);a.body=r;const o=(0,l.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));const h=yield this.fetchImpl(o.href,a);if(h.status>=400){const e=`OneService returned error response. Status: ${h.status} for update weather setting call`;throw new Error(e)}return!0}))}updateFinanceInterests(e){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const t={financeInterests:e},i=JSON.stringify(t),r=yield this.getRequestInit({method:"POST"});r.body=i;const n=(0,l.PH)(this.userUpdateEndpoint),a="zh-cn"!==(0,d.Yq)().CurrentMarket;((yield(0,m.XJ)())===s.Hy.SignedIn&&a?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));const o=yield this.fetchImpl(n.href,r);if(o.status>=400){const e=`OneService returned error response. Status: ${o.status} for update finance interests call`;throw new Error(e)}return!0}))}updateUserSettings(e,t={},i){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!0;const r=[];let a;for(a in e)null!=e[a]&&r.push('"'+a+'": '+JSON.stringify(e[a]));const o='{"userSettings":{'+r.join(", ")+"}}",h=yield this.getRequestInit({method:"POST"},t);h.body=o;const u=(0,l.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=i?i:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=i?i:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&u.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(u.href,h);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}getPdpUserPreference(e,t={},i){return(0,r.mG)(this,void 0,void 0,(function*(){const a=yield this.getRequestInit({method:"GET"},t),o=(0,l.PH)(this.userUpdateEndpoint);[...(yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(i||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(i||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{const e=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,a);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!e.ok&&404!=e.status)throw Error(`code=${e.status}, ${e.statusText}`);return Object.assign(Object.assign({},yield e.json()),{is404:404==e.status})}catch(t){if(n.k.logError(t.message),e)throw Error(t.message);return null}}))}updatePdpLayoutPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t={method:"PUT",credentials:"include",body:JSON.stringify({dummyid:{userLayoutPreference:e}})},i=(0,l.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(i.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update layout preference setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateSegmentCardsEnableStatus(e,t=null){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const i=[];if(t){let e;for(e in t)null!=t[e]&&i.push('"'+e+'": '+JSON.stringify(t[e]))}const r=e.map((e=>e.cardType!=g.f.TopStoriesCard?`\\"${e.cardType}\\":${e.enabled?'\\"1\\"':'\\"0\\"'}`:"")).join(","),n=i.length>0?'{"segmentCardSettings":"{'+r+'}","userSettings":{'+i.join(", ")+"}}":'{"segmentCardSettings":"{'+r+'}"}';return this.updateUserPreference(n)}))}updateProductivityCardsEnableStatus(e){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{enterpriseCardsEnabled:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateGamingCardsEnableStatus(e){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{gamingCards:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateCommunitySettingsOptOutStatus(e){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t={};e.forEach((e=>{t[e.settingType]=e.optedOut?"1":"0"}));const i={communitySettings:t};return this.updateUserPreference(JSON.stringify(i))}))}updateWidgetSettings(e,t={},i){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const r=e.map((e=>({actionType:"Follow",targetId:e.cardType,targetType:p.L.Widget,metadata:{prongsv2:{region:e.region,size:v.m[e.size],position:e.position}}})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:i})}))}muteWidget(e,t={},i){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e||!e.length)return!1;const r=e.map((e=>({actionType:"Mute",targetId:e,targetType:p.L.Widget})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:i})}))}disableSpotlightCard(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const i={actionType:"Disabled",definitionName:e,targetType:p.L.TopicFeed};return this.sendGenericActionRequest({endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(i),appError:t})}))}enableSpotlightCard(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){return!!e&&(yield this.deleteFromPdp(p.L.TopicFeed,"definitionName",[e],{},void 0,"Disabled",t))}))}sendGenericActionRequest(e){return(0,r.mG)(this,void 0,void 0,(function*(){const{additionalHeaders:t,additionalParams:i,endpoint:n,method:a,payload:o,appError:h}=e;if(!n||!a)return this.logError(new Error("Missing arguments: 'endpoint' and 'method' should be provided and valid"),h),!1;const p=(0,l.PH)(n);let g;((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)})),i&&i.forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)}));try{JSON.parse(o),g=o}catch(e){g=JSON.stringify(o)}const v={method:a,body:g,headers:yield this.getOneserviceHeaders(t),credentials:"include"},f="GET"==a;try{return yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(p.href,v);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for payload: ${o}`;throw new Error(t)}return!f||(yield e.json())}))),"sendActions")}catch(e){return this.logError(e,h),!1}}))}getUserActions(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=[{key:"actionType",value:e}],i=yield this.sendGenericActionRequest({additionalParams:t,endpoint:this.userActionServiceEndPoint,method:"GET"});return i&&i.value}))}setUserAction(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){return!!(yield this.sendGenericActionRequest({endpoint:this.userActionServiceEndPoint,method:"POST",payload:Object.assign({actionType:e},t)}))}))}deleteUserAction(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){const i=[{key:"actionType",value:e},{key:"targetId",value:t.targetId},{key:"definitionName",value:t.definitionName}];return!!(yield this.sendGenericActionRequest({additionalParams:i,endpoint:this.userActionServiceEndPoint,method:"DELETE"}))}))}updateUserPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=yield this.getRequestInit({method:"POST"});t.body=e;const i=(0,l.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{const r=yield this.fetchImpl(i.href,t);if(r.status>=400){const t=`OneService returned error response while updating user preference. Status: ${r.status}, payload: ${e}`;throw new Error(t)}}catch(e){return!1}return!0}))}setPdpTargetTypesForBulkLoad(e){e&&e.length&&!this.bulkGraphActionTargetTypes&&(this.bulkGraphActionTargetTypes=e)}readPdpWithTargetType(e,t=!1,i,n={},o=!0,s=[]){return(0,r.mG)(this,void 0,void 0,(function*(){if(o){const t=yield this.getFromWebWorker(e);if(t)return t}if(this.bulkGraphActionTargetTypes&&this.bulkGraphActionTargetTypes.length)if(this.bulkGraphActionTargetTypes.indexOf(e)>=0){this.bulkGraphActionResultCache=this.bulkGraphActionResultCache||(yield this.bulkGraphActionPromise||(this.bulkGraphActionPromise=this.fetchPdpWithTargetTypes(this.bulkGraphActionTargetTypes,t,i,n,s)));const r=this.bulkGraphActionResultCache.get(e);if(r)return{value:r}}else f.M0.sendAppErrorEvent(Object.assign(Object.assign({},a.srQ),{message:`Received an unknown target type "${e}" that was not in the bulk graph action target types list "${this.bulkGraphActionTargetTypes}". Falling back to new network call. Please update the EntryPoint config's "graphActionsToBulkLoad" property to include this type.`}));const r=(yield this.fetchPdpWithTargetTypes([e],t,i,n,s)).get(e);if(r)return{value:r}}))}deleteFromPdp(e,t,i,n={},a,o="Follow",h,p=[]){return(0,r.mG)(this,void 0,void 0,(function*(){const g={method:"DELETE",headers:yield this.getOneserviceHeaders(n),credentials:"include"},v=(0,l.PH)(this.pdpServiceEndpoint),y=(yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),T=`targetType eq '${e}'`,b=i.map((e=>`${t} eq '${e}'`)).join(" or ");let O=`actionType eq '${o}' and (${b}) and (${T})`;a&&(O+=` and (degree eq '${a}')`),v.searchParams.set("$filter",O),[...y,...p].forEach((e=>{e.value&&v.searchParams.set(e.key,e.value)}));try{yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const t=yield this.fetchImpl(v.href,g);if(t.status>=400){const i=`OneService returned error response. Status: ${t.status} for actionType: ${o}, targetType: ${e}`;throw new Error(i)}return t}))),"deleteFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(e)}catch(e){return h&&f.M0.sendAppErrorEvent(Object.assign(Object.assign({},h),{pb:Object.assign(Object.assign({},h.pb),{actionType:o,error:e.message})})),!1}return!0}))}tryInvalidateBulkFetchedPdpTargetType(e){this.bulkGraphActionResultCache&&this.bulkGraphActionResultCache.delete(e)}fetchPdpWithTargetTypes(e,t=!1,i,n={},a=[]){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e.length)return new Map;const o=e.map((e=>`targetType eq '${e}'`)).join(" or "),h=[{key:"$top",value:`${i=i||10*e.length*2}`},{key:"$filter",value:`actionType eq 'Follow' and (${o})`}],p=yield this.getRequestInit({method:"GET"},n);!0===t&&(p.cache="no-store");const g=(0,l.PH)(this.pdpServiceEndpoint);[...h,...(yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...a].forEach((e=>{e.value&&g.searchParams.set(e.key,e.value)}));const v=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(g.href,p);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!v.ok)throw Error(`code=${v.status}, ${v.statusText}`);const f=new Map,y=yield v.json();if(!y)return f;if(y.value)for(const e of y.value){let t=f.get(e.targetType);t||f.set(e.targetType,t=[]),t.push(e)}for(const t of e)f.get(t)||f.set(t,[]);return f}))}updateMarketPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t={method:"POST",credentials:"include",body:JSON.stringify({userSettings:{preferredMarket:e}})},i=(0,l.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(i.href,t);if(!e.ok)throw new Error(`Failed to update market preference: Status: ${e.status}`);return!0}catch(e){return n.k.logError(e.message),!1}}))}getFromWebWorker(e){return(0,r.mG)(this,void 0,void 0,(function*(){let t=null;if(h.yb){const i=this.maptoWebWorkerId(e);if(i&&i.trim()){const i=yield(0,h.ot)({id:this.maptoWebWorkerId(e)});i.fetched&&(t=i.payload)}}return t}))}maptoWebWorkerId(e){switch(e){case p.L.Location:return"weatherpdp";case p.L.League:return"sportsleaguepdp";case p.L.Player:return"sportsplayerpdp";case p.L.Team:return"sportsteampdp";case p.L.Finance:return"moneypdp";default:return""}}getRequestInit(e={method:"GET"},t={}){return(0,r.mG)(this,void 0,void 0,(function*(){const i=yield c.$.getOneServiceHeaders();return e.headers=Object.assign(Object.assign({},i),t),e.credentials="include",e}))}getOneserviceHeaders(e={}){return(0,r.mG)(this,void 0,void 0,(function*(){const t=yield c.$.getOneServiceHeaders();return Object.assign(Object.assign({},t),e)}))}getFollowedLists(){return(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.getRequestInit({method:"GET"}),t=(0,l.PH)(this.userUpdateEndpoint);[...(yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}));try{const i=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const i=yield this.fetchImpl(t.href,e);if(!i.ok){if(i.status>=400&&i.status<500&&408!=i.status)return i;(0,o.OO)(null,a.G9t,"Error get followed list")}return i}))),"getFollowedLists");return i.ok||(0,o.OO)(null,a.G9t,"Error get followed list"),yield i.json()}catch(e){return n.k.logError(e.message),null}}))}addToFollowedLists(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,i={method:"POST",body:JSON.stringify({financeListIds:e}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},n=(0,l.PH)(this.userUpdateEndpoint);let a;((yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{a=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,i);if(e.status>=400){const i=`OneService returned error response. Status: ${e.status} for actionType: FollowList, targetType: ${t}`;throw new Error(i)}return e.json()}))),"addToFollowedLists")}catch(e){return!1}return!0}))}deleteFromFollowedLists(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,i={method:"DELETE",body:null,headers:yield c.$.getOneServiceHeaders(),credentials:"include"},n=(0,l.PH)(this.userUpdateEndpoint);let a;[...(yield(0,m.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...[{key:"financeListIds",value:e.toString()}]].forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{a=yield(0,u.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,i);if(e.status>=400){const i=`OneService returned error response. Status: ${e.status} for actionType: UnFollowList, targetType: ${t}`;throw new Error(i)}return e.json()}))),"deleteFromFollowedLists")}catch(e){return!1}return!0}))}logError(e,t){t?f.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e.message})})):n.k.logError(e.message)}}{constructor(){super((0,y.N)()?window.fetch.bind(window):fetch),"windowsNewsPlus"===d.jG.AppType||"newsAndInterests"===d.jG.AppType||"winWidgets"===d.jG.AppType?(this.ocid="winp2",this.ocidOverride=!0):"sharedWidgets"===d.jG.AppType?(this.ocid="hpwidget",this.ocidOverride=!0):"windowsNewsbar"===d.jG.AppType?(this.ocid="winp0dash",this.ocidOverride=!0):"travel"===d.jG.AppType?(this.ocid="travel-verthp-feeds",this.ocidOverride=!0):"gaming"===d.jG.AppType&&(this.ocid="startgg-feeds",this.ocidOverride=!0)}}}}]);A
Eo