forked from bombastictranz/bombastictranz
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchannel-store.03308b4344e574914fa0.js.download
1266 lines (1148 loc) · 429 KB
/
channel-store.03308b4344e574914fa0.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(self.webpackChunk_msnews_msnews_experiences=self.webpackChunk_msnews_msnews_experiences||[]).push([["channel-store","msnews/publishers-service-client","node_modules_fluentui_svg-icons_icons_checkmark_circle_20_regular_svg"],{91292:function(e,t,i){"use strict";i.r(t),i.d(t,{AccountSettingsTemplate:function(){return yc},ChannelStore:function(){return Lr},ChannelStoreStyles:function(){return Fr},ChannelStoreTemplate:function(){return kc},ContentTemplate:function(){return Sc},GlobalStyles:function(){return mr},LeftHeader:function(){return bc},LeftNavHeader:function(){return Cc},LeftNavTemplate:function(){return wc},OverlayTemplate:function(){return Tc},ToolingInfo:function(){return Ic},VerticalDivider:function(){return xc},notificationSettingsStyles:function(){return $r}});var n=i(41225),o=i(63070),r=i(17416),s=i(33940),a=i(42590),l=i(55024);class c extends l.b{constructor(){super(...arguments),this.speed=1200,this.headingLevel=3}}(0,s.gn)([a.Lj],c.prototype,"speed",void 0),(0,s.gn)([(0,a.Lj)({attribute:"heading-level",mode:"fromView",converter:a.Id})],c.prototype,"headingLevel",void 0),(0,s.gn)([a.Lj],c.prototype,"heading",void 0);var d=i(49218),p=i(41472),u=i(47548),h=i(95185),g=i(93703),f=i(20697);const v=d.dy`<template>${f.h}<div class="heading-container" part="heading-container"><span class="header"><slot name="icon"></slot><slot name="heading"><span class="heading" role="heading" aria-level=${e=>e.headingLevel}>${e=>e.heading}</span><slot name="details"></slot></slot><slot name="description"></slot></span><slot name="action"></slot></div><div class="scroll-area"><div part="scroll-view" class="scroll-view" @scroll="${e=>e.scrolled()}" ${(0,p.i)("scrollContainer")}><div class="content-container" part="content-container" ${(0,p.i)("content")}><slot ${(0,u.Q)({property:"scrollItems",filter:(0,h.R)()})}></slot></div></div>${(0,g.g)((e=>"mobile"!==e.view),d.dy`<div class="scroll scroll-prev" part="scroll-prev" ${(0,p.i)("previousFlipperContainer")}><div class="scroll-action" @click="${e=>e.scrollToPrevious()}"><slot name="previous-flipper"><fluent-flipper direction="previous"></fluent-flipper></slot></div></div><div class="scroll scroll-next" part="scroll-next" ${(0,p.i)("nextFlipperContainer")}><div class="scroll-action" @click="${e=>e.scrollToNext()}"><slot name="next-flipper"><fluent-flipper></fluent-flipper></slot></div></div>`)}</div>${f.z}</template>`;var m=i(30857),y=i(94585),b=i(16549),w=i(7771),S=i(78923);const C=S.i`
${w.W} :host{--scroll-fade-next:${m.I}}.heading-container{display:grid;grid-template-columns:1fr auto;margin:0 0 12px}::slotted([slot="action"]){display:flex;align-items:flex-end}::slotted([slot="icon"]){margin-inline-end:8px}.header,.header ::slotted(h1),.header ::slotted(h2),.header ::slotted(h3),.header ::slotted(h4),.header ::slotted(h5),.header ::slotted(h6){font-size:var(--stripe-heading-font-size,${y.m});
line-height: var(--stripe-heading-line-height, ${y.I});font-weight:600;margin:0}::slotted([slot="description"]){font-size:${b.s};
line-height: ${b.v};
margin: 8px 0 0;
}
`;var x=i(26810);const T=c.compose({name:`${x.j.prefix}-stripe`,template:v,styles:C});var k=i(64546);var I,P,$=i(27545),F=i(70041),L=i(523),E=i(57663),R=i(5232),A=i(33779),O=i(5302),M=i(34800),U=i(42780),D=i(65683),N=i(242),H=i(72465),_=i(44132);!function(e){e[e.init=0]="init",e[e.subsequent=1]="subsequent",e[e.refresh=2]="refresh"}(I||(I={})),function(e){e.Long="long",e.Short="short"}(P||(P={}));var j,B=i(5813),z=i(22471);!function(e){e.InterestsNeedRefresh="interests-need-refresh",e.VideoGameInterestFollowed="video-game-interest-followed",e.GamingFeedEngagement="gaming-feed-engagement"}(j||(j={}));var q=i(45970),G=i(81489),W=i(52185);const V=(0,G.h)({getInstance:()=>W.Gq.get("__feed-card-provider__serviceRequestAuthSubscription__",(()=>new q.X))}),K="userIsSignedIn";var Q,J,Z,X;!function(e){e.activityId="x-client-activityid",e.authorization="Authorization",e.entAuthorization="Ent-Authorization",e.muid="MUID",e.adsReferer="ads-referer",e.taboolaSessionId="taboola-sessionId"}(Q||(Q={})),function(e){e.actionType="actionType",e.activityId="activityId",e.adsTimeout="adsTimeout",e.apiKey="apikey",e.audienceMode="audienceMode",e.aver="aver",e.bypassTrigger="bypass_trigger",e.cacheBypassQueryStringParamName="cbypass",e.channel="channel",e.channels="channels",e.cm="cm",e.complexInfoPaneEnabled="cipenabled",e.contentType="contentType",e.delta="delta",e.devicetype="devicetype",e.disableContent="disablecontent",e.dhp="dhp",e.disableTypeSerialization="DisableTypeSerialization",e.duotone="duotone",e.edgExpMask="edgExpMask",e.gamingInterestId="gamingInterestId",e.infopaneCount="infopaneCount",e.fcl="fcl",e.fdhead="fdhead",e.feedParams="feedParams",e.feedLayoutRequestType="t",e.filter="$filter",e.followersCount="followersCount",e.ids="ids",e.infoPaneItemCount="t =InfoPane.itemCount",e.location="location",e.market="market",e.memory="memory",e.newsTop="newsTop",e.newsSkip="newsSkip",e.ocid="ocid",e.oem="oem",e.oneSvcUni="OneSvc-Uni-Feat-Tun",e.over="over",e.overlay="overlay",e.parentContentId="parent-content-id",e.parentNamespace="parent-ns",e.parentTitle="parent-title",e.queryQ="q",e.query="query",e.queryType="queryType",e.qScope="qscope",e.responseSchema="responseSchema",e.satoriId="satoriId",e.select="$select",e.session="session",e.signInCookieName="scn",e.skip="$skip",e.smode="smode",e.source="source",e.targetType="targetType",e.theme="theme",e.timeOut="timeOut",e.top="$top",e.type="type",e.User="User",e.user="user",e.userid="userid",e.usri="usri",e.wpoitems="wpoitems",e.wpoPageId="wpopageid",e.wpoSchema="wposchema",e.wrapOData="wrapodata",e.caller="caller",e.installedWidgets="installedWidgets",e.clientLayoutVersion="clv",e.pageConfiguration="pgc",e.requestId="rid",e.interestIds="InterestIds",e.providerId="ProviderId",e.includeFollowingFilters="iff",e.freScenario="freScenario",e.freMode="freMode",e.mobile="mobile",e.clientLocation="clientLocation",e.clientLocationProvider="clientLocationProvider",e.clientLocationAccuracy="clientLocationAccuracy",e.clientLocationTimeStamp="clientLocationTimeStamp",e.collectionIds="collectionIds",e.endTime="EndTime",e.eventType="EventType",e.exchangeCode="ExchangeCode",e.listIds="listIds",e.requireQuoteDetail="requireQuoteDetail",e.skipNum="skip",e.startTime="StartTime",e.topNum="top",e.prerender="prerender",e.layout="layout",e.triggerModules="triggerModules",e.promoXFeed="promoxfeedupsell",e.canid="canid",e.edgeNoAds="edgenoads",e.edgeReduceAds="edgereduceads",e.edgeMobile="edgeMobile",e.private="private",e.viewportSize="vpSize",e.removeStoryCarousel="efc",e.promotion="promotion",e.selection="selection",e.cardIds="cardIds",e.renderedSegments="renderedSegments",e.column="column",e.colstatus="colstatus",e.colwidth="colwidth",e.adoffsets="adoffsets",e.l3v="l3v",e.cookieWallPresent="cookieWallPresent",e.anaheimPageLayout="anaheimPageLayout",e.adRefreshVariant="adRefreshVariant",e.gdpr="gdpr",e.verticalName="verticalName",e.pageOcid="pageOcid",e.scenario="scenario",e.segment="segment",e.backgroundImageIsSet="backgroundImageIsSet",e.inEdgeFeatures="inEdgeFeatures",e.revertTimes="revertTimes",e.adminDisabled="adminDisabled"}(J||(J={})),function(e){e[e.oneService=0]="oneService",e[e.wpoService=1]="wpoService"}(Z||(Z={})),function(e){e.Bgtask="bgtask",e.Api="api",e.App="app",e.RetryFetch="retryFetch",e.Scroll="scroll"}(X||(X={}));var Y=i(35448),ee=i(62907),te=i(7733),ie=i(59878),ne=i(28951);class oe{static get UpsellGamerMode(){return oe.upsellGamerMode}static set UpsellGamerMode(e){oe.upsellGamerMode=e}}var re=i(42833),se=i(7766),ae=i(88048),le=i(22680),ce=i(21215),de=i(62328),pe=i(17395),ue=i(95540),he=i(77062),ge=i(17813),fe=i(38773),ve=i(22624),me=i(95603);const ye="gaming",be="following",we="filteredChannels",Se="outlookchannels";function Ce(e){return!(null==e||""===e||"string"!=typeof e&&"number"!=typeof e||isNaN(e))}var xe;!function(e){async function t(e,t,n){const o=new te.h((0,le.zp)()),r=E.jG.UserId,{CurrentRequestTargetScope:s={},WidgetAttributes:a={},CurrentMarket:l}=E.jG;let c=t&&t.flightData;if(a.telemetry&&a.telemetry.tmpl&&a.telemetry.tmpl.includes("pwbingads2")){const e="prg-binghplite";c=c?`${c},${e}`:e}let d=new te.h(e);if(t.nextPageUrl){if(d=new te.h(new URL(t.nextPageUrl).search),!E.jG.SendFeedCallActivityIdInHeader&&E.jG.ActivityId){const e=ie.Al.CurrentFlightSet.has("prg-prsw");"channel"===E.jG.AppType||"winWidgets"===E.jG.AppType&&d.get("activityId")||e&&"edgeChromium"===E.jG.AppType&&d.get("activityId")||d.set("activityId",E.jG.ActivityId)}}else{const e=await(0,pe.XJ)()===ee.Hy.SignedIn;V.publish(K,{isSignedIn:e,src:"main"});(e?se.$D.getOneServiceParamsWithAuth(r,t.ocid,!1,c||null):se.$D.getOneServiceParamsWithoutAuth(r||t.muidFallback&&`m-${E.jG.ActivityId}`,t.ocid,!1,c||null)).forEach((e=>e.value&&d.set(e.key,e.value))),d.set("contentType",t.contentType),t.requestType===Z.wpoService&&function(e,t,i,n){"startgg-feeds"===e.ocid?t.set("apikey",B.xE):t.set("apikey",B.GR);(e.useDelta||e.sessionId)&&(t.set("delta","true"),e.sessionId&&t.set("session",e.sessionId));t.get("newsTop")||"channel"===E.jG.AppType||t.set("newsTop",Ce(e.numberOfCards)?e.numberOfCards:"48");t.get("newsSkip")||"channel"===E.jG.AppType||t.set("newsSkip","0");e.feedId||t.get("infopaneCount")||"channel"===E.jG.AppType||t.set("infopaneCount",`${Ce(e.infopaneCount)?e.infopaneCount:B.di}`);if(!t.get("User")){const e=t.get("userid");e?t.set("User",`m-${e}`):(t.set("User",i),null===i&&function(e,t){_.M0.sendAppErrorEvent({...O.jAy,message:"Cannot get MUID.",pb:{...O.jAy.pb,customMessage:`${e}; ProbableCause: cannot access cookie`,url:t,activityId:E.jG.ActivityId}})}("Using OneServiceUrl",n))}t.delete("user")}(t,d,r,n);if(t.feedName&&"default"!=t.feedName&&t.feedName===ye){const e=o.get("gamingInterestId");if(e)d.set("query",e);else{const e=window.widget__query??t.query;d.set("query","string"==typeof e?e:"core gaming");const i=window.widget__interestIds??t.interestIds;i&&(d.delete("query"),d.set("InterestIds",i));const{pageType:n}=a;"gamingfeed-widget"===n&&d.set("wpopageid","wponoads");const o=window.widget__satoriId;"string"==typeof o&&d.set("satoriId",o)}}t.feedName===Se&&(d.set("channels","true"),d.set("followersCount","true"),d.set("iff","true")),t.feedName===be&&"skype-desktop-following"===t.ocid&&d.set("renderedSegments","FollowCarousel");const i="true"===ne.c.getQueryParameterByName("channels_available",window.location.href);("osmhp"===t.pageScenario&&"1s-excludefc"===t.flightData||i)&&d.set("efc","true")}const p=(t.feedName===be||t.feedName===we)&&"skype-desktop-following"!==t.ocid;if(t.feedId){const e=t.useProviderKey||p&&!t.feedId.startsWith("Y_")?"ProviderId":"InterestIds";d.set(e,t.feedId)}1===t.edgeMobile&&d.set("edgeMobile","1"),p&&d.set("iff","true");const u=o.get("OneSvc-Uni-Feat-Tun");u?d.set("OneSvc-Uni-Feat-Tun",u):"url"===W.Gq.get("oneSvcUniTunMode")&&d.set("OneSvc-Uni-Feat-Tun",await se.$D.getUniFeatTunHeader()),!0===t.disableContent&&d.set("disablecontent","true"),t.edgExpMask&&d.set("edgExpMask",t.edgExpMask),t.adsTimeout&&d.set("adsTimeout",t.adsTimeout.toString()),t.timeoutMs&&d.set("timeOut",t.timeoutMs.toString());const h=(0,he.Ee)();h>0&&d.set("cbypass",h.toString()),t.wpoPageId&&("wpoads"===t.wpoPageId.toLowerCase()&&"en-us"!==(null==l?void 0:l.toLowerCase())?d.set("wpopageid","wponoads"):d.set("wpopageid",t.wpoPageId)),t.wpoSchema&&d.set("wposchema",t.wpoSchema),t.newsTop&&"channel"!==E.jG.AppType&&d.set("newsTop",t.newsTop.toString()),t.newsSkip&&null==t.nextPageUrl&&"channel"!==E.jG.AppType&&d.set("newsSkip",t.newsSkip.toString()),(t.enableRightRailColumn||t.renderSingleColumn||t.renderEnterpriseSingleColumn)&&d.set("wpopageid",t.wpoPageId),t.installedWidgets&&t.installedWidgets.length&&d.set("installedWidgets",t.installedWidgets.join(",")),t.clientLayoutVersion&&d.set("clv",t.clientLayoutVersion),t.layout&&d.set("layout",t.layout),E.jG.SendFeedCallActivityIdInHeader&&d.delete("activityId"),E.jG.SendUserIdInHeader&&d.delete("User"),(0,ce.N)()?t.isRetry?d.set("caller","retryForTimeout"):t.refreshType&&d.set("caller",t.refreshType):d.set("caller","ssr"),t.isDhp&&d.set("dhp","1"),t.isXFeed&&d.set("rid",t.requestId),t.private&&d.set("private","1"),t.viewportSize&&d.set("vpSize",t.viewportSize),t.apiKey&&d.set("apikey",t.apiKey),t.audienceMode&&(d.set("audienceMode",(null==s?void 0:s.audienceMode)||t.audienceMode),t.audienceMode===Y.F.Kids&&i()&&(d.set("apikey",B.os),d.set("ocid",B.vy))),t.feedId&&t.feedName===be&&i()&&(d.set("ocid",B.i9),d.set("apikey",B.S1));const g=(0,fe.UU)();if(t.feedName===ye&&"anaheim-ntp-feeds"===t.ocid&&g&&(d.set("ocid",B.$v),d.set("apikey",B.gr)),t.enableWpoAdPlacements){const e=ie.Al.ClientSettings.browser&&"true"===ie.Al.ClientSettings.browser.ismobile||"phone"===ie.Al.ClientSettings.deviceFormFactor?"true":"false";d.set("mobile",e);const t=(0,ue.rv)()||(0,ue.hI)();d.set("cookieWallPresent",t.toString())}const f=o.get("wpoitems");f&&d.set("wpoitems",f.toString());const v=o.get("bypass_trigger");v&&!t.feedId&&d.set("bypass_trigger",v.toString());const m=oe.UpsellGamerMode&&t.feedName===ye,y="prg-gmode-upsell";E.jG.ShouldUseFdheadQsp&&m?d.set("fdhead",`${t.fdhead},${y}`):E.jG.ShouldUseFdheadQsp&&t.fdhead?d.set("fdhead",t.fdhead):m&&d.set("fdhead",y),(0,ge.TR)()&&d.set("prerender","1"),t.adRefreshVariant&&d.set("adRefreshVariant",t.adRefreshVariant),t.anaheimPageLayout&&d.set("anaheimPageLayout",t.anaheimPageLayout),t.gdpr&&d.set("gdpr","1"),t.verticalName&&d.set("verticalName",t.verticalName),t.freScenario&&d.set("freScenario",t.freScenario),t.freMode&&d.set("freMode",t.freMode),t.aver&&d.set("aver",t.aver),t.theme&&d.set("theme",t.theme),t.over&&d.set("over",t.over),t.oem&&d.set("oem",t.oem),t.devicetype&&d.set("devicetype",t.devicetype),t.smode&&d.set("smode",t.smode),t.usri&&d.set("usri",t.usri),t.duotone&&d.set("duotone",t.duotone.toString()),t.cardIds&&d.set("cardIds",t.cardIds),t.column&&d.set("column",t.column),t.fcl&&d.set("fcl","true"),t.layout&&d.set("layout",t.layout),t.colstatus&&d.set("colstatus",t.colstatus),t.colwidth&&d.set("colwidth",t.colwidth.toString()),t.adoffsets&&d.set("adoffsets",t.adoffsets),t.l3v&&d.set("l3v",t.l3v.toString()),"freinterests"===t.pageScenario&&(t.start&&d.set("$skip",`${t.start}`),t.count&&d.set("$top",`${t.count}`),t.InterestIds&&d.set("InterestIds",`${t.InterestIds}`)),"number"==typeof t.pageConfiguration&&d.set("pgc",t.pageConfiguration.toString());const b=window&&window.navigator&&window.navigator.deviceMemory;b&&"channel"!==E.jG.AppType&&d.set("memory",b.toString());(ie.Al.CurrentFlightSet.has("prg-forcenoads")||await(0,fe.VS)())&&d.set("edgenoads","1");(ie.Al.CurrentFlightSet.has("prg-forceredads")||await(0,fe.OM)())&&d.set("edgereduceads","1"),t.anaheimLayoutPromotion&&d.set("promotion",t.anaheimLayoutPromotion),t.anaheimContentSelection&&d.set("selection",t.anaheimContentSelection),void 0!==t.backgroundImageIsSet&&d.set("backgroundImageIsSet",t.backgroundImageIsSet.toString()),void 0!==t.inEdgeFeatures&&d.set("inEdgeFeatures",t.inEdgeFeatures.toString()),t.revertTimes&&d.set("revertTimes",t.revertTimes),void 0!==t.adminDisabled&&d.set("adminDisabled",t.adminDisabled.toString()),t.pageOcid&&d.set("pageOcid",t.pageOcid),t.segment&&d.set("segment",t.segment),t.scenario&&d.set("scenario",t.scenario);const w=ie.Al.ClientSettings&&ie.Al.ClientSettings.queryparams?ie.Al.ClientSettings.queryparams:"",S=new te.h(w).get("canid");S&&d.set("triggerModules","promoxfeedupsell".concat(":",S)),await async function(e,t){const i=e.feedName===be;i&&_.M0.addOrUpdateTmplProperty("following-feed","1");const n=i||"default"===e.feedName&&e.enableFREOverlayMyFeed;if("edgeChromium"===E.jG.AppType&&n&&(ie.Al.EdgeNTPHeader||await ve.L.isApiAvailableToUse())){var o;let i=ie.Al.EdgeNTPHeader&&ie.Al.EdgeNTPHeader.freSeenCount&&ie.Al.EdgeNTPHeader.freSeenCount.toString();if(!i&&await ve.L.isApiAvailableToUse()){const e=await ve.L.getPreferenceSetting(me.nc.seen_interest_fre_count,!0);i=e&&e.value?e.value.toString():"0"}let n=null===(o=ie.Al.EdgeNTPHeader)||void 0===o?void 0:o.newProfFreTime;if(!n){var r,s,a;const e=new re.o;if(null===(r=window)||void 0===r||null===(s=r.chrome)||void 0===s||null===(a=s.ntpSettingsPrivate)||void 0===a||a.getConfigData((t=>e.set(t&&t.newProfileFreSeenTime||null))),n=await e.getResultAsync(),!n){var l;let e=null===(l=ie.Al.EdgeNTPHeader)||void 0===l?void 0:l.seenNewDevFre;if(void 0===e){var c,d,p,u;const t=new re.o;if(null===(c=window)||void 0===c||null===(d=c.chrome)||void 0===d||null===(p=d.ntpSettingsPrivate)||void 0===p||p.getPref(me._9.hasUserSeenNewFre,(e=>t.set(null==e?void 0:e.value))),e=await t.getResultAsync(),n=e&&(null===(u=ie.Al.EdgeNTPHeader)||void 0===u?void 0:u.newDevFreTime),e&&!n){var h,g,f;const e=new re.o;null===(h=window)||void 0===h||null===(g=h.chrome)||void 0===g||null===(f=g.ntpSettingsPrivate)||void 0===f||f.getConfigData((t=>e.set(t&&t.newDeviceFreSeenTime||null))),n=await e.getResultAsync()}}}}const v=n&&Date.now()-n<864e5,m=ne.c.getQueryParameterByName("firstlaunch",window.location.href);(e.doNotTriggerFREInSession||"1"===m||v)&&(i="10"),_.M0.addOrUpdateTmplProperty("freoverlay-ux","1"),(e.sendFRESeenCount&&e.enableFREOverlayMyFeed&&"default"===e.feedName||e.feedName===be&&e.sendFRESeenCount)&&t.set("overlay",i)}}(t,d);const C=ne.c.getParamsWithItems(location.search);if(C){const e=C.find((e=>"idxContentTypeOverride"===e.key));if(e){const i=t.contentType?t.contentType:"article,video,slideshow",n=[...new Set(`${i},${e.value}`.split(","))];d.set("contentType",n.join(","))}const i=C.find((e=>"installedWidgetsOverride"===e.key));i&&i.value&&d.set("installedWidgets",i.value)}const x=new URLSearchParams((0,le.zp)()).get("feedParams");if(x){x.split(",").forEach((e=>{if(e.includes("=")){const[t,i]=e.split("=");d.set(t.trim(),i.trim())}}))}return d.toString()}function i(){return"channel"!==E.jG.AppType}e.requestInit=async function(e){e=e||{};const t={method:"GET"},i=await se.$D.getOneServiceFeedCallHeaders((0,de.VQ)(),e.feedName,e.useXboxAccessToken);t.headers={...i,...e.additionalHeaders},e.credentialsOverride?t.credentials=e.credentialsOverride:t.credentials="include",e.enableWpoAdPlacements&&(t.headers["ads-referer"]=location.href,t.headers["taboola-sessionId"]=e.taboolaSessionId||"init");const n=E.jG.UserId;return e.requestType!==Z.wpoService||n||(t.headers.MUID=E.jG.ActivityId),E.jG.SendUserIdInHeader&&(t.headers.MUID=n),t},e.buildRequestURLForOneService=async function(e){let i,n;if((e=e||{}).feedName===be)n=e.feedId?B.eK:B.ly;else n=e.pageScenario;const o=`${B.lP}${n}`;return i=new te.h((0,le.zp)()).get(B.YU)?new URL(o,B.LJ):(0,ae.fU)(o),i.search=await t(i.search,e,i.href),i.searchParams.sort(),i},e.buildServiceRequestURL=async function(e){let i;e=e||{};const{CurrentRequestTargetScope:n={},ConfigServiceBaseUrl:o}=E.jG,r=new te.h((0,le.zp)());let s=e.pageScenario??(e.shouldUseNewWpoEndpoint?B.bx:B.$s);"ntp"===e.pageScenario&&e.useWebLayoutEndpoint&&(s=B.UY);let a=e.requestPathOverride?`${e.requestPathOverride}${s}`:`${B.Mo}${s}`;a=function(e){return e&&e===`${B.Mo}${B.bx}`&&ie.Al&&ie.Al.CurrentFlightSet&&ie.Al.CurrentFlightSet.has(B.CO)&&"edgeChromium"===E.jG.AppType?`${B.hk}${B.bx}`:e}(a);const l=e.feedName&&"default"!=e.feedName;if(e.feedId||l)switch(e.feedName){case we:a=`${B.Mo}${B.Td}`;break;case be:var c,d,p;if(e.feedId)a=`${B.Mo}${B.eK}`,_.M0.addOrUpdateTmplProperty("filtered-feed","1"),(null!==(c=e.nextPageUrl)&&void 0!==c&&c.includes(B.ly)||null===(d=e.nextPageUrl)||void 0===d||!d.includes(e.feedId))&&(e.nextPageUrl="");else a=`${B.Mo}${B.ly}`,null!==(p=e.nextPageUrl)&&void 0!==p&&p.includes(B.eK)&&(e.nextPageUrl="");break;case ye:a=`${B.Mo}${B.I1}`;break;case"sports":a=`${B.Mo}${B.Qn}`;break;case Se:a=`${B.Mo}${Se}`;break;default:a="work"===e.feedSource?`${B.Mo}${B.UW}`:`${B.Mo}${B.J8}`}e.isXFeed&&e.xFeedPageScenario&&(a=`${B.Mo}${e.xFeedPageScenario}`);const u=(0,ce.N)();if(u&&["enabled","true"].includes(r.get(B.YU)))e.audienceMode===Y.F.Kids||(null==n?void 0:n.audienceMode)===Y.F.Kids||e.feedId?i=new URL(B.SO,B.LJ):(a=`${B.lP}${s}`,i=new URL(a,B.LJ));else if(u&&"enabled"===r.get(B.P$))i=new URL(a,o.origin);else if(function(e){return!e&&"edgeChromium"===E.jG.AppType&&E.jG.OneServiceOverride&&ie.Al&&ie.Al.CurrentFlightSet&&ie.Al.CurrentFlightSet.has(B.IA)}(u))a=`${B.L3}${B.bx}`,i=new URL(a,E.jG.OneServiceOverride);else{const t=e.domainOverride?e.domainOverride:(0,ae.qQ)().origin;i=new URL(a,t)}return i.search=await t(i.search,e,i.href),i.searchParams.sort(),i}}(xe||(xe={}));var Te,ke,Ie,Pe=i(32308),$e=i(66258);!function(e){e[e.InvalidRequest=0]="InvalidRequest",e[e.Success=1]="Success",e[e.NoContent=2]="NoContent",e[e.Failed=3]="Failed"}(Te||(Te={})),function(e){e[e.FromSSR=0]="FromSSR",e[e.FromCache=1]="FromCache",e[e.FromWW=2]="FromWW",e[e.FromEarlyResponse=3]="FromEarlyResponse",e[e.FromServer=4]="FromServer"}(ke||(ke={})),function(e){e.river="river",e.rightRail="rightrail",e.Rail="Rail"}(Ie||(Ie={}));var Fe=i(84381);function Le(e,t){e&&(e.startsWith("1s-")?t.oneSFlights.push(e):e.startsWith("prg-")&&(e.startsWith("prg-1sw")?t.prg1swFlights.push(e):e.startsWith("prg-1s")?t.prg1sFlights.push(e):t.prgOnlyFlights.push(e)))}var Ee,Re=i(82588),Ae=i(5884),Oe=i(63228),Me=i(15598),Ue=JSON.parse('{"nextPageUrl":"","sections":[{"region":"river","subSections":[{"dataTemplate":"msft-full-wide-one-card-five-col","layoutTemplate":"msft-full-wide-one-card-five-col","cards":[{"type":"followCarousel","isLocalContent":false,"galleryItemCount":0,"subCards":[],"subscriptionProductType":"undefined","position":0,"notificationState":"undefined","isWorkNewsContent":false,"isShowSelectMoreMessage":false}]},{"dataTemplate":"msft-full-wide-one-card-five-col","layoutTemplate":"msft-full-wide-one-card-five-col","cards":[{"type":"InterestManager","isLocalContent":false,"galleryItemCount":0,"subscriptionProductType":"undefined","position":0,"notificationState":"undefined","isWorkNewsContent":false}]}]}],"isPartial":false}'),De=JSON.parse('{"nextPageUrl":"","sections":[{"region":"river","subSections":[{"dataTemplate":"msft-full-wide-one-card-five-col","layoutTemplate":"msft-full-wide-one-card-five-col","cards":[{"type":"filteredChannels","isLocalContent":false,"galleryItemCount":0,"subCards":[],"subscriptionProductType":"undefined","position":0,"notificationState":"undefined","isWorkNewsContent":false,"isShowSelectMoreMessage":false}]},{"dataTemplate":"msft-full-wide-one-card-five-col","layoutTemplate":"msft-full-wide-one-card-five-col","cards":[{"type":"InterestManager","isLocalContent":false,"galleryItemCount":0,"subscriptionProductType":"undefined","position":0,"notificationState":"undefined","isWorkNewsContent":false}]}]}],"isPartial":false}');!function(e){e[e.IsInfopaneDenseCard=0]="IsInfopaneDenseCard",e[e.IsRiverDenseCard=1]="IsRiverDenseCard",e[e.NotDenseCard=2]="NotDenseCard"}(Ee||(Ee={}));const Ne={liked:"like",unliked:"unlike",saved:"save"},He=[M.PL.AutosCarousel,M.PL.AutosEntityList,M.PL.AutosGarageCard,M.PL.BeaconProviderUpsell,M.PL.BingDailyQuizCard,M.PL.BingHealthCovid19StatsCard,M.PL.BingHealthFitnessCard,M.PL.BingThisOrThatCard,M.PL.BingVideoCarousel,M.PL.CasualGamesCarousel,M.PL.ChannelCarousel,M.PL.ChannelFilterCard,M.PL.CommunityCard,M.PL.CommuteCard,M.PL.CompanyNewsCard,M.PL.DigestCard,M.PL.DonationNpoCard,M.PL.EdgeShoppingCard,M.PL.Elections,M.PL.EntertainmentPremierCard,M.PL.EsportsCasualGames,M.PL.EsportsLiveStream,M.PL.EsportsMatch,M.PL.EsportsTournament,M.PL.EventSDCardElectionMIT1,M.PL.EventSDCardElectionMIT2,M.PL.EventSDCardElectionMIT3,M.PL.EventSDCardOscarsPrm,M.PL.EventSDCardShopping,M.PL.EventSDCardSportsMIT1,M.PL.EventSDCardSportsMIT2,M.PL.EventSDCardSportsMIT3,M.PL.EventSDCardWorldCup,M.PL.EventSDCardWorldCup2,M.PL.FinanceHeroMarket,M.PL.FinanceHeroNews,M.PL.FinanceHeroMovers,M.PL.FinanceHerowlsummary,M.PL.FinanceHeroSuggested,M.PL.FinanceHeroWatchlistIdeas,M.PL.FinanceHeroUpcomingEarnings,M.PL.FinanceHeroCurrencies,M.PL.FinanceHeroCrypto,M.PL.GamingClip,M.PL.GamingClipsCarousel,M.PL.GamingCompete,M.PL.GamingGamerModeUpsellCard,M.PL.GamingHighlight,M.PL.GamingHighlightClipsCarousel,M.PL.GamingHighlightsCarousel,M.PL.GamingInterestGroup,M.PL.GamingLiveStream,M.PL.GamingLiveStreamCarousel,M.PL.GamingMatch,M.PL.GamingRecentlyPlayed,M.PL.GamingRecommendedGames,M.PL.GamingReddit,M.PL.GamingRewards,M.PL.GamingTournament,M.PL.GamingUpcomingGames,M.PL.GamingVideoCarousel,M.PL.GamingVod,M.PL.GroceryCouponSdCard,M.PL.HealthTipCard,M.PL.Horoscope,M.PL.HotListCard,M.PL.IndustryNewsCard,M.PL.Inspiration,M.PL.InterestManagementCard,M.PL.LeadGenCard,M.PL.LinkedInCard,M.PL.LocalNewsFeed,M.PL.Lottery,M.PL.MangaCard,M.PL.Marketplace,M.PL.MarketplaceEvent,M.PL.MicrosoftFeedCard,M.PL.MobileRewardsCard,M.PL.MobileShoppingCard,M.PL.MobileShoppingCard2,M.PL.MobileShoppingCard3,M.PL.MobileShoppingCard4,M.PL.MoneyCrypto,M.PL.MoneyInfo,M.PL.MoneyMarketBrief,M.PL.MoneyPreWL,M.PL.MoneyTopicStripe,M.PL.MyBriefRiverCard,M.PL.OnThisDay,M.PL.PrayerTimesCard,M.PL.PrismCarouselCard,M.PL.Qna,M.PL.RealEstateCard,M.PL.Recipes,M.PL.RecommendedInterests,M.PL.RecommendedSearchCarousel,M.PL.Rewards,M.PL.RewardsDailyCheckinCard,M.PL.RewardsDailySet,M.PL.RichCalendarCard,M.PL.SectionHeader,M.PL.ShoppingProng2c,M.PL.ShoppingCard,M.PL.ShoppingCarousel,M.PL.ShoppingRiver,M.PL.SportsHeroFre,M.PL.SportsHeroMatchStatistics,M.PL.SportsHeroNews,M.PL.SportsHeroSeasonStatistics,M.PL.SportsHeroStandingsRankings,M.PL.SportsHeroTeamVsTeam,M.PL.SportsHeroVideo,M.PL.SportsMatch,M.PL.SportsOlympics,M.PL.SportsTopicStripe,M.PL.StockQuote,M.PL.SuperListCard,M.PL.TabbedInfopaneCard,M.PL.TopStories,M.PL.TopicFeed,M.PL.TrafficDelays,M.PL.TrafficIncidents,M.PL.TrafficCameras,M.PL.TrafficCamerasWithSummary,M.PL.TravelTimesWithSummary,M.PL.TrafficMap,M.PL.TrafficNews,M.PL.TrafficInfo,M.PL.Transit,M.PL.TravelDestinationCard,M.PL.TravelDestinationCarouselCard,M.PL.TravelInspirationCard,M.PL.Trending,M.PL.TrendingInTenMinutes,M.PL.TrendingSearchCard,M.PL.TrendingTopics,M.PL.Upsell,M.PL.UserInterestNTPProvider,M.PL.UserInterestProvider,M.PL.UserInterestTopic,M.PL.UserInterestTopicAndProvider,M.PL.VideoShoppingCard,M.PL.VideoShoppingCarouselCard,M.PL.WeatherSummary,M.PL.WeatherHero,M.PL.WidgetsNotificationsCard,M.PL.quizcard];var _e=i(83614);var je=function(e){var t=e.length;return t?e[(0,_e.Z)(0,t-1)]:void 0},Be=i(84977);var ze=function(e){return je((0,Be.Z)(e))},qe=i(92170);var Ge=function(e){return((0,qe.Z)(e)?je:ze)(e)};class We{constructor(){this.infoPaneCardCount=0,this.riverCardCount=0,this.rightrailCardCount=0,this.railCardCount=0,this.denseRiverCardCount=0,this.riverNativeAdRelativeCount=0,this.riverCmsAdRelativeCount=0,this.infopaneCmsAdCount=0,this.sectionIndex=0,this.mapRegionBasedWpoResponseForSuperFeed=(e,t,i,n,o)=>{if(!e||!e.sections.length)return{rawAdRegionTupleMap:Ve()};this.rawAdRegionTupleMap=Ve();const r={rawAdRegionTupleMap:this.rawAdRegionTupleMap},s=e.serviceContext?e.serviceContext.debugId:e.debugId,a=function(e){if(e.sections[0].region)return e;return{nextPageUrl:e.nextPageUrl,sections:[{region:"river",subSections:e.sections}],previews:e.previews,pageContext:e.pageContext}}(e),{nextPageUrl:l,sections:c,pageContext:d,previews:p}=a,u=this.riverCardCount,h=this.riverNativeAdRelativeCount;let g,f;const v=c.findIndex((e=>"cardData"===e.region));if(v>-1){const{cardsList:t,subSections:i}=Ke(e,u);g=t,f=i,c.splice(v,1)}return r.nextPageUrl=l,r.pageContext=d,r.previews=p,r.regions=c.map((e=>{const{subSections:r,region:a,requestedColumnCount:c}=e;let d;if(v>-1&&"river"===a){d=[{dataTemplate:undefined,layoutTemplate:undefined,cards:g.map((e=>this.convertCardForSuperFeed({...e,placement:void 0},a,s,void 0,t,i,n,o,u,h))),column:c,columnLayoutList:f}]}else d=null==r?void 0:r.map((e=>{let{dataTemplate:r,layoutTemplate:c,cards:d,column:p}=e;if(d){const e={dataTemplate:r,layoutTemplate:c,cards:d.map((e=>this.convertCardForSuperFeed({...e,placement:void 0},a,s,void 0,t,i,n,o,u,h))),column:p};return this.sectionIndex++,e}"river"===a&&_.M0.sendAppErrorEvent({...O.gEs,message:"No cards were sent from WPO in river",pb:{...O.gEs.pb,customMessage:`debugId: ${s}, nextPageUrl: ${l}, column: ${p}, dataTemplate: ${r}, layoutTemplate: ${c}`}})})).filter((e=>void 0!==e));return{region:a,requestedColumnCount:c,sections:d}})),r.raw1sAdRegionTupleMap=this._raw1sAdRegionTupleMap,r.debugId=s,r},this.backfill1SAdWithNews=e=>{var t,i,n,o,r,s,a;if(null===(t=e.sections)||void 0===t||!t.length)return;const l=null===(i=e.sections.find((e=>"backup"===e.region)))||void 0===i||null===(n=i.subSections)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.cards,c=null===(r=e.sections.find((e=>"river"===e.region)))||void 0===r||null===(s=r.subSections)||void 0===s||null===(a=s[0])||void 0===a?void 0:a.cards;null==c||c.forEach(((e,t)=>{(e.type===M.PL.NativeAd&&ne.c.getQueryParameterByName("mockNo1SNative",window.location.href)||e.type===M.PL.CmsAd&&ne.c.getQueryParameterByName("mockNo1SCms",window.location.href))&&(e.data=null),e.type!==M.PL.NativeAd&&e.type!==M.PL.CmsAd||e.data||((0,A.OO)(null,O.paG,`Ad for ${e.type} not found in feed response.`,`cardData: ${JSON.stringify(e)}`),null!=l&&l.length?c[t]=l.shift():(0,A.OO)(null,O.G78,"Empty backup region"))}))}}get raw1sAdRegionTupleMap(){return this._raw1sAdRegionTupleMap||(this._raw1sAdRegionTupleMap=Ve()),this._raw1sAdRegionTupleMap}convertCardForSuperFeed(e,t,i,n,o){let r,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0;if("river"===t?(this.riverCardCount++,r=this.riverCardCount):"rightrail"===t?(this.rightrailCardCount++,r=this.rightrailCardCount):"Rail"===t&&(this.railCardCount++,r=this.railCardCount),void 0!==e.wpoRank&&(e.wpoRank+=l),void 0!==e.wpoId&&(e.wpoId+=l),void 0!==e.wpoAdRank&&(e.wpoAdRank+=c),Object.values(M.PL).includes(e.type)||(0,A.OO)(null,O.nsS,`${e.type} undefined error, it is not in OneServiceMetadataType`),e.subCards){let t=Ee.NotDenseCard;if(e.type===M.PL.Dense&&n===M.PL.Infopane?t=Ee.IsInfopaneDenseCard:e.type===M.PL.Dense&&n!==M.PL.Infopane&&(t=Ee.IsRiverDenseCard),e.type===M.PL.Infopane||e.type===M.PL.GroupedContent||e.type===M.PL.ColdStartArticleFreCard||e.type===M.PL.RewardsDailySet||e.type===M.PL.TabbedInfopaneCard||t!==Ee.NotDenseCard)return this.convertComplexCardForSuperFeed(e,t,i,o,a);if("TopStories"===e.subType)return this.convertNestedCard(e);if(e.type===M.PL.NewsAnswerModule)return this.convertNewsGroupsCard(e)}if(He.includes(e.type))return e;if(M.TU.includes(e.type)){let i=r;return"river"===t&&(e.type===M.PL.NativeAd?this.riverNativeAdRelativeCount++:e.type===M.PL.CmsAd&&(this.riverCmsAdRelativeCount>=s?(e.type=M.PL.NativeAd,this.riverNativeAdRelativeCount++):this.riverCmsAdRelativeCount++),o&&(i=e.type===M.PL.FirstPartyAd?1:e.type===M.PL.NativeAd?this.riverNativeAdRelativeCount:this.riverCmsAdRelativeCount)),this.convertCardForAds(e,t,i)}try{const{augments:t,type:n,isBreaking:o,locale:r,category:s,images:a,topics:l=[],dataUrl:c,publishedDateTime:d,id:p,url:u,abstract:h="",title:g="",provider:f={},reasons:v,source:m,feed:y={},actions:b=[],externalVideoFiles:w=[],reactionStatus:S,commentStatus:C,reactionSummary:x,commentSummary:T,sourceId:k,topComments:I,topQuestions:P,highlights:$,colorSamples:F,isLocalContent:L,badges:E,relatedCards:R,recoDocMetadata:A,recoId:O,ri:U,offer:D,subType:N,videoMetadata:H,isWorkNewsContent:_,wpoMetadata:j,panoCaption:B,aiComments:z,height:q,wpoRank:G,wpoId:W}=e,V=Ze(a)||{},K=l.find((e=>e.feedId===y.id&&e.locale===r)),Q=n===M.PL.EventInfopaneShoppingAI?Je(u,/[/?]/):Je(u);let J=Qe(f.logoUrl);!J&&f.logo&&f.logo.url&&(J=Qe(f.logo.url));const Z=b.map((e=>Ne[e]||e));return E&&E.some((e=>"followedPublisher"===e.type))&&Z.push("followedPublisher"),{augments:t,id:p,type:n,height:q,wpoRank:G,wpoId:W,metadata:{abstract:h,abstractLength:h.length,titleLength:g.length,category:s||Q[4],subCategory:Q[5],primaryImage:{height:V.height,width:V.width},locale:r,feed:{id:y.id},kicker:[y],actions:Z,reactionStatus:S,commentStatus:C,reactionSummary:x,commentSummary:T,topComments:I,topQuestions:P,highlights:$,reasons:v,source:m,relatedCards:R,panoCaption:B,topics:l,recoDocMetadata:A,recoId:O,ri:U,debugId:i,videoFiles:w,videoMetadata:H,wpoMetadata:j},cardContent:{id:p,type:Xe(n),title:g,aiComments:z,uriTitle:Q[6],abstract:h,isBreaking:o||0,tags:[K||{}],provider:{id:f.id,name:f.name,logo:{id:J},profileId:f.profileId,logoUrl:f.logoUrl,subscribable:!1,lightThemeSVGLogo:f.lightThemeSVGLogo,darkThemeSVGLogo:f.darkThemeSVGLogo},category:{product:s,label:void 0},locale:r,images:[{id:Qe(V.url),height:V.height,width:V.width,caption:V.title,focalRegion:V.focalRegion,attribution:V.attribution,url:V.url,colorSamples:V.colorSamples}],panoCaption:B,videoFiles:w,publishedDateTime:d,kicker:g,sourceHref:c,destinationUrl:u,sourceId:k,colorSamples:F,isLocalContent:L,isWorkNewsContent:_,badges:E,topics:l},offer:D,subType:N}}catch(t){return e}}convertCardForAds(e,t,i){return e.type===M.PL.NativeAd?("river"===t?e.data?this.raw1sAdRegionTupleMap.get("river").push(e.wpoAdRank||i):this.rawAdRegionTupleMap.get("river").push(e.wpoAdRank||i):"rightrail"===t?this.rawAdRegionTupleMap.get("rightrail").push(i):"Rail"===t&&this.rawAdRegionTupleMap.get("Rail").push(i),e.data?{type:M.PL.NativeAd,regionIndex:e.wpoAdRank||i,data:e.data,id:e.id,height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}:{type:M.PL.NativeAd,regionIndex:e.wpoAdRank||i,placement:{items:[]},height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}):e.type===M.PL.CmsAd?("river"===t&&(e.data?this.raw1sAdRegionTupleMap.get("resriver").push(i):this.rawAdRegionTupleMap.get("resriver").push(i)),e.data?{type:M.PL.CmsAd,regionIndex:e.wpoAdRank||i,data:e.data,id:e.id,height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}:{type:M.PL.CmsAd,regionIndex:e.wpoAdRank||i,placement:{items:[]},height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}):e.type===M.PL.FirstPartyAd?("river"===t&&(e.data?this.raw1sAdRegionTupleMap.get("triver").push(e.wpoAdRank||i):this.rawAdRegionTupleMap.get("triver").push(e.wpoAdRank||i)),e.data?{type:M.PL.FirstPartyAd,regionIndex:e.wpoAdRank||i,data:e.data,id:e.id,height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}:{type:M.PL.FirstPartyAd,regionIndex:e.wpoAdRank||i,placement:{items:[]},height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}):e.type===M.PL.AmplifyAd||e.type===M.PL.BoostAdsBanner||e.type===M.PL.BoostAdsCoachmark||e.type===M.PL.EventSDCardAmplifyAds||e.type===M.PL.BoostAd?{type:e.type,regionIndex:e.wpoAdRank||i,data:e.data,id:`${e.type}-${e.section}-${i}`,wpoMetadata:e.wpoMetadata,height:e.height,wpoRank:e.wpoRank,wpoAdRank:e.wpoAdRank,wpoId:e.wpoId}:void 0}convertComplexCardForSuperFeed(e,t,i,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const{id:r,type:s,title:a,wpoMetadata:l}=e;let c,d;try{c=e.subCards.map((e=>{if(t===Ee.IsInfopaneDenseCard){if(e.type===M.PL.NativeAd)return this.rawAdRegionTupleMap.get("infopane-tab").push(this.infoPaneCardCount),{type:M.PL.NativeAd,regionIndex:this.infoPaneCardCount,placement:{items:[]}}}else if(t===Ee.IsRiverDenseCard){if(this.denseRiverCardCount++,e.type===M.PL.NativeAd)return this.rawAdRegionTupleMap.get("dense-river").push(this.denseRiverCardCount),{type:M.PL.NativeAd,regionIndex:this.denseRiverCardCount,placement:{items:[]}}}else{if(this.infoPaneCardCount++,e.type===M.PL.NativeAd)return this.rawAdRegionTupleMap.get("infopane").push(this.infoPaneCardCount),{type:M.PL.NativeAd,regionIndex:this.infoPaneCardCount,placement:{items:[]}};if(e.type===M.PL.CmsAd){let t="resinfopane";return this.infopaneCmsAdCount>=o&&(e.type=M.PL.NativeAd,t="infopane"),this.rawAdRegionTupleMap.get(t).push(this.infoPaneCardCount),{type:e.type,regionIndex:this.infoPaneCardCount,placement:{items:[]}}}if(e.type===M.PL.BuyDirectAd){const t="infopane";return this.rawAdRegionTupleMap.get(t).push(this.infoPaneCardCount),{type:e.type,regionIndex:this.infoPaneCardCount,placement:{isBuyDirect:!0,items:[]}}}if(e.type===M.PL.EventInfopaneShoppingAI)try{const t=JSON.parse(e.data),i=Ge(t);delete e.data,e={...i,...e}}catch(e){return}}if(e.type===M.PL.Dense||e.type===M.PL.TopicFeed||e.type===M.PL.TabbedInfopaneCardTab){let t=Ee.IsInfopaneDenseCard;return s!==M.PL.Infopane&&s!==M.PL.TabbedInfopaneCard&&(t=Ee.IsRiverDenseCard),this.convertComplexCardForSuperFeed(e,t,i,n)}return this.convertCardForSuperFeed(e,"none",i,s,n)}))}finally{var p;c=(null===(p=c)||void 0===p?void 0:p.filter((e=>!!e)))||[],d={id:r,type:s,subItems:c,metadata:{title:a},wpoMetadata:l,height:e.height,wpoRank:e.wpoRank,wpoId:e.wpoId},e.type===M.PL.TopicFeed&&(d={id:r,type:s,subItems:c,metadata:{title:a},wpoMetadata:l,feed:e.feed?e.feed:null,height:e.height,wpoRank:e.wpoRank,wpoId:e.wpoId})}return d}convertNestedCard(e){return e.subCards[0].type=e.type,e.subCards[0].subType=e.subType,e=e.subCards[0]}convertNewsGroupsCard(e){return{id:e.id,type:e.type,subType:e.subType,subCards:e.subCards||[],wpoMetadata:e.wpoMetadata,height:e.height,wpoRank:e.wpoRank,wpoId:e.wpoId}}resetCardCountForSuperFeed(){this.infoPaneCardCount=0,this.riverCardCount=0,this.rightrailCardCount=0,this.railCardCount=0,this.denseRiverCardCount=0,this.riverNativeAdRelativeCount=0,this.riverCmsAdRelativeCount=0}}function Ve(){return new Map([["rightrail",[]],["Rail",[]],["infopane",[]],["river",[]],["resinfopane",[]],["resriver",[]],["infopane-tab",[]],["dense-river",[]],["triver",[]]])}const Ke=(e,t)=>{const i=null==e?void 0:e.sections,n=i.find((e=>"river"===e.region)).subSections,o=i.find((e=>"cardData"===e.region)).cards,r=[];for(const e of n)null!=e&&e.requestedColumnCount&&(null==e||e.subSections.forEach((e=>{e.cards.forEach((e=>{e.wpoId+=t,e.wpoRank+=t}))})),r[e.requestedColumnCount-1]=null==e?void 0:e.subSections);return{cardsList:o,subSections:r}};function Qe(e){if(!e)return"";const t=e.split("/");return Ze(t)&&t[t.length-1].replace(".img","")}function Je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return e?e.split(t):[]}function Ze(e){if(e)return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0]}function Xe(e){switch(e){case M.PL.Article:return"ArticlePreview";case M.PL.Video:return"VideoPreview";case M.PL.Slideshow:return"SlideshowPreview";case M.PL.WebContent:return"WebContentPreview";default:return""}}var Ye=i(33928),et=i(85663),tt=i(95378),it=i(15675),nt=i(80293),ot=i(16495),rt=i(60804);const st="Wpo.Treatments.StoreInit",at="Wpo.Treatments.Parsed",lt="Wpo.Treatments.Stored",ct="ssr-feed-data";class dt{constructor(){this.wpoOptimizationsReady=new Promise((e=>this.wpoOptimizationsResolver=e)),this.wpoFeedDataCache=new nt.v("WpoFeedDataCache"),this.enableEarlyMainFeedRequest=!1,this.earlyFeedResponsePromiseV2=new re.o,this.usePromiseForEarlyFeed=!1}static getInstance(){return W.Gq.get("__WpoServiceClient__",(()=>new dt))}onWPOFeedReady(e){this.wpoFeedDataCache.subscribe(ct,e)}setSSRInitialFeedResponse(e){this.wpoFeedDataCache.set(ct,e)}resetFeedDataCache(){this.wpoFeedDataCache.clear()}addWpoOptimizationDataToLocalStorage(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5?arguments[5]:void 0;const s=(0,rt._)(t,i);if(this.optimizationDataReceived)return;if(!e||!e.optimizationItems)return void(r&&"wpo"===r.source&&this.removeWPOUserChoiceFromPSL());if(!e.optimizationItems.length)return this.logAppError(O.lGs,"WPO Optimization data is empty in feed response ",`isFocusedMode:${n}`),(0,Me.$o)().removeItem(s),void(r&&"wpo"===r.source&&this.removeWPOUserChoiceFromPSL());const a=(0,N.Ou)();a[st]=Math.round(performance.now());try{const t=this.parseOptimizationItems(e.optimizationItems),i={treatments:t};a[at]=Math.round(performance.now()),(0,Me.$o)().setObject(s,i),a[lt]=Math.round(performance.now()),this.optimizationDataReceived=!0;const n=t.filter((e=>{var t;return((null==e?void 0:e.type)===it._h.topSites||(null==e?void 0:e.type)===it._h.topsitesCollapse)&&(null==e||null===(t=e.properties)||void 0===t?void 0:t.topSitesCollapsibleControlConfig)}));var l,c,d;if(window.isSSREnabled&&null==r)if(null!=n&&n.length&&null!==(l=n[0])&&void 0!==l&&null!==(c=l.properties)&&void 0!==c&&null!==(d=c.topSitesCollapsibleControlConfig)&&void 0!==d&&d.collapsibleControlIsDefaultCollapsed){const e={setting:me.nc.tscollapsed,source:"wpo",timestamp:(new Date).getTime(),value:1};ve.L.savePreferenceSetting(me.nc.tscollapsed,e)}if("wpo"===(null==r?void 0:r.source)&&0==(null==n?void 0:n.length)&&this.removeWPOUserChoiceFromPSL(),o){var p;const e=t.filter((e=>{var t;return(null==e?void 0:e.type)===it._h.layoutPromotion&&"PageContentLayout"===(null==e||null===(t=e.properties)||void 0===t?void 0:t.layoutType)}));if(null==e||!e.length||null===(p=e[0])||void 0===p||!p.properties)return void ot.U.savePreferenceSetting(me.Xm.layoutPromotion,null);ot.U.savePreferenceSetting(me.Xm.layoutPromotion,e[0].properties)}}catch(t){const i=`Failed to store wpo response to LS.Error:${t}`,n=`WpoServiceResponse: ${JSON.stringify(e)}. key: ${s}`;this.logAppError(O.pOl,i,n)}}setShouldUsePromiseForEarlyFeed(e){this.usePromiseForEarlyFeed||(this.usePromiseForEarlyFeed=e)}storeEarlyWpoFeedData(e){this.usePromiseForEarlyFeed?this.earlyFeedResponsePromiseV2.set(e):this.wpoFeedDataCache.set("feed-ready",e)}getEarlyWpoFeedData(e){if(this.usePromiseForEarlyFeed){let t;const i=new Promise((i=>{t=setTimeout((()=>{const t=`Getting early main feed v2 timeout in ${e}ms`;this.logAppError(O.$HJ,t),i(void 0)}),e||1e4)}));return Promise.race([this.earlyFeedResponsePromiseV2.getResultAsync(),i]).finally((()=>clearTimeout(t)))}return new Promise((t=>{let i;const n=e=>{i&&clearTimeout(i),this.wpoFeedDataCache.unsubscribe("feed-ready",n),this.wpoFeedDataCache.delete("feed-ready"),t(e)};e&&(i=setTimeout((()=>{this.wpoFeedDataCache.unsubscribe("feed-ready",n),this.wpoFeedDataCache.delete("feed-ready");const i=`Getting early main feed timeout in ${e}ms`;this.logAppError(O.$HJ,i),t(void 0)}),e)),this.wpoFeedDataCache.subscribe("feed-ready",n)}))}storeWpoOptimizationData(e){if(e)if(this.wpoOptimizations&&this.wpoOptimizations.length>0)this.wpoOptimizationsResolver();else{try{this.wpoOptimizations=this.parseOptimizationItems(e.pageContext&&e.pageContext.optimizationItems)}catch(t){const i=`Failed to store wpo response to Memory.Error:${t}`,n=`WpoServiceResponse: ${JSON.stringify(e)}.`;this.logAppError(O.yPw,i,n)}this.wpoOptimizationsResolver()}}isShorelineTriggerEnabled(e){var t,i;const n=this.parseOptimizationItems(e.pageContext&&e.pageContext.optimizationItems).filter((e=>(null==e?void 0:e.type)===it._h.shorelineTrigger)),o=!(null==n||null===(t=n[0])||void 0===t||null===(i=t.properties)||void 0===i||!i.trigger);return o&&_.M0.addOrUpdateTmplProperty("shoreline_trigger","1"),o}getWpoOptimizationData(e){if(e){let t;const i=new Promise((i=>{t=setTimeout((()=>{_.M0.addOrUpdateTmplProperty("wpoPromoTimeout",e.toString()),i()}),e)}));return Promise.race([i,this.wpoOptimizationsReady]).then((()=>(clearTimeout(t),this.wpoOptimizations)))}return this.wpoOptimizationsReady.then((()=>this.wpoOptimizations))}tryToGetWpoOptimizationData(){return this.wpoOptimizations}logAppError(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";_.M0.sendAppErrorEvent({...e,message:t,pb:{...e.pb,customMessage:i}})}parseOptimizationItems(e){if(!e||!e.length)return[];return e.map(((e,t)=>{if(e.type&&e.type.trim().length)if(Object.values(it._h).includes(e.type)||this.logAppError(O.OE6,`Unknown Type in WPO optimization items. Type: ${e.type}, Index: ${t}`),e.data){if(e.type&&e.data){let i;try{if(i=JSON.parse(e.data),!Object.entries(i).length)return void this.logAppError(O.OnJ,`Parsed WPO Optimization item but it is empty. Type: ${e.type}, Index: ${t}`)}catch(i){return void(0,A.OO)(i,O.X1V,`${i}. Type: ${e.type}, Index: ${t}`)}if(i)return{type:e.type,properties:i}}}else this.logAppError(O.uSS,`Unable to find data in WPO optimization item. Type: ${e.type}, Index: ${t}`);else this.logAppError(O._wC,`Type not found in WPO optimization items. Index: ${t}`)})).filter(Boolean)}isOptimizationDataReceived(){return this.optimizationDataReceived}removeWPOUserChoiceFromPSL(){ve.L.deleteKeyValueFromPSL(me.nc.tscollapsed)}}const pt=(0,G.h)(dt),ut="gaming",ht=["cbypass","activityId","prerender","timeOut","caller","infopaneCount","edgExpMask","skipRetry","dhp","overlay"];function gt(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null==e||!e.serviceContext)return;const o=n.filter((e=>ie.Al.CurrentFlightSet.has(e))),r=(null===(t=e.serviceContext.fdHead)||void 0===t||null===(i=t.split(","))||void 0===i?void 0:i.map((e=>e.trim())))??[],s=o.filter((e=>!r.includes(e)));s.length>0&&_.M0.sendAppErrorEvent({...O.YVN,pb:{...O.YVN.pb,cetoRef:e.cetoRef,msEdgeRef:e.msEdgeRef,message:`Flight ids ${s.join(",")} missing in wpo fdhead.`}})}class ft{constructor(e,t){this.shouldRetryInOtherDomain=!1,this.traceInfo=[],this.shouldResetRightRailPromise=!1,this.wpoRightRailPromise=new re.o,this.shouldResetRailPromise=!1,this.wpoRailPromise=new re.o,this.noContentRetryCount=0,this.maxContentRetryCount=5,this.isPartialResponse=e=>!!(e&&e.serviceContext&&e.serviceContext.preRenderDisabled),this.getAuthTrail=()=>{try{return(0,Ye.pD)()}catch{_.M0.sendAppErrorEvent({...O.evM,message:"Error throwed when getCompressedRecords doesn't return anything for NTP"})}},this.mapperHelper=new We,this.config=e,this.initializeRequest(),this.isXFeed=t}async fetch(e,t,i,n,o){let r=this.config.initialRequest;if(this.shouldResetRightRailPromise&&(this.wpoRightRailPromise=new re.o,this.shouldResetRightRailPromise=!1),this.shouldResetRailPromise&&(this.wpoRailPromise=new re.o,this.shouldResetRailPromise=!1),e&&(e.feedId||e.nextPageUrl||(e.feedId=r.feedId),r={...r,...e}),!r)return _.M0.sendAppErrorEvent({...O.eD0,message:"default WpoService fetch configuration was invalid"}),this.responseStatus=Te.InvalidRequest,{status:this.responseStatus,isStatic:this.isStatic,regions:void 0,rawAdRegionTupleMap:new Map([["rightRail",[]],["Rail",[]],["infopane",[]],["river",[]],["resinfopane",[]],["resriver",[]],["infopane-tab",[]]])};const s=await this.fetchRiverSectionFeedLayoutData(r,t,i);return t===I.init&&s&&s.serviceContext&&(!function(e){const{debugId:t,fdHead:i,fdFlightingVersion:n,requestHeaderMuid:o}=e||{},{CurrentFlightSet:r,ClientSettings:s}=ie.Al;if(!(0,ce.N)()||!r||r.size<1||!s||!(0,Fe.g)(5))return;const{requestMuid:a,requestTrailInfo:l}=s,c=null==l?void 0:l.flightVersion,d=null==a?void 0:a.toLowerCase(),p=null==o?void 0:o.replace(/-/g,"").toLowerCase();d&&p&&p!==d&&(0,A.H)(O.Zdq,"Muid mismatch between PCS and 1S",void 0,{pcsMuid:d,oneServiceMuid:p});const u=i&&i.toLocaleLowerCase().split(",");if(!u)return;const h={prg1sFlights:[],prg1swFlights:[],prgOnlyFlights:[],oneSFlights:[]};for(const e of r)u.includes(e)||Le(e,h);const g={prg1sFlights:[],prg1swFlights:[],prgOnlyFlights:[],oneSFlights:[]};u.forEach((e=>{r.has(e)||Le(e,g)}));const{prg1sFlights:f=[],prg1swFlights:v,prgOnlyFlights:m,oneSFlights:y}=g,{prg1sFlights:b,prg1swFlights:w,prgOnlyFlights:S,oneSFlights:C}=h,x={pcsFlightBlobVersion:c,oneServicefdHeadVersion:n,pcsMuid:d,oneServiceMuid:p,oneServiceDebugId:t};(f.length>0||b.length>0)&&(0,A.H)(O.jcj,"prg-1s-* flight mismatch between PCS and 1S",void 0,{flightNotPresentInPcs:f,flightNotPresentIn1S:b,commonProps:x}),(v.length>0||w.length>0)&&(0,A.H)(O.tNY,"prg-1sw-* flight mismatch between PCS and 1S",void 0,{flightNotPresentInPcs:v,flightNotPresentIn1S:w,commonProps:x}),(m.length>0||S.length>0)&&(0,A.H)(O.qjh,"prg-* flight mismatch excluding prg-1s-* and prg-1sw-* between PCS and 1S",void 0,{flightNotPresentInPcs:m,flightNotPresentIn1S:S,commonProps:x}),(y.length>0||C.length>0)&&(0,A.H)(O.KzD,"1s-* flight mismatch between PCS and 1S",void 0,{flightNotPresentInPcs:y,flightNotPresentIn1S:C,commonProps:x})}(s.serviceContext),ie.Al.CurrentFlightSet.has("1s-ads-ntpriver")&>(s,["1s-ads-ntpriver","prg-ad-ridoverride"])),t!==I.init||(0,ce.N)()||(s?pt.setSSRInitialFeedResponse(s):_.M0.sendAppErrorEvent({...O.y6M,pb:{...O.y6M.pb,requestId:r.requestId}})),this.handleResponseMapForSuperFeed(r,s,n,o)}overrideAppErrorSeverity(e){if("hub"===E.jG.AppType&&[O.vas,O.ck_,O.KEP,O.QJe].includes(e))return D.z.Critical}sendAppErrorWithSeverityOverride(e,t){const i=this.overrideAppErrorSeverity(e);i&&(t.severity=i),_.M0.sendAppErrorEvent(t)}handleResponseMapForSuperFeed(e,t,i,n){var o;if(this.isPartialResponse(t))return{status:this.responseStatus,isStatic:!1,rawAdRegionTupleMap:new Map([["rightRail",[]],["Rail",[]],["infopane",[]],["river",[]],["resinfopane",[]],["resriver",[]],["infopane-tab",[]]]),isPartial:t.isPartial,serviceContext:t.serviceContext,previews:t.previews};const r=new Set(["msft-dense-nine-card"]);(null==t||null===(o=t.sections)||void 0===o?void 0:o.length)>0&&"river"===t.sections[0].region&&t.sections[0].subSections.forEach(((e,i)=>{var n;r.has(e.layoutTemplate)&&(t.sections[0].subSections[i].cards=[{type:"densetab",isLocalContent:!1,galleryItemCount:0,subCards:e.cards}]),(null==e||null===(n=e.cards)||void 0===n?void 0:n.length)>0&&e.cards.forEach(((e,n)=>{var o,r;if((null==e?void 0:e.type)===M.PL.Infopane&&(null==e||null===(o=e.subCards)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.type)===M.PL.TabbedInfopaneCardTab){const o=function(e){const t=[];let i=[];for(let n=0;n<e.length;n++){const o=e[n];if(o.type==M.PL.TabbedInfopaneCardTab)i.push(o);else if(o.type==M.PL.TopicFeed)i.push(o);else{if(i.length>0){const e={type:M.PL.TabbedInfopaneCard,subCards:i};t.push(e),i=[]}t.push(o)}}return t}(null==e?void 0:e.subCards);t.sections[0].subSections[i].cards[n]={...e,subCards:o}}}))}));const s=this.mapperHelper.mapRegionBasedWpoResponseForSuperFeed(t,this.config.useRelativeAdPlacement,i,n,this.config.auctionRidOverride&&!(0,ge.TR)()),{nextPageUrl:a,regions:l,rawAdRegionTupleMap:c,raw1sAdRegionTupleMap:d,previews:p,pageContext:u,debugId:h}=s;let g;this.responseStatus===Te.Success?(g={...e,nextPageUrl:a},this.noContentRetryCount=0):this.responseStatus===Te.Failed?(g={...e},this.noContentRetryCount=0):this.responseStatus===Te.NoContent&&(this.noContentCannotRetry()||(g={...e},this.noContentRetryCount++),_.M0.sendAppErrorEvent({...O.a$Z,pb:{...O.a$Z.pb,isFirstPage:!e.nextPageUrl,url:e.nextPageUrl,requestId:e.requestId,status:this.responseStatus,noContentRetryCount:this.noContentRetryCount}}));return{regions:l,nextPageRequest:g,rawAdRegionTupleMap:c,raw1sAdRegionTupleMap:d,status:this.responseStatus,isStatic:this.isStatic,traceIdIndex:t?t.traceIdIndex:void 0,metadata:t?t.metadata:void 0,userType:t?t.userType:void 0,previews:p,pageContext:u,debugId:h,serviceContext:t?t.serviceContext:void 0,responseSource:t?t.responseSource:void 0}}async fetchRiverSectionFeedLayoutData(e,t,i){const n=(null===ie.Al||void 0===ie.Al?void 0:ie.Al.IsPrerender)||this.config.disableWorker,o=t===I.init||t===I.refresh;if((0,ce.N)()&&o){var r;const t=function(){if(!(0,ce.N)()||!window.ssrWpoData)return;const e=window.ssrWpoData;gt(e,["prg-wpo-bkpncbig","prg-wpo-ntpscssr"]);const{debugId:t,traceIdIndex:i,dddTmpl:n}=e;return(0,he.Dz)(t,!0),_.M0.addOrUpdateIdxId(i,!0),_.M0.addOrUpdateTmplString(n),delete window.ssrWpoData,e}();if(t)return t&&t&&t.sections&&t.sections.length>0?this.responseStatus=Te.Success:this.responseStatus=Te.NoContent,W.Gq.set("__isSSRWpoFeedConsumed__",!0),{...t,responseSource:ke.FromSSR};if(!W.Gq.has("__isSSRWpoFeedConsumed__")&&null!==(r=window.ssrLayoutState)&&void 0!==r&&r.selectedFeedDisplaySetting){const t=window.ssrLayoutState.selectedFeedDisplaySetting;["off","onscroll","headingsonly"].includes(t)||_.M0.sendAppErrorEvent({...O.W1B,pb:{...O.W1B.pb,requestId:e.requestId}})}}if(t!==I.init||this.isXFeed||n||e.feedName===ut&&e.dontUseWorkerForFeed)this.checkWebWorkerUrl=!1;else{this.checkWebWorkerUrl=!1;let t="myfeed";e.feedName===ut&&(t="gaming"),"following"===e.feedName&&(t="following");const n=this.config.removeTimeoutWebworker?void 0:1e3;i&&i();const r=await(0,Re.ot)({id:t},n),s=r&&r.payload;if(s){const e=me.sj.MultiColumn;if(me.sj.MultiColumn===e&&r.fetched){this.checkWebWorkerUrl=!0,this.responseStatus=Te.Success;(0,N.Ou)().isFeedFromWW=1;const e=s.traceId;if(s.traceIdIndex=this.addOrUpdateIdxId(e,o),(0,ce.N)()){const e=this.getAuthTrail();(0,fe.mY)(s.traceId,s.debugId,e)}return s.tmpl&&_.M0.addOrUpdateTmplString(s.tmpl),V.publish(K,{isSignedIn:s.isSignedIn,src:"WW-wcp"}),{...s,responseSource:ke.FromWW}}}}if(pt.enableEarlyMainFeedRequest&&t===I.init){const t=(0,ce.N)()?1e4:void 0,n=await pt.getEarlyWpoFeedData(t);if(this.responseStatus=null==n?void 0:n.responseStatus,n&&n&&n.sections&&n.sections.length>0?this.responseStatus=Te.Success:this.responseStatus=Te.NoContent,pt.enableEarlyMainFeedRequest=!1,this.responseStatus===Te.Success||!(0,ce.N)())return{...n,responseSource:ke.FromEarlyResponse};if(!e.skipRetry){const t=await this.fetchFromWpoService(e,o,i);if(t)return{...t,responseSource:ke.FromServer}}}else{const t=await this.fetchFromWpoService(e,o,i);if(t)return{...t,responseSource:ke.FromServer}}if(this.shouldRetryInOtherDomain){e.domainOverride=B.hM,e.requestPathOverride=B.hZ;const t=await this.fetchFromWpoService(e,o,void 0,!0);if(t)return{...t,responseSource:ke.FromServer}}return this.getCachedResponse(e)}async fetchFromWpoService(e,t,i){var n,o,r,s;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=null===ie.Al||void 0===ie.Al?void 0:ie.Al.IsPrerender,c=(0,ge.TR)();!(0,ce.N)()&&this.config.requestToOrigin&&(e.domainOverride=B.hM,e.requestPathOverride=B.hZ),this.config.enableResetServiceURL&&(e.domainOverride=B.kJ);const d=!t&&e.paginationTimeoutMs?e.paginationTimeoutMs:e.timeoutMs,p=c&&t?2e3:d,u=E.jG.ShouldUseFdheadQsp?null===(n=E.jG.CurrentRequestTargetScope)||void 0===n||null===(o=n.pageExperiments)||void 0===o?void 0:o.join(","):void 0;let h;(0,ce.N)()&&(h=!(window&&window.chrome&&window.chrome.embeddedSearch),_.M0.addOrUpdateTmplProperty("privatew",`${h}`));const g=window&&`${window.innerWidth}x${window.innerHeight}`,f={...e,audienceMode:null===(r=E.jG.CurrentRequestTargetScope)||void 0===r?void 0:r.audienceMode,enableRightRailColumn:e.powerRightRailWithWpo,fdhead:u,isXFeed:this.isXFeed,nextPageUrl:e.useNextPageUrl&&e.nextPageUrl,requestType:Z.wpoService,timeoutMs:e.query&&e.customFeedTimeoutMs?e.customFeedTimeoutMs:p,refreshType:c&&!(0,fe.ZE)()?X.Bgtask:void 0,isDhp:c&&this.isDhp(),isRetry:a,private:h,viewportSize:g,enableWpoAdPlacements:this.config.auctionRidOverride&&!c,adsTimeout:this.config.auctionRidOverride&&600},v=ne.c.getQueryParameterByName("ssrFeedTimeOut",window.location.href);!(0,ce.N)()&&v&&(f.timeoutMs=parseInt(v));const m=await xe.requestInit(f),y=await xe.buildServiceRequestURL(f);se.$D.addTelemetryTracingQueryParam(y);const b=decodeURIComponent(y.href);this.requestQueryParams=new te.h(y.search),e.serviceUrl=b;if("1"===ne.c.getQueryParameterByName("logwporeq",window.location.href)){const e={};new Headers(null==m?void 0:m.headers).forEach(((t,i)=>{"Cookie"!==i&&(e[i]=t)})),_.M0.sendAppErrorEvent({...O.vif,pb:{...O.vif.pb,headers:JSON.stringify(e),url:b,credentials:m.credentials,referrer:m.referrer}})}const w=(0,N.Ou)();let S;if(w[z.p.wpoCallStart]=Math.round((0,N.UE)()),y.search=this.requestQueryParams.toString(),this.checkWebWorkerUrl){const e=(0,Re.Fr)("WebWorkerInitFeedUrl");e&&e.payload&&e.payload!==y.href&&_.M0.sendAppErrorEvent({...O.MUC,message:"Wpo feed fetch url does not match web worker"})}const C=e.useNextPageUrl&&e.nextPageUrl,x=!C;let T,k,I,P;try{let n;n=(0,ce.N)()?(null==e?void 0:e.overrideCSRTimeoutInMs)||1e4:(null==e?void 0:e.overrideSSRTimeoutInMs)||800,i&&i(),P=(()=>{let e=0;const t=x?O.TRT:O.TzH;return setInterval((()=>{e+=1,_.M0.sendAppErrorEvent({...t,pb:{...t.pb,url:b,isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c},message:`Request didn't finish in ${5e3*e}ms`})}),5e3)})();"header"===W.Gq.get("oneSvcUniTunMode")&&m&&m.headers&&(m.headers[Ae.Yu.uniFeatTun]=await se.$D.getUniFeatTunHeader());const o=await(0,Pe.w)((()=>(0,ce.N)()?(0,Pe.O)(b,m,n,e.skipRetry):(0,Oe.Sm)(b,n,m,void 0,void 0,!0)),"WpoCardProvider.fetch",n,e.skipRetry);let r,d,p,u,h,g,f;if(P&&(clearInterval(P),P=null),o){if("1"===ne.c.getQueryParameterByName("logwpores",window.location.href)){var $;const e={};null===($=o.headers)||void 0===$||$.forEach(((t,i)=>e[i]=t)),_.M0.sendAppErrorEvent({...O.v5s,pb:{...O.v5s.pb,headers:JSON.stringify(e),reqHeaders:JSON.stringify(m.headers),ok:o.ok,status:o.statusText,body:o.body}})}const{ok:i,status:n,statusText:s,headers:a}=o;if(T=a&&a.get("ddd-debugid"),k=a&&a.get("x-ceto-ref"),I=a&&a.get("x-msedge-ref"),W.Gq.set("OneServiceResponseDebugId",T),"following"===e.feedName){const i=new URLSearchParams(y.search),o="activityId",r=i.get(o)||"";if(r&&r!=E.jG.ActivityId&&_.M0.sendAppErrorEvent({...O.jQb,message:"ActivityId mismatched",pb:{...O.jQb.pb,clientActivityId:E.jG.ActivityId,serviceSideActivityId:r,debugId:T}}),(204===n||404===n)&&x&&t&&!e.feedId){var F,L,R;const t="skype-desktop-following"===e.ocid?Ue:De;return 204===n&&null!=t&&null!==(F=t.sections)&&void 0!==F&&null!==(L=F[0].subSections)&&void 0!==L&&null!==(R=L[0].cards)&&void 0!==R&&R[0]&&(t.sections[0].subSections[0].cards[0].isShowSelectMoreMessage=!0),t}}i?e.disableContent||204!==n||(r=x?O.bri:O.e88,u=!1):(r=e.disableContent?O.k28:x?O.vas:O.azB,"outlookchannels"===e.feedName&&500===n&&(r=O.SPE),"following"!==e.feedName||204!==n&&404!==n?u=!0:(r=O.wyy,u=!1),d=n,p=s)}else r=e.disableContent?O.k28:x?O.vas:O.azB,u=!0;if(r){var A;const e=(0,tt.Z)(m,"headers.Authorization"),t=null==o||null===(A=o.headers)||void 0===A?void 0:A.get("ddd-auth-features"),i=null==t?void 0:t.includes("IsBot:1"),n={...r,pb:{...r.pb,url:decodeURIComponent(y.href),requestHeaders:JSON.stringify(e&&e.headers),status:d,statusText:p,isFirstPage:x,activityId:E.jG.ActivityId,isBot:i,isInitializedAsPrerenderPage:l,isPrerender:c,isRetriedRequest:a,debugId:T}};if(this.sendAppErrorWithSeverityOverride(r,n),u)return void(this.responseStatus=Te.Failed);if(!(0,ce.N)()&&r===O.bri)return void(this.responseStatus=Te.NoContent)}const v=o.headers&&o.headers.get("X-Statics-Fallback");if(o.headers){if(v){const e=c?O.V_e:O.vCG;_.M0.sendAppErrorEvent({...e,pb:{...O.vCG.pb,url:decodeURIComponent(y.href),isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c,isInitializedAsPrerenderPage:l,debugId:T,isRetriedRequest:a},message:"Fell back to static content on the feeds call"}),this.isStatic=!0}_.M0.addOrUpdateCustomProperty("debugId",T);const e=o.headers.get(Ae.rD.traceId);if(h=this.addOrUpdateIdxId(e,t),(0,he.Dz)(T,!1),(0,ce.N)()){const t=this.getAuthTrail();(0,fe.mY)(e,T,t)}g=o.headers.get(Ae.rD.userType)}if(!C){const e=w[z.p.wpoCallStart],t=w[z.p.wpoResponseBack]=Math.round((0,N.UE)());w[z.p.feedRequestFG]=t-e,(0,H.QP)({name:z.p.feedRequestFG,startTime:e,endTime:t})}if(![O.bri,O.e88,O.RSD].includes(r)){var M,U;const i=(0,ce.N)()&&(0,N.UE)();if(S=await o.json(),S&&S.serviceContext&&S.serviceContext.tmpl&&(f=S.serviceContext.tmpl,_.M0.addOrUpdateTmplString(f)),i&&w&&(w.FeedResponseJsonReadTime=Math.round((0,N.UE)()-i)),null!==(M=S)&&void 0!==M&&M.swCacheEnabled){_.M0.sendAppErrorEvent({...O.Y6E,pb:{...O.Y6E.pb,url:decodeURIComponent(y.href),isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c,isInitializedAsPrerenderPage:l,debugId:T,isRetriedRequest:a,cacheAgeSeconds:S.cacheAgeSeconds},message:"Service Worker Cached Data Triggered"});let e=null,t="";switch(null===(s=S)||void 0===s?void 0:s.cacheTriggeredReason){case O.RDJ.id:e=O.RDJ,t="Service Worker Triggered due to fetch error: "+S.cacheTriggeredErrorMessage;break;case O.Nyv.id:e=O.Nyv,t="Service Worker Triggered due to wpo service error";break;case O.Vm4.id:e=O.Vm4,t="Service Worker Triggered due to Status 204 no content";break;case O.npe.id:e=O.npe,t="Service Worker Triggered due to static content loaded";break;case O.Q0t.id:e=O.Q0t,t="Service Worker Triggered due to wpo service returns empty section";break;case O.dAd.id:e=O.dAd,t="Service Worker Triggered due to static fallback returns empty section";break;case O.zo9.id:e=O.zo9,t="Service Worker Triggered due to network timeout"}e&&_.M0.sendAppErrorEvent({...e,pb:{...e.pb,url:decodeURIComponent(y.href),isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c,isInitializedAsPrerenderPage:l,debugId:T,isRetriedRequest:a,cacheAgeSeconds:S.cacheAgeSeconds},message:t})}if(S.traceIdIndex=h,S.userType=g,S.debugId=T,S.cetoRef=k,S.msEdgeRef=I,S.dddTmpl=f,"following"===e.feedName&&200===o.status&&x&&t){const t="skype-desktop-following"===e.ocid?Ue:De;if(!(S.sections&&S.sections.some((e=>"river"===e.region)))&&S.sections&&t&&t.sections&&t.sections.length){const e=S.sections.filter((e=>"overlay"===e.region));e&&e.length&&S.sections.push(t.sections[0])}}if(e.feedName===ut&&200===o.status&&x&&t&&(0,ce.N)()&&null!==(U=S.serviceContext)&&void 0!==U&&U.tmpl&&!(0,Me.$o)().getObject(j.GamingFeedEngagement))try{const e=Math.floor((new Date).getTime()/1e3),t=S.serviceContext.tmpl.split(";"),i={};for(let e=0;e<t.length;e++)t[e].includes("gamingFeedEngagementCount30D")&&t[e].split(",").forEach((e=>{const t=e.split(":"),[n,o]=t,r=o?Number.parseInt(o,10):null;"gamingFeedEngagementSum7D"!==n&&"gamingFeedEngagementCount7D"!==n&&"gamingFeedEngagementSum30D"!==n&&"gamingFeedEngagementCount30D"!==n||null===r||(i[n]=r)}));i.lastUpdated=e;const n=5;Object.keys(i).length===n&&(0,Me.$o)().setObject(j.GamingFeedEngagement,i)}catch(e){}if(!(e.disableContent||this.isPartialResponse(S)||S.sections&&S.sections.length>0)){let t=v?O.hqX:O.Fh_;"following"===e.feedName&&(t=O.wyy),_.M0.sendAppErrorEvent({...t,pb:{...t.pb,url:decodeURIComponent(y.href),isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c,isInitializedAsPrerenderPage:l,debugId:T,isRetriedRequest:a},message:"Empty Section on the feed call"})}}}catch(t){P&&(clearInterval(P),P=null);const i=["Service Request Timed out","Fetch for https://"],n=["TypeError: Failed to fetch"];let o;const r=(0,$e.fK)();if(this.shouldRetryInOtherDomain=x&&!e.domainOverride&&!r&&!(!(0,ce.N)()&&this.config.requestToOrigin),i.some((e=>{var i;return null==t||null===(i=t.message)||void 0===i?void 0:i.includes(e)}))){const e=c?O.LLm:O.KEP;o=x?e:O.VPR,o===O.KEP&&this.shouldRetryInOtherDomain&&!a&&(o=O.YLV)}else o=n.some((e=>{var i;return null==t||null===(i=t.message)||void 0===i?void 0:i.includes(e)}))?this.shouldRetryInOtherDomain?O.iB1:O.ck_:this.shouldRetryInOtherDomain?O.CDI:O.QJe;const s=(0,tt.Z)(m,"headers.Authorization"),d={...o,message:"Error while fetching WpoService response",pb:{...o.pb,customMessage:`Error: ${t}`,url:decodeURIComponent(y.href),requestHeaders:JSON.stringify(s.headers),isFirstPage:x,activityId:E.jG.ActivityId,isPrerender:c,isInitializedAsPrerenderPage:l,domainOverride:e.domainOverride??"",isRetry:this.shouldRetryInOtherDomain,debugId:T,isRetriedRequest:a,isRetryBackupDomainFlight:r}};return this.sendAppErrorWithSeverityOverride(o,d),void(this.responseStatus=Te.Failed)}if(S&&S&&S.sections&&S.sections.length>0)this.responseStatus=Te.Success;else if(this.isPartialResponse(S))this.responseStatus=Te.Success;else if(this.responseStatus=Te.NoContent,!(0,ce.N)())return;return"1"===ne.c.getQueryParameterByName("testHero",window.location.href)&&S.sections.forEach((e=>{var t;"hero"===e.region&&null!==(t=e.subSections)&&void 0!==t&&t.length&&(e.subSections[0].dataTemplate="msft-full-wide-one-card-five-col",e.subSections[0].layoutTemplate="msft-full-wide-one-card-five-col")})),!this.config.auctionRidOverride||(0,ge.TR)()||(0,ce.N)()||this.mapperHelper.backfill1SAdWithNews(S),S}async getCachedResponse(e){if((e.skipRetry||e.enableCachedResponseFallback)&&(0,ce.N)()&&window.caches&&e.serviceUrl&&e.serviceWorkerCachePrefix)try{const i=(await caches.keys()).find((t=>t.startsWith(e.serviceWorkerCachePrefix)));if(!i)return;const n=await caches.open(i);if(!n)return;const o=this.normalizeUrl(e.serviceUrl),r=await n.keys()||[],s=r.filter((e=>e.url&&this.normalizeUrl(e.url)===o));for(const e of s)try{const i=await n.match(e.url),o=await i.json();if(o){var t;const e=Date.parse(null===(t=i.headers)||void 0===t?void 0:t.get("date")),n=isNaN(e)?"":(Date.now()-e)/1e3;return _.M0.sendAppErrorEvent({...O.Smg,pb:{...O.Smg.pb,cacheAgeSeconds:n}}),{...o,responseSource:ke.FromCache}}}catch(e){}_.M0.sendAppErrorEvent({...O.Rgo,pb:{...O.Rgo.pb,numCachedRequests:r.length,numMatches:s.length,serviceUrl:e.serviceUrl}})}catch(t){_.M0.sendAppErrorEvent({...O.Rgo,message:"An error occurred while retrieving a cached response. "+t.message,pb:{...O.Rgo.pb,isFirstPage:!e.nextPageUrl,url:e.serviceUrl,requestId:e.requestId,stack:t.stack}})}}normalizeUrl(e){try{const t=new URL(e);ht.forEach((e=>t.searchParams.delete(e)));return decodeURIComponent(t.toString()).replace("/serviceak/","/service/").replace("api.msn.com/","assets.msn.com/").replace("api.msn.cn/","assets.msn.cn/")}catch(e){return""}}clearCache(){this.mapperHelper.resetCardCountForSuperFeed()}initializeRequest(){const{initialRequest:e}=this.config;null!==e&&(0,et.isNullOrUndefined)(e.useNextPageUrl)&&(e.useNextPageUrl=!0)}addOrUpdateIdxId(e,t){return _.M0.addOrUpdateIdxId(e,t)}getResponseStatus(){return this.responseStatus}_requestQueryParams(){return this.requestQueryParams}isDhp(){var e;return(null===(e=window.location.search)||void 0===e?void 0:e.indexOf("startpage=1"))>-1}noContentCannotRetry(){return this.noContentRetryCount>=this.maxContentRetryCount}}var vt=i(40053),mt=i(82928);const yt="femFollowingUpdated",bt="femRecommendedUpdated",wt="showFallbackFeed",St="hideFallbackFeed";class Ct{constructor(){this.currentFeedId="",this.overrideFeedConfig=null,this.feedManager=null,this.channels=[],this.prevChannelStoreFollows=[],this.isProng2=()=>E.jG.isWindowsDashboard,this.isWinHP=()=>"windows"===E.jG.AppType,this.isNTP=()=>"edgeChromium"===E.jG.AppType,this.isCanvasSupported=()=>this.isProng2()||this.isWinHP()||this.isNTP(),this.transformResponse=(e,t)=>{if(e){var i,n,o;const a=null===(i=e.regions)||void 0===i?void 0:i.filter((e=>"river"===e.region)),l=a&&a.length&&a[0]&&a[0].sections,{type:c}=(null==l||null===(n=l[0])||void 0===n||null===(o=n.cards)||void 0===o?void 0:o[0])||{};var r,s;if(c===M.PL.ChannelFilterCard||t&&c===M.PL.ChannelCarousel)return null==a||null===(r=a[0])||void 0===r||null===(s=r.sections)||void 0===s||s.shift(),!0}return!1},this.fetchChannelFilter=async(e,t)=>{const i=!(null!=t&&t.fcl),n=await(this.isProng2()?this.fetchFromWindowsCardProvider(t):this.fetchFromWpoCardProvider(t,i));if(!n)return void(0,A.H)(O.nZQ,`Failed to load filtered channels for ${e}.`);const o=this.getCardsFromResponse(n)[0];var r;if(!o||o.type===M.PL.ChannelFilterCard)return _.M0.addOrUpdateTmplProperty("numberOfFollowedChannels",(null==o||null===(r=o.subCards)||void 0===r?void 0:r.length.toString())||"0"),o||{};o.type!==M.PL.ChannelCarousel&&(0,A.H)(O.k2Y,"The first card of filtered following channels response is not Channel Filter or Channel Carousel",`{ debugID: ${n.debugId}, nextPageUrl: ${n.nextPageUrl}, sections: ${JSON.stringify(n.sections)} }`)},this.fetchPublishers=async()=>{try{var e;const t=await(null===(e=this.publisherServiceClient)||void 0===e?void 0:e.getUserFollowedSources());if(null!=t&&t.length)return t}catch(e){(0,A.H)(O.T4Y,"Failed to fetch publisher metadata",`{${e}}`)}},this.fetchChannel=async e=>{let{id:t}=e;const i={feedId:t};return this.isProng2()?this.fetchFromWindowsCardProvider(i):this.fetchFromWpoCardProvider(i)},this.mapChannel=(e,t)=>{var i,n,o,r,s,a;const l=["InterestChannel","InterestFeed"].includes(e.type);return{id:l?null==e||null===(i=e.feed)||void 0===i?void 0:i.id:null==e||null===(n=e.provider)||void 0===n?void 0:n.id,imgSrc:(null===(o=e.images)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.url)||"",title:l?null==e||null===(s=e.feed)||void 0===s?void 0:s.feedName:null==e||null===(a=e.provider)||void 0===a?void 0:a.name,isFollowing:!0,isTopic:l,index:t,providerProfileId:!l&&e.provider&&e.provider.profileId}},this.getCardsFromResponse=e=>{var t,i;if(!e)return[];const n=null===(t=e.sections)||void 0===t?void 0:t.filter((e=>"river"===e.region)),o=n&&n.length?n:e.sections,{cards:r=[],subSections:s}=o&&o.length&&o[0]||{};return(s?null===(i=s[0])||void 0===i?void 0:i.cards:r)||[]},this.fetchFromWindowsCardProvider=function(){const e={contextSource:"winWidgets",count:12,feedId:"",isXfeed:!0,ocid:"winp2",useRawJson:!0,pivotId:"Following",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return(new U.X).fetch(e)},this.fetchFromWpoCardProvider=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i={ocid:(0,R.ku)(),timeoutMs:2e3,feedName:"following",requestId:_.M0.getRequestId(),shouldUseNewWpoEndpoint:!0,wpoSchema:"byregion",...e};return new ft({initialRequest:{timeoutMs:2e3}},!1).fetchFromWpoService(i,t)},this.resetChannelFeedId=()=>{this.currentFeedId=""},this.setChannelFeed=async e=>{if(e!==this.currentFeedId&&(e||this.currentFeedId))if(this.currentFeedId=e,this.overrideFeedConfig)this.overrideFeedConfig((t=>{var i;return null!==(i=t.riverSectionCardProviderConfig)&&void 0!==i&&i.initialRequest&&(t.riverSectionCardProviderConfig.initialRequest.feedName="following",t.riverSectionCardProviderConfig.initialRequest.feedId=e,t.riverSectionCardProviderConfig.initialRequest.isXFeed=!0,t.riverSectionCardProviderConfig.initialRequest.timeoutMs=3e3),t}));else if(this.feedManager){const t=this.isProng2()?"Following":"following",i=this.isProng2()?"winWidgets":"",n={isXFeed:!0,feedId:e,pivotId:t,contextSource:i};await this.feedManager.callRefreshRegionsData(n)}},this.setFeedConfigOverrider=e=>{this.overrideFeedConfig=e},this.setFeedManager=e=>{this.feedManager=e},this.setChannels=e=>{this.channels=e,window.dispatchEvent(new CustomEvent(yt))},this.setChannelsRecommendations=e=>{this.channels=e,window.dispatchEvent(new CustomEvent(bt))},this.isProviderChannel=e=>this.channels.some((t=>{let{id:i,isTopic:n}=t;return e===i&&!n})),this.showFallbackFeed=()=>{window.dispatchEvent(new CustomEvent(wt))},this.hideFallbackFeed=()=>{window.dispatchEvent(new CustomEvent(St))},this.isFeedFetching=()=>this.feedManager&&this.feedManager.isFeedFetching()}static getInstance(){return W.Gq.get("__FollowingExperienceManager__",(()=>new Ct))}initializeServiceClients(){this.topicsDataConnector||(this.topicsDataConnector=(0,mt.K0)(L.z.TopicData)),this.publisherServiceClient||(this.publisherServiceClient=this.publisherServiceClient||new vt.PublisherServiceClient(window.fetch.bind(window),!1)),this.topicsDataConnector||(0,A.H)(O.T4K,"Topic Data Connector is not defined in ChannelFilterCard WCE.")}}const xt=(0,G.h)(Ct);var Tt=i(64107),kt=i(29363),It=i(81586);const Pt=(e,t,i,n)=>{if(e&&t&&i&&n){return e.addOrUpdateChild({name:n,behavior:"unfollow"===n?It.wu.Unfollow:It.wu.Unmute,type:It.c9.ActionButton,content:{headline:`${n}_${i.replace(" ","_")}`,id:t},destinationUrl:"",feed:{id:t}}).getMetadataTag()}},$t="ChannelStore",Ft="closedialog",Lt="ChannelNav",Et="ExperienceSettings",Rt="NextSlideArrow",At="PreviousSlideArrow",Ot="FollowingFeed",Mt="Search";var Ut,Dt,Nt=i(58481),Ht=i(99452);!function(e){e[e.Publisher=0]="Publisher",e[e.Topic=1]="Topic",e[e.Sports=2]="Sports"}(Ut||(Ut={})),function(e){e[e.Recommended=0]="Recommended",e[e.Sports=1]="Sports"}(Dt||(Dt={}));var _t=i(55447),jt=i(98303),Bt=i(54791),zt=i(56933),qt=i.n(zt),Gt=i(72546),Wt=i.n(Gt),Vt=i(13022),Kt=i.n(Vt),Qt=i(87055),Jt=i.n(Qt),Zt=i(30118),Xt=i.n(Zt);const Yt="MyInterests",ei="msn-toast",ti="following",ii=[{display:"Discover",glyph:Jt(),selectedGlyph:Xt(),id:"discover",showDivider:!1,telemetryMetadata:"Discover"},{display:"Following",glyph:Wt(),selectedGlyph:Kt(),id:"following",showDivider:!1,telemetryMetadata:"Following"},{display:"Blocked",glyph:qt(),selectedGlyph:qt(),id:"blocked",showDivider:!1,telemetryMetadata:"Blocked"}],ni={display:"Notifications",id:"notifications",showDivider:!1,telemetryMetadata:"Notifications"};var oi,ri=i(94208),si=i(70239),ai=i(55025),li=i(56204),ci=i(49494),di=i(47581),pi=i(17779),ui=i(97228),hi=i(58106);!function(e){e.topicCardBackupImageUrl="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtCmK3.img";e.TopicCardStandardDimensions={borderWidth:4,height:250,width:250,gutterSize:hi.iN},e.TopicCardImageStandardDimensions={height:242,width:242}}(oi||(oi={}));const gi="feeds",fi="msn/topics",vi="Follow",mi="Mute",yi="Graph/Actions",bi="TagBase";var wi=i(16715),Si=i(84882),Ci=i(82415),xi=i(51480),Ti=i(665),ki=i(52429),Ii=i(59942),Pi=i(79022),$i=i(81492),Fi=i(45180);var Li;!function(e){e[e.LetterBox=1]="LetterBox",e[e.Scale=2]="Scale",e[e.Stretch=3]="Stretch",e[e.Crop=4]="Crop",e[e.FocalCrop=5]="FocalCrop",e[e.TmxResize=6]="TmxResize",e[e.AppExResize=7]="AppExResize",e[e.CustomCrop=8]="CustomCrop"}(Li||(Li={}));class Ei{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.url=e,this.height=t,this.width=i,this.mode=Li.Crop,this.quality=60,this.url=(this.url||"").replace(/http:/,"https:").replace(/\?.*/,"")}static from(e){return e?new Ei(e.url,e.height,e.width):null}get src(){const e=[];return e.push({key:"w",value:(0,Fi.Z)(this.width)}),e.push({key:"h",value:(0,Fi.Z)(this.height)}),e.push({key:"m",value:(0,Fi.Z)(this.mode)}),e.push({key:"q",value:(0,Fi.Z)(this.quality)}),this.url+`?${ne.c.keyValueArrayToQueryString(e)}`}resizeTo(e,t){return this.width=t,this.height=e,this}}var Ri=i(42122);class Ai{static TranslateToTopicGroups(e,t){if(Ri.k.logObjects(e),!ai.b.isDefined(e)||!Ai.isValidCompositeCardResponse(e.value))throw new Error("Topics OneService response schema validation error: no valid topic groups found!");const i={topicGroupIds:[],topicGroupMap:{},topicMap:{}};return e.value[0].subCards.forEach((e=>{if(Ai.isValidTopicGroup(e,!0)){const n=Ai.getTopics(e,t);ai.b.arrayHasData(n)&&(n.forEach((e=>{i.topicMap[e.id]=e})),i.topicGroupMap[e.id]={id:e.id,nextPageUrl:e.nextPageUrl,title:e.title,topicIds:n.map((e=>e.id))},i.topicGroupIds.push(e.id))}})),i}static TranslateToTopics(e,t,i){if(Ri.k.logObjects(e),!ai.b.isDefined(e)&&e[t])throw new Error("Topics OneService response schema validation error: no valid topic group found!");return e[t].map((e=>{const t=i(e);return Ai.getTopic(t,null)}))}static TranslateToRecommendedTopics(e){return this.TranslateToTopics(e,"value",(e=>({...e,name:e.title,feedType:null})))}static TranslateToSelectedNumberOfRecommendedTopics(e){return this.TranslateToTopics(e,"suggestions",(e=>({...e.content,name:e.content.title,feedType:null})))}static TranslateToHiddenTopicIds(e){if(Ri.k.logObjects(e),!ai.b.isDefined(e)&&e.value)throw new Error("Topics OneService response schema validation error: no valid topic group found!");return e.value.map((e=>e.targetId))}static TranslateSingleTopicResponseToTopic(e){const t=this.TranslateTopicResponseToTopicArray(e);return t&&t.length&&t[0]}static TranslateTopicResponseToTopicArray(e){if(!ai.b.isDefined(e)||!Ai.isValidCompositeCardResponse(e.value))throw new Error("Topics OneService response schema validation error: no valid followed topics found!");const t=e.value[0].subCards,i=[];return t.forEach((e=>{i.push(Ai.getTopic(e,null))})),i}static TranslateToFollowedTopics(e){if(Ri.k.logObjects(e),!ai.b.isDefined(e)||!ai.b.arrayHasData(e.value))throw new Error("Topics OneService response schema validation error: no valid followed topics found!");const t=e.value,i={};return t.forEach((e=>{if(e&&e.id){const t={};t[e.id]=[{followState:"followed"}],e.title&&(e.name=e.title,delete e.title);const n=Ai.getTopic(e,t);i[n.id]=n}})),i}static getTopic(e,t,i){if(!(0,Pi.Z)(e.id)||!(0,Pi.Z)(e.name))return null;let n;if(n=t&&ai.b.arrayHasData(t[e.id])?t[e.id][0]:{followState:si.t.Unfollowed},!ai.b.isDefined(n))return null;i||(i=oi.TopicCardImageStandardDimensions);const o=e.image,r=o&&o.url?Ei.from(o).resizeTo(i.height,i.width).src:oi.topicCardBackupImageUrl;return{id:e.id,name:e.name,followState:n.followState===si.t.Unfollowed||n.followState===si.t.None?si.t.Unfollowed:si.t.Followed,imgSrc:r,href:(0,Ii.Xw)(e.id,e.name),feedType:e.feedType,canonicalName:e.canonicalName,isInferred:e.isInferred,branding:e.branding,locale:e.locale,followersCount:e.followersCount}}static getTopics(e,t){const i=[];return e.subCards.forEach((n=>{const o=Ai.getTopic(n,e.metadata,t);i.push(o)})),i}static isValidTopicGroup(e,t){return(!t||(0,Pi.Z)(e.id))&&!(0,$i.Z)(e.metadata)&&ai.b.arrayHasData(e.subCards)}static isValidCompositeCardResponse(e){return ai.b.arrayHasData(e)&&ai.b.arrayHasData(e[0].subCards)}}var Oi=i(34833),Mi=i(507);class Ui{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,ae.qQ)(),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,de.VQ)();this.fetchImpl=e,this.serviceURL=t,this.useEnterpriseEndpoint=i}async getFollowedTopics(e,t){var i;const n=await this.getRequestInit(),o=await this.getCommonParams(gi),r=(0,wi.aH)()?null:(0,he.Ee)();if(this.useEnterpriseEndpoint&&(null==n||null===(i=n.headers)||void 0===i||!i[Ae.Yu.authorization]))return{};const s=[...o,{key:"queryType",value:"MyFeed"},{key:"$top",value:"1000"},{key:"allTopics",value:"true"},{key:"rndId",value:e?(0,Mi.Z)(0,1e3).toString():null},{key:he.i$,value:r?r.toString():null},{key:"responseSchema",value:ki.c.CardView},{key:"followersCount",value:"true"}];t&&s.push({key:"$orderby",value:"createdDateTime desc"});const a=this.getLocationData();a&&!(0,wi.aH)()&&s.push({key:"location",value:a});const l=(0,ae.PH)(fi,this.serviceURL);this.appendQs(s,l);const c=await this.sendRequest(decodeURIComponent(l.href),n,"getUserTopics");return Ai.TranslateToFollowedTopics(c)}async getRecommendedTopics(){const e=await this.getRequestInit(),t=[...await this.getCommonParams(gi),{key:"queryType",value:"recommendations"},{key:"$select",value:"id,title,image"}],i=(0,ae.PH)(fi+"/me/recommendations",this.serviceURL);this.appendQs(t,i);const n=await this.sendRequest(decodeURIComponent(i.href),e,"getRecommendedTopics");return Ai.TranslateToRecommendedTopics(n)}async getTopRecommendedTopics(e){const[t,i]=await Promise.all([this.getRequestInit(),this.getCommonParams(gi)]),n=[...i,{key:"interesttype",value:"Topic"},{key:"responseSchema",value:"cardView"},{key:"$top",value:e||"50"}],o=new URL("https://api.msn.com/news/suggestedinterests");this.appendQs(n,o);const r=await this.sendRequest(decodeURIComponent(o.href),t);return Ai.TranslateToSelectedNumberOfRecommendedTopics(r)}async getHiddenTopicIds(){const e=(0,ae.PH)(yi,this.serviceURL),t=await this.getRequestInit(),i=await this.getCommonParams(gi),n={key:"$filter",value:`actionType eq '${mi}' and targetType eq '${bi}'`};t.method="GET";const o=[n,{key:"$top",value:"100"},...i];this.appendQs(o,e);const r=await this.sendRequest(decodeURIComponent(e.href),t,"getHiddenTopics");return Ai.TranslateToHiddenTopicIds(r)}async getRelatedTopics(e,t){if(!e)return Promise.reject();const i=(0,ae.PH)("news/topics/{id}/related".replace("{id}",e.id),this.serviceURL),n=await this.getCommonParams(gi);t&&t>0&&n.push({key:"$top",value:t.toString()}),this.appendQs(n,i);const o=await this.getRequestInit(),r=await this.sendRequest(decodeURIComponent(i.href),o,"getRelatedTopics");return r&&0===r.length?r:Ai.TranslateToRecommendedTopics(r)}async getTopics(e,t){const i=await this.getRequestInit(),n=await this.getCommonParams(gi),o=t||[...n,{key:"queryType",value:"Discover"},{key:"$top",value:"100"},{key:"$select",value:"id,name,image,feedType,canonicalName,branding"}],r=this.getLocationData();r&&o.push({key:"location",value:r});const s=(0,ae.PH)(fi,this.serviceURL);this.appendQs(o,s);const a=await this.sendRequest(decodeURIComponent(s.href),i,"getTopicGroups");return Ai.TranslateToTopicGroups(a,e)}async getTopic(e){const t=await this.getRequestInit(),i=[...await this.getCommonParams(gi),{key:"ids",value:e}],n=this.getLocationData();n&&i.push({key:"location",value:n});const o=(0,ae.PH)(fi,this.serviceURL);this.appendQs(i,o);const r=await this.sendRequest(decodeURIComponent(o.href),t,"getTopic");return Ai.TranslateSingleTopicResponseToTopic(r)}async updateTopicFollowingState(e,t,i){const n=(0,ae.PH)(yi,this.serviceURL),o=await this.getRequestInit(),r=await this.getCommonParams(gi),s=this.getLocationData();if(s&&r.push({key:"location",value:s}),t){const t={actionType:vi};null!=e&&e.id?t.targetId=null==e?void 0:e.id:i&&(t.definitionName=i),o.method="POST",o.headers["Content-Type"]="text/json",o.body=JSON.stringify(t),this.appendQs(r,n)}else{const t={key:"$filter",value:`actionType eq '${vi}' and (targetId eq '${null==e?void 0:e.id}')`};o.method="DELETE";const i=[t,...r];this.appendQs(i,n)}return await this.sendRequest(decodeURIComponent(n.href),o,"updateTopicFollowingState")}async updateTopicHiddenState(e,t){let{id:i}=e;const n=(0,ae.PH)(yi,this.serviceURL),o=await this.getRequestInit(),r=await this.getCommonParams(gi),s=this.getLocationData();if(s&&r.push({key:"location",value:s}),t){const e={actionType:mi,targetType:bi};e.targetId=i,o.method="POST",o.headers["Content-Type"]="text/json",o.body=JSON.stringify(e),this.appendQs(r,n)}else{const e={key:"$filter",value:`actionType eq '${mi}' and (targetId eq '${i}') and targetType eq '${bi}'`};o.method="DELETE";const t=[e,...r];this.appendQs(t,n)}return await this.sendRequest(decodeURIComponent(n.href),o,"updateTopicHiddenState")}async restoreDefaultTopics(){const e=(0,ae.PH)(yi,this.serviceURL),t=await this.getRequestInit();t.method="DELETE";const i=[...await this.getCommonParams(gi),{key:"$filter",value:`actionType eq '${vi}'`}];this.appendQs(i,e);return await this.sendRequest(decodeURIComponent(e.href),t,"restoreDefaultTopics")}async getTopicsById(e){if(!e||e.length<1)return[];const t=await this.getRequestInit(),i=[...await this.getCommonParams(gi),{key:"ids",value:e.join(",")}],n=this.getLocationData();n&&i.push({key:"location",value:n});const o=(0,ae.PH)(fi,this.serviceURL);this.appendQs(i,o);const r=await this.sendRequest(decodeURIComponent(o.href),t,"getTopicsById");return Ai.TranslateTopicResponseToTopicArray(r)}getLocationData(){const e=(0,ie.nP)();return e.ClientSettings&&e.ClientSettings.geo_lat&&e.ClientSettings.geo_long?`${e.ClientSettings.geo_lat}|${e.ClientSettings.geo_long}`:null}async getCommonParams(e){if((0,wi.aH)())return this.getSapphireQueryParams();let t=!0;const i=await this.isUserSignedIn();var n;(ie.Al.IsBlendedEnterprise&&(e="entnewsntp",t=!1),"winWidgets"===E.jG.AppType)&&(e="sidebar"===(null===(n=ie.Al.ClientSettings)||void 0===n?void 0:n.pagetype)?"shoreline":"winp2",t=!1);this.forcedApiKey&&(t=!1),(0,wi._3)()&&(e="OnOSkypeChannels");const o=i?se.$D.getOneServiceParamsWithAuth(E.jG.UserId,e,t):se.$D.getOneServiceParamsWithoutAuth(E.jG.UserId,e,t,null,!1,this.useEnterpriseEndpoint);if(this.forcedApiKey){o.find((e=>"apikey"==e.key)).value=this.forcedApiKey}return o}getSapphireQueryParams(){const e=se.$D.getOneServiceNonDynamicParamsWithoutAuth(gi),t=(0,Si._4)();return t&&(e.push({key:E.jG.OneServiceContentMarketQspKey,value:t.market}),E.jG.ShouldUseFdheadQsp&&e.push({key:"fdhead",value:t.features}),e.push({key:"activityId",value:t.activityId}),t.latitude&&t.longitude&&e.push({key:"location",value:`${t.latitude}|${t.longitude}`})),e}async getRequestInit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e&&(e={method:"GET"}),e.credentials="include",e.headers=(0,Ci.wq)()?await(0,xi.dG)():await se.$D.getOneServiceHeaders(this.useEnterpriseEndpoint),e}async isUserSignedIn(){const e=(0,ie.nP)().UserIsSignedIn;if(void 0!==e)return e;const t=await(0,pe.XJ)();return this.validateAnaheimSignInStatus(t===ee.Hy.SignedIn,t)}validateAnaheimSignInStatus(e,t){if("edgeChromium"===E.jG.AppType){const i=!!(0,Oi.ej)("lt"),n=!!(0,Oi.ej)("aace");if(!e&&i&&n)return(0,pe.rr)().then((e=>{_.M0.sendAppErrorEvent({...O.A9S,message:"User was reported as not signed in, but aace and lt were present.",pb:{...O.A9S.pb,customMessage:JSON.stringify({userSignInState:t,ltCookiePresent:i,aaceCookiePresent:n,resolvedSignInState:e})}})})),!0}return e}async sendRequest(e,t,i){return(0,wi.aH)()?await this.sapphireRequest(decodeURIComponent(e),t):await this.networkRequest(decodeURIComponent(e),t,i)}async sapphireRequest(e,t){const i={url:e,headers:t.headers,body:t.body,refresh:!0};let n;switch(t.method){case"POST":n=await(0,Ti.Ef)(i);break;case"DELETE":n=await(0,Ti.o9)(i);break;default:n=await(0,Ti.FM)(i)}return JSON.parse(n||"{}")}async networkRequest(e,t,i){const n=await(0,Pe.w)((async()=>await this.fetchImpl(e,t)),i);if(!n.ok)throw Error(n.statusText);return 204===n.status?[]:n.json()}appendQs(e,t){e.forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}))}setForcedApiKey(e){this.forcedApiKey=e}getMockWorkTopics(){return{"@odata.context":"http://api.msn.com/msn/topics/me/$metadata#work",value:[{id:"Y_d659302d-5ac4-460a-9baa-8c8684761110",title:"Microsoft In The News",image:{width:292,height:342,quality:98,url:"http://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtK2OS.img",title:"Travel News large interest image"}},{id:"Y_a952481b-5929-4b40-83be-f2bc6edf43dd",title:"Technology",image:{width:292,height:342,quality:98,url:"http://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtJSnh.img",title:"Weather large interest image"}}]}}}class Di{constructor(e){this.servicesMap=e}async getFollowedTopics(e,t){const i=[],n=Object.entries(this.servicesMap).map((n=>{let[o,r]=n;return r.getFollowedTopics(e,t).then((e=>(Object.values(e).forEach((e=>{e.apiSource={id:o,baseUrl:r.serviceURL}})),e))).catch((e=>(i.push({error:e,serviceId:o}),null)))}));return Promise.all(n).then((e=>{if((null==i?void 0:i.length)===Object.keys(this.servicesMap).length)throw this.combineErrors(i);return Object.assign({},...e.filter((e=>e)))}))}async getRecommendedTopics(){const e=[],t=Object.entries(this.servicesMap).map((t=>{let[i,n]=t;return n.getRecommendedTopics().then((e=>(e.forEach((e=>{e.apiSource={id:i,baseUrl:n.serviceURL}})),e))).catch((t=>(e.push({error:t,serviceId:i}),null)))}));return Promise.all(t).then((t=>{if((null==e?void 0:e.length)===Object.keys(this.servicesMap).length)throw this.combineErrors(e);return t.filter((e=>e)).reduce(((e,t)=>e.concat(t)),[])}))}async getRelatedTopics(e,t){if(null==e||!e.apiSource)return;const{id:i}=e.apiSource,n=this.servicesMap[i];return n?n.getRelatedTopics(e,t).then((e=>(e.forEach((e=>{e.apiSource={id:i,baseUrl:n.serviceURL}})),e))):void 0}async getTopics(e,t){const i=[],n=Object.entries(this.servicesMap).map((n=>{let[o,r]=n;return r.getTopics(e,t).then((e=>(Object.values(e.topicMap).forEach((e=>{e.apiSource={id:o,baseUrl:r.serviceURL}})),e))).catch((e=>(i.push({error:e,serviceId:o}),null)))}));return Promise.all(n).then((e=>{if((null==i?void 0:i.length)===Object.keys(this.servicesMap).length)throw this.combineErrors(i);const t=e.filter((e=>e));return{topicGroupIds:t.map((e=>e.topicGroupIds)).reduce(((e,t)=>e.concat(t)),[]),topicGroupMap:Object.assign({},...t.map((e=>e.topicGroupMap))),topicMap:Object.assign({},...t.map((e=>e.topicMap)))}}))}async getTopic(e){const t=[],i=Object.entries(this.servicesMap).map((i=>{let[n,o]=i;return o.getTopic(e).then((e=>(e.apiSource={id:n,baseUrl:o.serviceURL},e))).catch((e=>(t.push({error:e,serviceId:n}),null)))}));return Promise.all(i).then((e=>{if((null==t?void 0:t.length)===Object.keys(this.servicesMap).length)throw this.combineErrors(t);return e.reduce(((e,t)=>t||e))}))}async updateTopicFollowingState(e,t,i){if(null==e||!e.apiSource){const n=this.servicesMap[ri.A.consumer];return null==n?void 0:n.updateTopicFollowingState(e,t,i)}const{id:n}=e.apiSource,o=this.servicesMap[n];if(o)return o.updateTopicFollowingState(e,t,i)}async updateTopicHiddenState(e,t){return(e.apiSource&&this.servicesMap[e.apiSource.id]||this.servicesMap[ri.A.consumer]).updateTopicHiddenState(e,t)}async getHiddenTopicIds(){const e=[],t=Object.entries(this.servicesMap).map((async t=>{let[i,n]=t;try{return await n.getHiddenTopicIds()}catch(t){return e.push({error:t,serviceId:i}),null}})),i=await Promise.all(t);if(e.length===Object.keys(this.servicesMap).length)throw this.combineErrors(e);const n=[];for(const e of i.filter((e=>e)))n.push(...e);return n}async getTopicsById(e){const t=[],i=Object.entries(this.servicesMap).map((async i=>{let[n,o]=i;try{const t=await o.getTopicsById(e);for(const e of t)e.apiSource={id:n,baseUrl:o.serviceURL};return t}catch(e){return t.push({error:e,serviceId:n}),null}})),n=await Promise.all(i);if(t.length===Object.keys(this.servicesMap).length)throw this.combineErrors(t);const o=[];for(const e of n.filter((e=>e)))o.push(...e);return o}async restoreDefaultTopics(){const e=Object.entries(this.servicesMap).map((e=>{let[t,i]=e;return i.restoreDefaultTopics()}));return Promise.all(e)}combineErrors(e){const t=e.filter((e=>e)).reduce(((e,t)=>{var i;return`${e} serviceId: ${t.serviceId}, Message: ${null===(i=t.error)||void 0===i?void 0:i.message};`}),"");return new Error(t)}setForcedApiKey(e){Object.entries(this.servicesMap).forEach((async t=>{let[i,n]=t;n.setForcedApiKey(e)}))}}var Ni,Hi=i(30666);!function(e){e.SysTag="SysTag",e.UserQuery="UserQuery"}(Ni||(Ni={}));var _i=i(6120),ji=i(28529),Bi=i(26671);class zi extends Hi.e{constructor(e,t,i,n,o,r,s){super(e,t,i,n,o,r,s),this.fetchedAllFollowedTopics=!1,this.fetchedAllRecommendedTopics=!1,this.fetchedAllHiddenTopics=!1,this.fetchedAllTopics=!1;const a=(0,ce.N)()?window.fetch.bind(window):fetch;if(r&&r.useMultiTopicSource){const e={};e[ri.A.work]=new Ui(a,E.jG.EnterpriseServiceUrlBase,!0),e[ri.A.consumer]=new Ui(a,E.jG.ServiceUrlBase,!0),this.serviceClient=new Di(e)}else this.serviceClient=new Ui(a);this.trackAppErrorEventCallback=_.M0?e=>_.M0.sendAppErrorEvent(e):null;const l=(0,ie.nP)();this.useUserCreatedOrder=l.CurrentFlights.indexOf("prg-navfr-t")>-1,l.IsBlendedEnterprise&&(this.cardProvider=new li.d({initialRequest:{start:0,count:5,timeoutMs:3e3,disableFlatViewResponse:!0,select:"id",contentType:"article,video,slideshow,webcontent"}}))}registerTrackAppErrorEventCallback(e){this.trackAppErrorEventCallback=e}async followTopic(e,t,i){const n=ai.b.isNotNullOrUndefined(await this.getFollowedTopic(e,t,i));return n&&this.invalidateCaches(),n}async getFollowedTopic(e,t,i){let n=null;if(e&&(n=await this.getTopic(e)),!(0,et.isNullOrUndefined)(n)&&(n.followState!==si.t.Followed||i)||t){const e=n&&n.feedType!==Ni.UserQuery?n:null,i=n&&n.feedType===Ni.UserQuery?n.name:t,o=await this.updateTopicFollowingState(e,si.t.Followed,i);o&&(n=await this.getTopic((null==e?void 0:e.id)||o.targetId))}return(0,et.isNullOrUndefined)(n)||n.followState!==si.t.Followed?void 0:n}async getFollowedTopics(e){let t=this.getCurrentState().followedTopicIds;return this.fetchedAllFollowedTopics&&!e||(e=e||await this.gettingTopicsAfterMigration(),await this.fetchFollowedTopics(e)&&(t=this.getCurrentState().followedTopicIds,e&&!(0,Ci.wq)()&&(0,ji.cB)())),t}async getOneServiceFollowedTopics(){try{return await this.serviceClient.getFollowedTopics(!1,this.useUserCreatedOrder)}catch(e){this.trackAppError({...O.DE1,message:"Failed fetching one service followed topics",pb:{...O.DE1.pb,customMessage:`Failed fetching one service followed topics. ${e&&e.message}`}})}}async getRecommendedTopics(){return this.fetchedAllRecommendedTopics||await this.fetchRecommendedTopics(),this.getCurrentState().recommendedTopics}async setTopicHiddenState(e,t){const i=await this.updateTopicHiddenState(e,t);return i&&this.invalidateCaches(),i}async getHiddenTopics(){if(!this.fetchedAllHiddenTopics){const e=await this.fetchHiddenTopics();e&&(_i.G.hiddenTopics.getActionSender(this).send(e),this.fetchedAllHiddenTopics=!0)}return this.getCurrentState().hiddenTopics}async getRelatedTopics(e,t){return this.getTopic(e).then((e=>this.serviceClient.getRelatedTopics(e,t)))}async getNextTopicsInList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.getCurrentState().topicListMap[e];return!(0,et.isUndefined)(t)&&(0,et.isString)(t.nextPageUrl)&&await this.fetchTopicGroup(e)&&(t=this.getCurrentState().topicListMap[e]),t}async getTopic(e){let t=this.getCurrentState().topicMap[e];return(0,et.isUndefined)(t)&&await this.fetchTopic(e)&&(t=this.getCurrentState().topicMap[e]),t}async getTopicsById(e){const t=[],i=[],n=this.getCurrentState().topicMap;for(const o of e){const e=n[o];e?t.push(e):i.push(o)}if(i.length){await this.fetchTopicsById(i);const e=this.getCurrentState().topicMap,n=i.map((t=>e[t])).filter(Boolean);t.push(...n)}return t}async getTopics(e){return this.fetchedAllTopics||await this.fetchTopics(e),this.getCurrentState().topicMap}async getFilteredFeedIds(e,t){this.fetchedAllTopics||await this.fetchTopics(t);const i=this.getCurrentState().topicListMap,n=[];return i&&Object.values(i).forEach((t=>{t.title!==e&&t.topicIds&&n.push(...t.topicIds)})),n}async unfollowTopic(e,t){const i=await this.getTopic(e),n=await this.updateTopicFollowingState(i,si.t.Unfollowed,null,t);return n&&!t&&this.invalidateCaches(),n}async isChannelIdUnfollowable(e){return(await this.getUnfollowableChannelIds()).has(e)}async getUnfollowableChannelIds(){if(!this.unfollowableChannelIds){const{unfollowableChannelIds:e}=await i.e("libs_topics-shared-state_dist_UnfollowableChannelIds_js").then(i.bind(i,59938));this.unfollowableChannelIds=e}return this.unfollowableChannelIds}async restoreDefaultTopics(){try{return await this.serviceClient.restoreDefaultTopics(),this.invalidateCaches(),await ui.U.purgeCacheAsync(ui.R.followedTopics),await this.getFollowedTopics(!0),!0}catch(e){return this.trackAppError({...O.U4N,message:"Failed restoring default set of followed interests",pb:{...O.U4N.pb,customMessage:`Error: ${e&&e.message}`}}),!1}}async fetchFollowedTopics(e){try{const t=await this.serviceClient.getFollowedTopics(e,this.useUserCreatedOrder);if((0,ie.nP)().IsBlendedEnterprise){const e=Object.values(t).find((e=>"CompanyFeed"===e.branding));e&&await this.isLimitedFeed(e)&&delete t[e.id]}return _i.G.followedTopics.getActionSender(this).send(t,e),this.fetchedAllFollowedTopics=!0,!0}catch(e){return _i.G.followedTopicsFailed.getActionSender(this).send(),this.trackAppError({...O.DE1,message:"Failed fetching followed topics",pb:{...O.DE1.pb,customMessage:`Failed fetching followed topics. ${e&&e.message}`}}),!1}}async isLimitedFeed(e){try{const i={feedId:e.id};var t;if(e.apiSource)i.overwriteBaseApiURL=e.apiSource.baseUrl,i.forceEnterpriseCompliance=(null===(t=e.apiSource)||void 0===t?void 0:t.id)===ri.A.work;const n=await this.cardProvider.fetch(i,!0);return!n||!n.cardMetadata||n.cardMetadata.length<5}catch(e){return this.trackAppError({...O.Php,message:"[Enterprise] Failed to check if topic has limited data in feed",pb:{...O.Php.pb,customMessage:e&&e.message}}),!1}}async fetchRecommendedTopics(){try{const e=await this.serviceClient.getRecommendedTopics();return _i.G.recommendedTopics.getActionSender(this).send((0,Bi.Z)(e)),this.fetchedAllRecommendedTopics=!0,!0}catch(e){return _i.G.recommendedTopicsFailed.getActionSender(this).send(),this.trackAppError({...O.oxX,message:"Failed fetching recommended topics",pb:{...O.oxX.pb,customMessage:`Failed fetching recommended topics. ${e&&e.message}`}}),!1}}async fetchHiddenTopics(){try{const e=await this.serviceClient.getHiddenTopicIds(),t=await this.serviceClient.getTopicsById(e);return t.forEach(((e,i)=>{e.followState!==si.t.Followed?e.hidden=!0:delete t[i]})),t}catch(e){return _i.G.hiddenTopicsFailed.getActionSender(this).send(),this.trackAppError({...O.udk,message:"Failed fetching hidden topics",pb:{...O.udk.pb,customMessage:`Failed fetching hidden topics. ${e&&e.message}`}}),null}}async fetchTopic(e){try{const t=await this.serviceClient.getTopic(e),i=this.getCurrentState().topicMap[e];return((0,et.isUndefined)(i)||i.followState!==t.followState)&&_i.G.topic.getActionSender(this).send(t),!0}catch(t){return _i.G.followedTopicsFailed.getActionSender(this).send(),this.trackAppError({...O.Q3G,message:"Failed to fetch topic.",pb:{...O.Q3G.pb,customMessage:`Failed to fetch topic ${e}. ${t&&t.message}`}}),!1}}async fetchTopicsById(e){try{const t=await this.serviceClient.getTopicsById(e);(null==t?void 0:t.length)&&_i.G.topicList.getActionSender(this).send(t)}catch(t){return _i.G.followedTopicsFailed.getActionSender(this).send(),this.trackAppError({...O.Q3G,message:"Failed to fetch topic.",pb:{...O.Q3G.pb,customMessage:`Failed to fetch topics ${e}. ${t&&t.message}`}}),!1}return!0}async fetchTopicGroup(e){if(!e)return!1;const t=this.getCurrentState().topicListMap[e],i=(0,et.isUndefined)(t)||t.nextPageUrl;if(!(0,et.isString)(i))return!1;const n=ne.c.getParamsFromUrl(i);if(null===n)return!1;try{const t=await this.serviceClient.getTopics(null,n);return _i.G.topicGroup.getActionSender(this).send(t.topicGroupMap[e],t.topicMap),!0}catch(t){return _i.G.topicGroupFailed.getActionSender(this).send(e),this.trackAppError({...O.Q3G,message:"Failed to get topics list.",pb:{...O.Q3G.pb,customMessage:`Failed to get topics list ${e}. ${t&&t.message}`}}),!1}}async fetchTopics(e){try{const t=await this.serviceClient.getTopics(e);return _i.G.topics.getActionSender(this).send(t),this.fetchedAllTopics=!0,!0}catch(e){return _i.G.topicsFailed.getActionSender(this).send(),this.trackAppError({...O.Q3G,message:"Failed fetching topics.",pb:{...O.Q3G.pb,customMessage:`Failed fetching topics. ${e&&e.message}`}}),!1}}async updateTopicFollowingState(e,t,i,n){try{var o;const s=t===si.t.Followed,a=await this.serviceClient.updateTopicFollowingState(e,s,i);var r;return n?!s||(null==a||null===(r=a.value)||void 0===r?void 0:r.length)&&(null==a?void 0:a.value[0]):(await ui.U.purgeCacheAsync(ui.R.followedTopics),!e&&s?await this.getFollowedTopics(!0):_i.G.updateTopicFollowedState.getActionSender(this).send(null==e?void 0:e.id,t,this.useUserCreatedOrder),!s||(null==a||null===(o=a.value)||void 0===o?void 0:o.length)&&(null==a?void 0:a.value[0]))}catch(i){return _i.G.updateTopicFollowedStateFailed.getActionSender(this).send(null==e?void 0:e.id,t),void this.trackAppError({...t?O.fNQ:O.jns,message:"Failed to update topic followed state.",pb:{...t?O.fNQ.pb:O.jns.pb,customMessage:`Failed to update followed state to ${t} for ${null==e?void 0:e.id}. ${i&&i.message}`}})}}async updateTopicHiddenState(e,t){const{id:i}=e||{};if(!i)return!1;try{return e.feedType==Ni.SysTag&&await this.serviceClient.updateTopicHiddenState(e,t),_i.G.updateTopicHiddenState.getActionSender(this).send(i,t),!0}catch(e){return _i.G.updateTopicHiddenStateFailed.getActionSender(this).send(i,t),this.trackAppError({...t?O.dxF:O.Gm$,message:"Failed to update topic hidden state.",pb:{...t?O.dxF.pb:O.Gm$.pb,customMessage:`Failed to update hidden state to ${t} for ${i}. ${e&&e.message}`}}),!1}}async gettingTopicsAfterMigration(){return!(!(0,Me.$o)().getItem(j.InterestsNeedRefresh)||await(0,pe.XJ)()!==ee.Hy.SignedIn)&&((0,Me.$o)().removeItem(j.InterestsNeedRefresh),!0)}trackAppError(e){this.trackAppErrorEventCallback&&this.trackAppErrorEventCallback({...e})}invalidateCaches(){(0,di.bY)(pi.T.InterestsChange),(0,ci.yV)(3),(0,Ci.wq)()||(0,he.T1)()}setApiKey(e){this.serviceClient.setForcedApiKey(e)}}var qi=i(10814),Gi=i(20926),Wi=i(38947);class Vi{reduce(e,t){if(!e)return{followedTopicIds:[],followedTopicNames:[],recommendedTopics:[],hiddenTopics:[],topicListIds:[],topicListMap:{},topicMap:{},topicsFetchState:qi.K.InProgress};if(!t)return e;let i,n=!1;return n=n||Wi.G.handleAction(t,_i.G.followedTopics,((t,n)=>{if(!t)return;const o={...e.topicMap};i={...e,topicMap:o,topicsFetchState:qi.K.Loaded};const r=[];Object.keys(t).forEach((e=>{r.push(e);const i=t[e];o[e]=i})),i.followedTopicIds=n?r:(0,Gi.Z)(i.followedTopicIds,r),i.followedTopicNames=i.followedTopicIds.map((e=>{var t;return null===(t=o[e])||void 0===t?void 0:t.name})),this.updateFollowState(i)})),n=n||Wi.G.handleAction(t,_i.G.recommendedTopics,(t=>{if(!t)return;const n={...e.topicMap};t.forEach((e=>{n[e.id]||(n[e.id]=e)})),i={...e,recommendedTopics:t,topicMap:n,topicsFetchState:qi.K.Loaded},this.updateFollowState(i)})),n=n||Wi.G.handleAction(t,_i.G.hiddenTopics,(t=>{if(!t)return;const n={...e.topicMap};t.forEach((e=>{n[e.id]||(n[e.id]=e),n[e.id].hidden=!0})),i={...e,hiddenTopics:t,topicMap:n,topicsFetchState:qi.K.Loaded}})),n=n||Wi.G.handleAction(t,_i.G.topic,(t=>{const n={...e.topicMap};n[t.id]=t,i={...e,topicMap:n,topicsFetchState:qi.K.Loaded}})),n=n||Wi.G.handleAction(t,_i.G.topics,(t=>{if(!t)return;const n={...e.topicMap};Object.keys(t.topicMap).forEach((i=>{const o=e.topicMap[i];n[i]={...t.topicMap[i],isInferred:o&&o.isInferred}})),i={...e,topicListIds:t.topicGroupIds,topicListMap:t.topicGroupMap,topicMap:n,topicsFetchState:qi.K.Loaded},this.updateFollowState(i)})),n=n||Wi.G.handleAction(t,_i.G.topicGroup,((t,n)=>{if(!t||!t.topicIds||0===t.topicIds.length||!n)return;const o={...e.topicListMap},r={...e.topicMap},s=o[t.id];t.nextPageUrl&&(s.nextPageUrl=t.nextPageUrl),s&&s.topicIds&&(s.topicIds=(0,Gi.Z)(s.topicIds,t.topicIds)),t.topicIds.forEach((e=>{r[e]=n[e]})),i={...e,topicListMap:o,topicMap:r,topicsFetchState:qi.K.Loaded},this.updateFollowState(i)})),n=n||Wi.G.handleAction(t,_i.G.updateTopicFollowedState,((t,n,o)=>{const r={...e.topicMap},s=e.followedTopicIds.slice(),a=e.followedTopicNames.slice(),l=e.topicMap[t];if(n!==si.t.Unfollowed){if((0,$i.Z)(l)){const e={followState:si.t.Followed,id:t,name:""};r[t]=e}else{if(l.followState===si.t.Followed&&!l.isInferred)return;l.followState===si.t.Followed&&l.isInferred&&(r[t].isInferred=!1),r[t].followState=si.t.Followed,i={...e,topicMap:r}}var c,d;if(s.indexOf(t)<0)o?a.unshift(null===(c=r[t])||void 0===c?void 0:c.name):a.push(null===(d=r[t])||void 0===d?void 0:d.name),o?s.unshift(t):s.push(t)}else{if((0,$i.Z)(l))return;r[t].followState=si.t.Unfollowed;const e=s.indexOf(t);e>=0&&(s.splice(e,1),a.splice(e,1))}const p=e.recommendedTopics.map((e=>({...e,followState:e.id===t?n:e.followState})));i={...e,followedTopicIds:s,followedTopicNames:a,topicMap:r,recommendedTopics:p}})),n=n||Wi.G.handleAction(t,_i.G.updateTopicHiddenState,((t,n)=>{const o={...e.topicMap},r=e.hiddenTopics.slice(),s=e.topicMap[t];if(s){if(n){if(s.hidden)return;o[t].hidden=!0,i={...e,topicMap:o},r.find((e=>e.id===t))||r.push(s)}else{o[t].hidden=!1;const e=r.findIndex((e=>e.id===t));e>=0&&r.splice(e,1)}i={...e,topicMap:o,hiddenTopics:r}}})),n=n||Wi.G.handleAction(t,_i.G.recommendedTopicsFailed,(()=>{i={...e,topicsFetchState:qi.K.Failed}})),n=n||Wi.G.handleAction(t,_i.G.hiddenTopicsFailed,(()=>{i={...e,topicsFetchState:qi.K.Failed}})),n=n||Wi.G.handleAction(t,_i.G.followedTopicsFailed,(()=>{i={...e,topicsFetchState:qi.K.Failed}})),n||(n=Wi.G.handleAction(t,_i.G.topicList,(t=>{const n={...e.topicMap};t.forEach((e=>n[e.id]=e)),i={...e,topicMap:n,topicsFetchState:qi.K.Loaded}}))),i||e}updateFollowState(e){const{followedTopicIds:t}=e;Object.keys(e.topicMap).forEach((i=>{const n=e.topicMap[i];n&&(n.followState=t.includes(i)?si.t.Followed:si.t.Unfollowed)})),e.recommendedTopics.forEach((e=>{e.followState=t.includes(e.id)?si.t.Followed:si.t.Unfollowed}))}}var Ki=i(44070);class Qi{constructor(e,t){this.fetchImpl=e,this.handleAppErrorEventCall=t,this.endPoint="msn/suggestions",this.servicdeOcid="feeds"}async getSuggestedInterests(e,t,i){if(ai.b.isNullOrWhiteSpace(e))return[];const n=e.trim(),o=await this.getRequestInit(),r=[...await this.getCommonParams(),{key:"qscope",value:"news"},{key:"q",value:n},{key:"Type",value:i||"provider,bingtopic,category"},{key:"$top",value:String(t)}],s=(0,ae.PH)(this.endPoint);return r.forEach((e=>e.value&&s.searchParams.set(e.key,e.value))),await this.fetchSuggestionItems(s,o)}async getSuggestedInterestsAndSources(e,t,i){if(ai.b.isNullOrWhiteSpace(e))return[];const n=e.trim(),o=await this.getRequestInit(),r=[...await this.getCommonParams(),{key:"qscope",value:"news"},{key:"q",value:n},{key:"kind",value:(null==i?void 0:i.kind)||"topic"},{key:"subKind",value:(null==i?void 0:i.subKind)||"bingtopic,category"},{key:"$top",value:String(t)}],s=(0,ae.PH)(`v1/${this.endPoint}`);return r.forEach((e=>e.value&&s.searchParams.set(e.key,e.value))),await this.fetchSuggestionItems(s,o)}async fetchSuggestionItems(e,t){const i=await this.sendRequest(decodeURIComponent(e.href),t);if(!i)return null;let n=null;try{n=i.value[0].groups[0].suggestionItems}catch(e){this.handleAppErrorEventCall(O.wXh)}return(0,Ki.Z)(n,"id")}async getRequestInit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e&&(e={method:"GET"}),await(0,pe.XJ)()===ee.Hy.SignedIn&&(e.credentials="include"),e.headers=(0,Ci.wq)()?await(0,xi.dG)():await se.$D.getOneServiceHeaders(),e}async getCommonParams(){if("winWidgets"===E.jG.AppType&&(this.servicdeOcid="winp2"),(0,Ci.wq)())return this.getSapphireQueryParams();const e=await(0,pe.XJ)()===ee.Hy.SignedIn?se.$D.getOneServiceParamsWithAuth(E.jG.UserId,this.servicdeOcid):se.$D.getOneServiceParamsWithoutAuth(E.jG.UserId,this.servicdeOcid);if(this.forcedApiKey){e.find((e=>"apikey"==e.key)).value=this.forcedApiKey}return e}getSapphireQueryParams(){const e=se.$D.getOneServiceNonDynamicParamsWithoutAuth(this.servicdeOcid),t=(0,Si._4)();return t&&(e.push({key:E.jG.OneServiceContentMarketQspKey,value:t.market}),E.jG.ShouldUseFdheadQsp&&e.push({key:"fdhead",value:t.features}),e.push({key:"activityId",value:t.activityId}),t.latitude&&t.longitude&&e.push({key:"location",value:`${t.latitude}|${t.longitude}`})),e}async sendRequest(e,t){return(0,wi.aH)()?await this.sapphireRequest(decodeURIComponent(e),t):await this.networkRequest(decodeURIComponent(e),t)}async sapphireRequest(e,t){const i={url:e,headers:t.headers,body:t.body,refresh:!0},n=await(0,Ti.FM)(i);return JSON.parse(n||"{}")}async networkRequest(e,t){return await(0,Pe.w)((async()=>{const i=await this.fetchImpl(e,t);return i.ok?i.json():(this.handleAppErrorEventCall(O.QW8),null)}),"getSuggestedInterests")}setForcedApiKey(e){this.forcedApiKey=e}}var Ji=i(42467);const Zi=e=>e&&e.length?"region"in e[0]?e:[{region:"river",subSections:e}]:[];class Xi{constructor(e){this.fetchCount=0,this.useFeedCardRequestBuilder=e}async prepareUrl(e){let t,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{refreshType:o,nextPageUrl:r,duotone:s,gemQspList:a,theme:l,clientLayoutVersion:c,timeoutMs:d}=e||{},p=new URLSearchParams((0,le.zp)()),u=p.get("aver"),h=p.get("usri"),g=p.get("over"),f=p.get("oem"),v=p.get("devicetype"),m=p.get("smode"),y=p.get("timeOut"),b=p.get(Ae.Yu.uniFeatTun),w=y||d||2e3;if(this.useFeedCardRequestBuilder){const n={...e,enableRightRailColumn:e.enableRightRailColumnLayout,wpoSchema:e.enableRightRailColumnLayout?"byregion":e.wpoSchema||"",wpoPageId:e.enableRightRailColumnLayout&&!e.wpoPageId?"singlecolwin":e.wpoPageId,requestType:Z.oneService,timeoutMs:w,layout:e.layout,pageOcid:e.pageOcid,weatherSegment:e.weatherSegment,weatherScenario:e.weatherScenario,aver:u,usri:h,over:g,oem:f,devicetype:v,smode:m,oneSvcUni:b,theme:l};t=await xe.requestInit(n),i=await xe.buildRequestURLForOneService(n)}else{const{pageScenario:d,ocid:y,wpoPageId:S,additionalHeaders:C,contentType:x,enableWpoAdPlacements:T,taboolaSessionId:k,muidFallback:I,enableRightRailColumnLayout:P,installedWidgets:$,geolocation:F,layout:L,refreshCnt:R,viewportSize:A,isEdgeUninstalled:O,allFeedsDisabled:M,firstPartyFeedDisabled:U,column:D,rotationDisabled:N,badgingDisabled:H,disable3P:_,defaultWidgets:j,colstatus:z,interestIds:q,colwidth:G}=e||{};let V=e&&e.flightData;!n&&(t=await this.getRequestInit({method:"GET",credentials:"include"},C));const K=(0,he.Ee)(),Q=`news/feed/pages/${d}`;i=p.get(B.YU)?new URL(Q,B.LJ):(0,ae.fU)(Q);const{WidgetAttributes:J={},CurrentMarket:Z}=E.jG;if(S&&("wpoads"!==S.toLowerCase()||Ji.Ze.includes(null==Z?void 0:Z.toLowerCase())?i.searchParams.set("wpopageid",S):i.searchParams.set("wpopageid","wponoads")),L&&i.searchParams.set("layout",L),u&&i.searchParams.set("aver",u),h&&i.searchParams.set("usri",h),g&&i.searchParams.set("over",g),f&&i.searchParams.set("oem",f),v&&i.searchParams.set("devicetype",v),m&&i.searchParams.set("smode",m),b?i.searchParams.set(Ae.Yu.uniFeatTun,b):"url"===W.Gq.get("oneSvcUniTunMode")&&i.searchParams.set(Ae.Yu.uniFeatTun,await se.$D.getUniFeatTunHeader()),l&&i.searchParams.set("theme",l),R&&i.searchParams.set("refreshcnt",R),a)for(const e in a)i.searchParams.set(e,a[e]);if(A&&i.searchParams.set("vpSize",A),D&&i.searchParams.set("column",D),J.telemetry&&J.telemetry.tmpl&&J.telemetry.tmpl.includes("pwbingads2")){const e="prg-binghplite";V=V?`${V},${e}`:e}if(P&&(i.searchParams.set("wpopageid","singlecolwin"),i.searchParams.set("wposchema","byregion")),$&&$.length&&i.searchParams.set("installedWidgets",$.join(",")),F){const e=F.latitude&&F.longitude,t=F.positionSource&&F.positionSource.length>0,n=F.timestamp&&F.timestamp.length>0;e&&t&&n&&F.accuracy&&(i.searchParams.set("clientLocation",F.latitude+"|"+F.longitude),i.searchParams.set("clientLocationAccuracy",F.accuracy.toString()),i.searchParams.set("clientLocationProvider",F.positionSource),i.searchParams.set("clientLocationTimestamp",F.timestamp))}const X=ne.c.getParamsWithItems(location.search);if(X){const e=X.find((e=>"installedWidgetsOverride"===e.key));e&&e.value&&i.searchParams.set("installedWidgets",e.value)}if(r){const e=new te.h(new URL(r).search);K>0&&e.set(he.i$,K.toString()),e.set("timeOut",`${w}`),!E.jG.SendFeedCallActivityIdInHeader&&E.jG.ActivityId&&("winWidgets"===E.jG.AppType&&e.get("activityId")||e.set("activityId",E.jG.ActivityId)),i.search=e.toString()}else{const e=[...await this.getCommonParams(y,V,I),{key:"contentType",value:x},{key:"timeOut",value:`${w}`}];(null==q?void 0:q.length)>0&&e.push({key:"interestIds",value:q}),K>0&&e.push({key:he.i$,value:K.toString()}),e.forEach((e=>e.value&&i.searchParams.set(e.key,e.value)))}if(E.jG.SendFeedCallActivityIdInHeader&&i.searchParams.delete("activityId"),T){const e=ie.Al.ClientSettings.browser&&"true"===ie.Al.ClientSettings.browser.ismobile||"phone"===ie.Al.ClientSettings.deviceFormFactor?"true":"false";i.searchParams.set("mobile",e);const n=(0,ue.rv)()||(0,ue.hI)();i.searchParams.set("cookieWallPresent",n.toString()),t&&(t.headers[Ae.Yu.adsReferer]=location.href,t.headers[Ae.Yu.taboolaSessionId]=k||"init")}const Y=p.get(B.hE.wpoitems);if(Y&&i.searchParams.set(B.hE.wpoitems,Y.toString()),o&&i.searchParams.set("caller",o),s&&i.searchParams.set("duotone",s.toString()),c&&i.searchParams.set("clv",c),z&&(i.searchParams.set("colstatus",z),i.searchParams.set("layout",L)),G&&i.searchParams.set("colwidth",G.toString()),location.search&&location.search.indexOf("idxContentTypeOverride")>-1){const t=ne.c.getParamsWithItems(location.search);if(t){const n=t.find((e=>"idxContentTypeOverride"===e.key));if(n){const t=e.contentType?e.contentType:"article,video,slideshow",o=[...new Set(`${t},${n.value}`.split(","))];i.searchParams.set("contentType",o.join(","))}}}O&&i.searchParams.set("appUninstall","1"),M&&i.searchParams.set("feedsDisabled","1"),U&&i.searchParams.set("disableContent","true"),N&&i.searchParams.set("aeprd","1"),H&&i.searchParams.set("aepbd","1"),_&&i.searchParams.set("disable3P","1"),j&&i.searchParams.set("defaultWidgets","1"),i.searchParams.sort()}return"header"===W.Gq.get("oneSvcUniTunMode")&&t&&t.headers&&(t.headers[Ae.Yu.uniFeatTun]=await se.$D.getUniFeatTunHeader()),{url:i,requestParams:t}}async fetch(e,t,i,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5?arguments[5]:void 0;const{url:s,requestParams:a}=await this.prepareUrl(e),{useSuperFeed:l,nextPageUrl:c,refreshType:d,gemQspList:p,pageScenario:u}=e||{},h=d&&d===Ji.Rx.Bgtask||!1,g=!c,f=(0,N.Ou)();try{c||(f[z.p.feedCallStart]=Math.round((0,N.UE)()),"number"==typeof f[z.X]&&(f[z.p.configEndToFeedStart]=Math.round((0,N.UE)()-f[z.X]))),t&&t();const d=i||Pe.w,y=await d((async e=>{let t=s.href;return e>0&&(s.searchParams.set("caller",Ji.Rx.RetryFetch),s.searchParams.sort()),o&&2===e&&g&&(t=t.replace("//assets.msn","//api.msn").replace("/service/","/")),_.M0.addOrUpdateTmplProperty("1sfcnt",""+ ++this.fetchCount),await fetch(decodeURIComponent(t),a)}),`OneServicePageProvider.fetch ${this.isFullPageRequest(p,"")}`,n,r),b=y.headers;if(!y||!y.ok){const{status:e,statusText:t}=y||{},i={...O.SyQ,message:y?"OneService returned error response":"OneService response was null",pb:{...O.SyQ.pb,url:s.href,status:e,statusText:t,requestHeaders:JSON.stringify((0,R.GI)(a&&a.headers)),responseHeaders:this.getResponseHeaders(y),isBackgroundRefresh:h,isInitialRequest:g,isFPRequest:this.isFullPageRequest(p)}};return _.M0.sendAppErrorEvent(i),{responseHeaders:b,sections:null,appError:i}}if(204===y.status){return{responseHeaders:b,sections:[],appError:this.logAndReturnNoContentError(s,a,y.status,h,y,g,p)}}let w,S,C=!1,x="";if(y.headers){C=y.headers.get("X-Statics-Fallback"),C&&((0,he.e5)(C),_.M0.sendAppErrorEvent({...O.qst,pb:{...O.qst.pb,isBackgroundRefresh:h,responseHeaders:this.getResponseHeaders(y),url:s.href,isInitialRequest:g,isFPRequest:this.isFullPageRequest(p)},message:"Fell back to static content on the feeds call"}));const t=y.headers.get("ddd-tmpl");t&&_.M0.addOrUpdateTmplString(t),e.locallyStoreRecommendedInterestsTmpl&&this.storeRecommendedInterestsTmpls(t);const i=y.headers.get(Ae.rD.traceId);w=_.M0.addOrUpdateIdxId(i,!c),x=y.headers.get(Ae.rD.debugId),x&&(0,he.Dz)(x,!c)}if(!c){const e=f[z.p.feedCallStart];S=f[z.p.feedResponseBack]=Math.round((0,N.UE)()),f[z.p.feedRequestFG]=S-e,(0,H.QP)({name:z.p.feedRequestFG,startTime:e,endTime:S})}const T=await y.json();let k;S&&(f[z.p.feedParse]=Math.round((0,N.UE)())-S);const I="freinterests"===u&&200===y.status;if(T&&T.sections&&T.sections.length||I||(k=this.logAndReturnNoContentError(s,a,y.status,h,y,g,p)),x&&(T.debugId=x),y&&y.status&&(T.status=y.status),"winfullpage"===u&&T&&T.sections&&T.sections.length>0){const e=T.sections;(e[0].subSections&&e[0].subSections.length>0?e[0].subSections:e).some((e=>!e.layoutTemplate))&&_.M0.sendAppErrorEvent({...O.Abn,pb:{...O.Abn.pb,url:decodeURIComponent(s.href),dataTemplate:T.sections.map((e=>e.dataTemplate)).join(","),layoutTemplate:T.sections.map((e=>e.layoutTemplate)).join(",")},message:"LayoutTemplate field missing for sections on the feeds call"})}const P=T&&T.serviceContext&&T.serviceContext.debugInfo&&T.serviceContext.debugInfo.includes("layout:oneservice");var v,m;if(P)_.M0.sendAppErrorEvent({...O.FsZ,message:"1S returned static fallback due to WPO failure.",pb:{...O.FsZ.pb,url:decodeURIComponent(s.href),debugId:null==T||null===(v=T.serviceContext)||void 0===v||null===(m=v.debugInfo)||void 0===m?void 0:m.debugId}});if(l){const e=(e=>{const{sections:t,...i}=e;return{sections:Zi(t),...i}})(T);return{responseHeaders:b,...e,isStatic:C}}return{responseHeaders:b,...T,appError:k,isStatic:!!C,traceIdIndex:w,isWpoFallback:!!P}}catch(e){var y;const t={...O.gX7,message:"Error while fetching OneService response",pb:{...O.gX7.pb,url:s.href,endpoint:null===(y=s.href)||void 0===y?void 0:y.split("?")[0],activityId:E.jG.ActivityId,requestHeaders:JSON.stringify((0,R.GI)(a.headers)),customMessage:`${e}`,isBackgroundRefresh:h,isInitialRequest:g,isFPRequest:this.isFullPageRequest(p)}};_.M0.sendAppErrorEvent(t);let i=!1;this.isUserNetworkConditionError(e.message)&&(i=!0);let n=!1;return this.isUserFailedToFetchError(e.message)&&(n=!0),{sections:null,appError:t,userEndError:i,userEndFailedToFetch:n}}}storeRecommendedInterestsTmpls(e){const t=e.match(Ji.yz),i=e.match(Ji.ah);t&&t[0]&&i&&i[0]&&(0,Me.$o)().setItem(Ji.Xm,`${t[0]};${i[0]}`)}async getRequestInit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{method:"GET"},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};await(0,pe.XJ)()===ee.Hy.SignedIn&&(e.credentials="include");const i=await se.$D.getOneServiceFeedCallHeaders();return e.headers={...i,...t},e}async getCommonParams(e,t,i){return await(0,pe.XJ)()===ee.Hy.SignedIn?se.$D.getOneServiceParamsWithAuth(E.jG.UserId,e,!1,t):se.$D.getOneServiceParamsWithoutAuth(E.jG.UserId||i&&`m-${E.jG.ActivityId}`,e,!1,t)}logAndReturnNoContentError(e,t,i,n,o,r,s){const a={...O.mjE,message:"Service returned no content.",pb:{...O.mjE.pb,activityId:E.jG.ActivityId,requestHeaders:JSON.stringify((0,R.GI)(t.headers)),responseHeaders:this.getResponseHeaders(o),status:i,url:e.href,isBackgroundRefresh:n,isInitialRequest:r,isFPRequest:this.isFullPageRequest(s)}};return _.M0.sendAppErrorEvent(a),a}isFullPageRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"no";return e?`gemQSP: ${JSON.stringify(e)}`:t}isUserNetworkConditionError(e){return e&&"Failed to fetch"==e||"Service Request Timed out!"==e||"Service Request Timed out after 10000 milliseconds!"==e}isUserFailedToFetchError(e){return e&&"Failed to fetch"==e}getResponseHeaders(e){return e&&e.headers?JSON.stringify({"Akamai-Request-ID":e.headers.get("Akamai-Request-ID"),"Akamai-Server-IP":e.headers.get("Akamai-Server-IP"),"X-MSEdge-Ref":e.headers.get("X-MSEdge-Ref"),"Ddd-Debugid":e.headers.get("Ddd-Debugid")}):null}}var Yi=i(88685),en=i(11514),tn=i(84964),nn=i(72685),on=i(66651);const rn="notiticationSettingsUpdated",sn="Finance",an="News",ln="Sports",cn="Shopping",dn="Traffic",pn="Weather",un="Finance_EarningsBrief",hn="Finance_PriceMovement",gn="Finance_MarketBrief",fn="Finance_EarningRelease",vn="Finance_InstitutionalHolding",mn="Finance_Sentiment",yn="Finance_WatchlistSummary",bn="Finance_PrepopulatedWatchlist",wn="Finance_EventBrief",Sn="Finance_FlashNews",Cn="News_BreakingNews",xn="News_TrendingNews",Tn="News_ForYouNews",kn="Weather_ETree",In="Weather_WeatherSummary",Pn="Weather_Pollen",$n="Weather_Nowcast",Fn="Weather_AQI",Ln="Weather_Hurricane",En="Weather_SevereWeather",Rn="Weather_Wildfire",An="Weather_SunriseSet",On="Weather_LifeIndex",Mn="Weather_TeaserHumidity",Un="Weather_TeaserUVIndex",Dn="Weather_TeaserVisibility",Nn="Weather_TeaserWind",Hn="Weather_TeaserTempChange",_n="Weather_TeaserTemp",jn="Weather_TeaserSummary",Bn="Weather_TeaserTempRecord",zn="Weather_TeaserRain",qn="Weather_Storm",Gn="Sports_SportsMatch",Wn="Traffic_Commute",Vn="Traffic_HighestImpactIncident",Kn="Traffic_AreaSummary",Qn="Traffic_Accident",Jn="Traffic_Construction",Zn="Traffic_RoadHazard",Xn="Traffic_RoadClosure",Yn="Traffic_Congestion",eo="Shopping_DealOfTheDay";var to=i(27940);const io=Object.freeze({calendar:"/sports/calendar",liveGames:"/sports/livegames",urls:"/sports/urls",teams:"/sports/teams",teamPlayers:"/sports/teamplayers",liveSchedules:"/sports/liveschedules",leagues:"/sports/leagues",videos:"/sports/videos",topPlayers:"/sports/topplayers",topTeams:"/sports/topteams",standings:"/sports/standings",statistics:"/sports/statistics",lineups:"/sports/lineups",timeline:"/sports/timeline",brackets:"/sports/bracket",rankings:"/sports/rankings",liveAroundTheLeague:"/sports/livearoundtheleague",gptAnalysis:"sports/aicompletion",entityHeader:"/sports/entityheader"}),no=Object.freeze({post:"POST",get:"GET",delete:"DELETE"}),oo=Object.freeze({version:"version",apiKey:"apikey",user:"user",latitude:"lat",longitude:"long",timeZoneOffset:"tzoffset",ids:"ids",id:"id",gameId:"gameid",sport:"sport",leagueId:"leagueid",scope:"scope",pageTypes:"pagetypes",type:"type",dates:"dates",date:"date",datetime:"datetime",top:"$top",filter:"$filter",teamIds:"teamIds",take:"take",idType:"idtype",standingsType:"standingstype",seasonPhase:"seasonPhase",withCalendar:"withcalendar",seasonId:"seasonId",videoScope:"videoscope",noCache:"nocache",withLeagueReco:"withleaguereco",fields:"fields",sortField:"sortfield",sortOrder:"sortorder",page:"page",isSimulated:"issimulated",flights:"flights"});Object.freeze({leagueHome:"LeagueHome",scores:"Scores",schedule:"Schedule",standings:"Standings",teams:"Teams",team:"Team",gameCenter:"GameCenter",teamRoster:"TeamRoster",player:"Player",playerStats:"PlayerStats",teamStats:"TeamStats",polls:"Polls",videos:"Videos",tourCalendar:"TourCalendar",tourRankings:"TourRankings",raceCalendar:"RaceCalendar",driverStandings:"DriverStandings",iccRankings:"ICCRankings",rankings:"Rankings",bracket:"Bracket",statistics:"Statistics",headlines:"Headlines",tournament:"Tournament"}),Object.freeze({sportsVertical:"SportsVertical",sport:"Sport",league:"League",team:"Team",player:"Player",game:"Game"}),Object.freeze({previousMatchups:"PreviousMatchups",leagueSchedule:"LeagueSchedule",aroundTheLeague:"AroundTheLeague",teamSchedule:"TeamSchedule",leagueCompleted:"LeagueCompleted",leagueFeatured:"LeagueFeatured",leagueUpcoming:"LeagueUpcoming",tennismonthschedule:"TennisMonthSchedule",monthlySportSchedule:"MonthlySportSchedule",leagueScores:"LeagueScores"}),Object.freeze({injuries:"Injuries"}),Object.freeze({playerLeague:"Playerleague",playerGame:"Playergame",teamGame:"Teamgame",teamLeague:"TeamLeague",league:"League"}),Object.freeze({league:"league",team:"team",player:"player",division:"division",conference:"conference",group:"group",game:"game",leagueDivision:"leaguedivision"}),Object.freeze({league:"league"}),Object.freeze({league:"league",group:"group",conference:"conference",division:"division",team:"team",player:"player"}),Object.freeze({regularSeason:"regularSeason",entireSeason:"entireSeason",inSeasonTournament:"inSeasonTournament"}),Object.freeze({league:"league",team:"team"}),Object.freeze({playByPlay:"playbyplay",default:"timeline"}),Object.freeze({entityHeader:"EntityHeader",follow:"Follow",default:"Full"});var ro=i(69619);class so{constructor(){this.ignoreQspsDefault=new Set([oo.apiKey,"ocid","activityId"]),this.ignoreQspsSpecific=new Set,this.handleApiEndpoints=void 0}shouldHandleCaching(e,t){var i;return e===no.get&&(!this.handleApiEndpoints||(null===(i=this.handleApiEndpoints)||void 0===i?void 0:i.some((e=>{var i;return e&&(null==t||null===(i=t.pathname)||void 0===i?void 0:i.includes(e))}))))}getCacheKey(e,t){return e!==no.get?null:null!=t&&t.href?t.origin+t.pathname:null}areQspsEqual(e,t){if(null==e||!e.length)return!(null!=t&&t.length);if(null==t||!t.length)return!1;const i=e.filter((e=>!this.ignoreQspsDefault.has(null==e?void 0:e.key)&&!this.ignoreQspsSpecific.has(null==e?void 0:e.key))),n=t.filter((e=>!this.ignoreQspsDefault.has(null==e?void 0:e.key)&&!this.ignoreQspsSpecific.has(null==e?void 0:e.key)));return i.length===n.length&&JSON.stringify(i)===JSON.stringify(n)}}const ao=new so;const lo=Object.freeze({actions:"graph/actions"});Object.freeze({dislike:"Dislike",follow:"Follow"}),Object.freeze({sport:"Sport",league:"League",team:"Team",tagBase:"TagBase"}),Object.freeze({actionType:"actionType",targetId:"targetId",targetType:"targetType"}),(0,ae.qQ)();const co=new Map,po=[new class extends so{constructor(){super(...arguments),this.handleApiEndpoints=[io.liveAroundTheLeague],this.ignoreQspsSpecific=new Set([oo.datetime])}},new class extends so{constructor(){super(...arguments),this.handleApiEndpoints=[io.entityHeader],this.ignoreQspsSpecific=new Set([oo.pageTypes])}areQspsEqual(e,t){var i,n,o,r;if(!super.areQspsEqual(e,t))return!1;const s=null===(i=t.find((e=>(null==e?void 0:e.key)===oo.pageTypes)))||void 0===i?void 0:i.value,a=null===(n=e.find((e=>(null==e?void 0:e.key)===oo.pageTypes)))||void 0===n?void 0:n.value;if(!s)return!a;if(!a)return!1;const l=null===(o=decodeURIComponent(s))||void 0===o?void 0:o.split(","),c=null===(r=decodeURIComponent(a))||void 0===r?void 0:r.split(",");if(null==l||!l.length)return!(null!=c&&c.length);if(null==c||!c.length)return!1;const d=new Set(l);return c.every((e=>d.has(e)))}}],uo=[lo.actions];function ho(e){return ne.c.getParams(e.search).sort(((e,t)=>e.key.localeCompare(t.key)))}function go(e,t){const i=function(e,t){if(null!=t&&t.href&&!uo.some((e=>t.pathname.includes(e))))return po.find((i=>i.shouldHandleCaching(e,t)))||ao}(e,t);if(!i)return{cacheKey:null,cachableApi:null};const n=i.getCacheKey(e,t);return n?{cacheKey:n,cachableApi:i}:{cacheKey:null,cachableApi:i}}function fo(){return function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)??(0,le.ij)();return!("undefined"==typeof window||!/Sapphire/i.test(e))}()}const vo="SportsServiceConnectorClientConnectionError";var mo=i(62512);function yo(e,t,i){try{const n=new URL(t).search||"",o=new URL(e+n,t);return o&&ne.c.isValidUrl(o.href,!0)?o:(i&&(0,A.H)(O.Cm8,"Could not create a valid URL to fetch sports data.",`base URL=${t}, sub path=${e}`),null)}catch(n){return i&&(0,A.OO)(n,O.Cm8,"An error occured when creating a URL to fetch sports data.",`error=${n&&n.message}, base URL=${t}, sub path=${e}`),null}}async function bo(e,t){var i,n;t.apiKey&&e.searchParams.set(oo.apiKey,t.apiKey),t.version&&e.searchParams.set(oo.version,t.version),e.searchParams.set(E.jG.OneServiceContentMarketQspKey,function(){let e,t=null;fo()&&(t=(0,Si._4)());e=t?t.market:E.jG.CurrentMarket;return e||"en-us"}());if(!0===((null===ie.Al||void 0===ie.Al?void 0:ie.Al.CurrentFlights)&&void 0!==(null===(i=ie.Al.CurrentFlights.split(","))||void 0===i?void 0:i.find((e=>"prg-sp-simulation"===e))))&&e.searchParams.set(oo.isSimulated,"true"),t.includeTimeZoneOffset){const t=(new Date).getTimezoneOffset();e.searchParams.set(oo.timeZoneOffset,Math.floor(-t/60).toString())}const o=fo()&&(0,Si._4)();if(t.includeUserId){const t=o?o.anid:(0,E.Yq)().UserId;(0,mo.TF)(t)||e.searchParams.set(oo.user,t)}if(t.includeUserLoc){const t=o?o.latitude:(0,E.Yq)().Latitude,i=o?o.longitude:(0,E.Yq)().Longitude;(0,mo.TF)(t)||(0,mo.TF)(i)||(e.searchParams.set(oo.latitude,t),e.searchParams.set(oo.longitude,i))}t.includeFlights&&null!==ie.Al&&void 0!==ie.Al&&null!==(n=ie.Al.CurrentFlights)&&void 0!==n&&n.length&&e.searchParams.set(oo.flights,null===ie.Al||void 0===ie.Al?void 0:ie.Al.CurrentFlights);const r=t.ocid||"";(await ko()?se.$D.getOneServiceParamsWithAuth((0,E.Yq)().UserId,r,t.addPageInfoToOcid):se.$D.getOneServiceParamsWithoutAuth((0,E.Yq)().UserId,r,t.addPageInfoToOcid)).forEach((t=>t.value&&!e.searchParams.has(t.key.toLowerCase())&&e.searchParams.set(t.key,t.value))),t.additionalParameters&&t.additionalParameters.length&&t.additionalParameters.forEach((t=>{t.value&&e.searchParams.set(t.key,t.value)})),t.filter&&e.searchParams.set(oo.filter,t.filter),t.top&&e.searchParams.set(oo.top,t.top),t.take&&e.searchParams.set(oo.take,t.take)}const wo=async(e,t,i)=>{if(!t)return{headers:{},method:e};const n=await se.$D.getBaseRequestData(e);return i&&(n.body=i),await ko()&&(n.credentials="include"),n};async function So(e,t,i,n){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;try{var l;let c=!a&&function(e,t){const{cacheKey:i,cachableApi:n}=go(e,t);if(!i||!n)return{response:null};const o=co.get(i);if(null==o||!o.length)return{response:null};const r=ho(t),s=o.find((e=>n.areQspsEqual(r,e.sortedQsps)));return{response:(null==s?void 0:s.response)??null,errorTrace:null==s?void 0:s.errorTrace}}(e,t);if(c&&c.response)s&&(null==s||s.addTrace("Using cached response."),c.response.then((()=>{if(null==s||s.addTrace("Cached response is resolved."),c&&c.errorTrace){for(const e of c.errorTrace.allTraces()||[])null==s||s.addTrace(e);for(const e of c.errorTrace.allMarkers()||[])null==s||s.addTraceMarker(e)}else null==s||s.addTrace("No error trace is kept for the response. Skipping combination of traces.")}),(()=>{null==s||s.addTrace("Cached response is rejected! Not being able to combine the traces.")})));else{const a=Co(e,t,i,n,o,r,s);!function(e,t,i,n){const{cacheKey:o,cachableApi:r}=go(e,t);if(!o||!r)return;const s=co.get(o)||[];s.push({sortedQsps:ho(t),response:i,errorTrace:n}),co.set(o,s)}(e,t,a,s),c={response:a,errorTrace:s}}return await(null===(l=c)||void 0===l?void 0:l.response)}catch(a){return(0,A.OO)(a,O.Huj,"Unknown error when using cache for invoking service in Service Connector.",`Error stack: ${null==a?void 0:a.stack}`),await Co(e,t,i,n,o,r,s)}}async function Co(e,t,i,n){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0;try{const a=await wo(e,r,n),l=await(0,Pe.w)((async()=>await async function(e,t,i,n,o){const r=(0,Si._4)(),s=fo();if(e===no.get&&s&&(null==r?void 0:r.platform)===ro.dO.Android){let i;try{return i=(0,Ti.FM)({url:decodeURIComponent(t),refresh:!0,processError:!0}),i?null==o||o.addTrace(`Sapphire response acquired: ${JSON.stringify(i)}`):xo(i,r,s,e,t,n,o),{success:!0,response:i}}catch(a){xo(i,r,s,e,t,n,o)}}const a=await fetch(decodeURIComponent(t),i);if(null==a||!a.ok)return To(a,r,s,e,t,n,o),{success:!1,response:Promise.resolve()};const l=e===no.delete?Promise.resolve(a):a.json();l||To(a,r,s,e,t,n,o);return{success:!0,response:l}}(e,t.href,a,i,s)),`InvokeSportsService_${e}`);return l&&l.success?o?function(e,t,i){if(!e)return t&&(0,A.H)(t,"Received JSON data is null or undefined."),null==i||i.addTrace("Received JSON data is null or undefined."),null;let n;try{n=JSON.parse(e)}catch(n){return t&&(0,A.OO)(n,t,"Received JSON data parse exception.",`error=${n&&n.message}, data=${e}`),null==i||i.addTrace(`Received JSON data parse exception. error=${n&&n.message}, data=${e}`),null}return n||(t&&(0,A.H)(t,"JSON data parsed but it became undefined or null.",`data=${e}`),null==i||i.addTrace(`JSON data parsed but it became undefined or null. data=${e}`),null)}(await l.response,i?O.jhV:void 0,s):await l.response:(null==s||s.addTrace(`No valid response received and returning null. Response: ${l&&JSON.stringify(l)}`),null)}catch(o){!function(e){!!e&&e.addTraceMarker(vo)}(s);const r=(0,E.Yq)(),a={requestUrl:Io(t.href),httpMethod:e,activityId:r.ActivityId,isMobile:r.isMobile,requestBody:$o(JSON.stringify(n))},l=`Error while invoking Sports services method with exception: ${null==o?void 0:o.name}: ${$o(null==o?void 0:o.message)}, stack: ${$o(null==o?void 0:o.stack)}. Api debug info: ${JSON.stringify(a)}.`;return i&&_.M0.sendAppErrorEvent({...O._X1,message:"Error while invoking Sports services with exception.",pb:{...O._X1.pb,fetchNetworkResponse:{...a},customMessage:l}}),null==s||s.addTrace(l),null}}function xo(e,t,i,n,o,r,s,a){const l=(0,E.Yq)(),c={requestUrl:Io(o),httpMethod:n,activityId:l.ActivityId,response:$o(JSON.stringify(e)),isMobile:l.isMobile,devicePlatform:JSON.stringify(null==t?void 0:t.platform),isSapphire:i},d=`Error while fetching Sports Hub data from Super App Bridge. Api debug info: ${JSON.stringify(c)}, exception: ${a&&$o(a.message)}`;r&&_.M0.sendAppErrorEvent({...O.KWu,message:"Error while fetching Sports Hub data from Super App Bridge",pb:{...O.KWu.pb,fetchBridgeResponse:{...c},customMessage:d}}),null==s||s.addTrace(d)}function To(e,t,i,n,o,r,s){var a,l;const c=(0,E.Yq)(),d={requestUrl:Io(o),httpMethod:n,statusCode:null==e?void 0:e.status,statusText:null==e?void 0:e.statusText,dddDebugId:(null==e||null===(a=e.headers)||void 0===a?void 0:a.get(Ae.rD.debugId))||"",dddActivityId:(null==e||null===(l=e.headers)||void 0===l?void 0:l.get(Ae.rD.traceId))||"",activityId:c.ActivityId,response:$o(JSON.stringify(e)),responseJson:$o(JSON.stringify(null==e?void 0:e.json())),isMobile:c.isMobile,devicePlatform:JSON.stringify(null==t?void 0:t.platform),isSapphire:i},p=`Error while invoking Sports services. Api debug info: ${JSON.stringify(d)}.`;r&&_.M0.sendAppErrorEvent({...O.I4h,message:"Error while invoking Sports services. No valid response received.",pb:{...O.I4h.pb,fetchNetworkResponse:{...d},customMessage:p}}),null==s||s.addTrace(p)}async function ko(){return!!ie.Al.UserIsSignedIn||await(0,pe.XJ)()===ee.Hy.SignedIn}function Io(e){if(!e)return"";return $o(e.split("?")[0]||"")}const Po=[/[\w\d!#$%&'*+/=?^_`.:{|}~"-]+@[a-zA-Z0-9.:-]+\w{2,4}/g,/Bearer ([\w-]*\.[\w-]*\.[\w-]*)/g];function $o(e){try{if((0,mo.TF)(e))return e;for(let t=0;t<Po.length;t++)if(e.search(Po[t])>=0)return"Redacted due to found privacy data"}catch(e){return`Error scrubbing custom message: ${e&&e.toString()}`}return e}async function Fo(e,t,i){const n=yo(e,t.baseUrl,!1!==t.reportErrors);if(!n)return null==i||i.addTrace(`Could not create the service URL for ${e} and options ${JSON.stringify(t)})}`),null;await bo(n,t),null==i||i.addTrace(`Invoking the service with URL: ${n} `);const o=await So(no.get,n,!1!==t.reportErrors,void 0,!1,!0,i);return Ri.k.log(`SportsLog fetchSportsData - ${n.pathname} \n ${JSON.stringify(o)}`),o}const Lo=new Map,Eo=new Map,Ro=" --- ";function Ao(e,t,i,n,o){const r=Oo(e,t,i,n,void 0,o);return!!r&&(No(r),!0)}function Oo(e,t,i,n,o,r){if(r){const e=Lo.get(r);if(e&&e.stopLogging)return!1}const s=function(e,t,i,n,o,r){const s=r&&Lo.get(r);if(s){const a=s.intercept(e,t,i,n,o);if(!1===a)return!1;if(void 0!==a)return a.customMessage=Uo(a.customMessage,{instanceId:r,interceptorId:a.interceptorId}),{appError:a.appError,message:a.message,customMessage:a.customMessage,extraPbData:a.extraPbData,error:a.error}}return{appError:e,message:t,customMessage:i,extraPbData:n,error:o}}(e,t,i,n,o,r);if(!s)return!1;const a=function(e,t,i,n,o,r){const s=r&&Lo.get(r);if(s){const a=s.aggregate(e,t,i,n,o);return a?!0===a||(i=Uo(void 0,void 0,void 0,{instanceId:r,aggregatedId:a.aggregatorId,customMessages:a.customMessages}),{...a,customMessage:i}):{appError:e,message:t,customMessage:i,extraPbData:n,error:o}}return{appError:e,message:t,customMessage:i,extraPbData:n,error:o}}(e=s.appError,t=s.message,i=s.customMessage,n=s.extraPbData,o=s.error,r);if(!0===a)return!1;const l=Mo(e=a.appError,t=a.message,i=a.customMessage,n=a.extraPbData,o=a.error);return{appError:l.appError,message:l.message,customMessage:l.customMessage,extraPbData:l.extraPbData,error:l.error}}function Mo(e,t,i,n,o){return Eo.forEach((r=>{if(null==r||!r.addErrorInfo)return;if(r.applicableErrors&&!r.applicableErrors.has(e))return;let s;try{s=r.addErrorInfo(e,t,i,n,o)}catch(e){return}s&&(i=Uo(i,void 0,{providerId:r.id,extraInfo:s}))})),{appError:e,message:t,customMessage:i,extraPbData:n,error:o}}function Uo(e,t,i,n){if(t&&(e=`${e=Do(e)}Intercepted by instance id=${t.instanceId}, interceptor id=${t.interceptorId}`),i){e=`${e=Do(e)}Extra info by provider id=${i.providerId}: `;for(const t in i.extraInfo)e=`${e}${t}:${i.extraInfo[t]}, `;e=e.slice(0,e.length-2)}if(n){e=`${e=Do(e)}Aggregated by instance id=${n.instanceId}, aggregator id=${n.aggregatedId}: `;let t=1;n.customMessages.forEach((i=>{e=`${e}${t}:${i}, `,t++})),e=e.slice(0,e.length-2)}return e}function Do(e){return e?`${e}${Ro}`:""}function No(e){e.error?(0,A.OO)(e.error,e.appError,e.message,e.customMessage,e.extraPbData):(0,A.H)(e.appError,e.message,e.customMessage,e.extraPbData)}var Ho=i(83794);class _o{constructor(e){0===e.length&&Ri.k.log("Sports entities for personalization strip are empty."),this.sportsEntities=e}}const jo={width:16,height:16,enableDpiScaling:!0,devicePixelRatio:2,format:Ho.D3.PNG},Bo={width:20,height:20,enableDpiScaling:!0,devicePixelRatio:2,format:Ho.D3.PNG},zo={width:80,height:80,enableDpiScaling:!0,devicePixelRatio:2,format:Ho.D3.PNG};var qo;!function(e){e.SportsPersonalizationStrip="sportsPersonalizationStrip",e.FollowEntity="sports_follow_entity",e.UnfollowEntity="sports_unfollow_entity",e.NavigateEntity="sports_navigate_entity",e.CarouselPrevious="previousslidearrow",e.CarouselNext="nextslidearrow",e.Vertical="sports",e.SportsItem="sportsitem",e.SportsSearchBox="sportssearchbox",e.SportsSearchInput="sportssearchinput"}(qo||(qo={}));const Go=Object.freeze({unknown:"Unknown",football:"Football",baseball:"Baseball",basketball:"Basketball",basketball3x3:"Basketball3x3",bowling:"Bowling",cricket:"Cricket",icehockey:"IceHockey",fieldhockey:"FieldHockey",racing:"Racing",tennis:"Tennis",soccer:"Soccer",golf:"Golf",australianrules:"AustralianRules",rugbyunion:"RugbyUnion",rugbyleague:"RugbyLeague",archery:"Archery",athletics:"Athletics",badminton:"Badminton",cycling:"Cycling",boxing:"Boxing",canoeing:"Canoeing",climbing:"Climbing",equestrianism:"Equestrianism",fencing:"Fencing",gymnasticsartistic:"GymnasticsArtistic",gymnasticsrhytmic:"GymnasticsRhytmic",gymnasticstrampoline:"GymnasticsTrampoline",handball:"Handball",judo:"Judo",karate:"Karate",summerolympics:"SummerOlympics",paralympics:"Paralympics",pentathlon:"Pentathlon",swimmingartistic:"SwimmingArtistic",swimming:"Swimming",diving:"Diving",waterpolo:"WaterPolo",rowing:"Rowing",sailing:"Sailing",shooting:"Shooting",skateboarding:"Skateboarding",surfing:"Surfing",taekwondo:"Taekwondo",triathlon:"Triathlon",tabletennis:"TableTennis",volleyballteam:"VolleyballTeam",volleyballbeach:"VolleyballBeach",weightlifting:"Weightlifting",wrestling:"Wrestling",softball:"Softball",trackandfield:"TrackAndField",mma:"MMA",netball:"Netball",boccia:"Boccia",biathlon:"Biathlon",bobsledding:"Bobsledding",curling:"Curling",luge:"Luge",skating:"Skating",skiing:"Skiing"});new Set(["Soccer_InternationalIntFriendlyGames","Soccer_BelgiumSuperCup","Baseball_ChineseTaipeiCpbl","Soccer_InternationalClubsUefaEuropaConferenceLeague","Soccer_FranceCoupeDeFrance","Soccer_Turkey1Lig","Soccer_BelgiumSuperCup","Soccer_VietnamVLeague","Soccer_BrazilBrasileiroSerieC","Football_CanadaCfl","Soccer_BoliviaDivisionProfesional","Football_USAUSFL"]);const Wo=Object.freeze({sport:"sport",league:"league",team:"team",player:"player",flag:"flag"});Object.freeze({[Go.baseball]:"OSB.26BE_Baseball.png",[Go.football]:"OSB.1F3C8_AmericanFootball.png",[Go.volleyballbeach]:"OSB.1F3D0_Volleyball.png",[Go.volleyballteam]:"OSB.1F3D0_Volleyball.png",[Go.tennis]:"OSB.1F3BE_Tennis.png",[Go.tabletennis]:"OSB.1F3DG_TableTennis.png",[Go.soccer]:"OSB.1F3D1_Soccer.png",[Go.rugbyleague]:"OSB.1F3C9_RugbyFootball.png",[Go.rugbyunion]:"OSB.1F3C9_RugbyFootball.png",[Go.golf]:"OSB.26F3_Golf.png",[Go.cricket]:"OSB.1F3CF_CricketGame.png",[Go.boxing]:"OSB.1F94A_Boxing.png",[Go.bowling]:"OSB.1F3B3_Bowling.png",[Go.basketball]:"OSB.1F3C0_Basketball.png",[Go.badminton]:"OSB.1F3F8_Badminton.png",[Go.icehockey]:"OSB.1F3D2_IceHockey.png"});i(19628);const Vo=`${(0,E.Yq)().StaticsUrl}/latest/sports/img/flags/generic.svg`;Ho.D3.PNG;function Ko(e,t,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=e;if((0,mo.TF)(o)){if(!n)return"";switch(i){case Wo.player:o="OSC.LBUDD745586EC750353FBC1F3971212F2F92540502D2A29306D4081FAD3D5858B79B";break;case Wo.team:o="OSB.team_logo_placeholder.png";break;case Wo.flag:o=Vo;break;default:o="BB1dV8FG"}}return t.crop||(t.crop=0),t.padding||0===t.padding||(t.padding=1),o.indexOf(".")>0&&!o.startsWith("http")?(0,Ho.mL)(`${Ho.q3}?id=${o}&pid=MSports`,t):Qo(o,t)}function Qo(e,t){return e.startsWith("http")?(0,Ho.mL)(e,t):(0,Ho.zz)(e,t)}function Jo(e){e||(e="sports/"),e.startsWith("/")||(e=`/${e}`);let t=`${E.jG.NavTargetUrlWithLocale}${e}`;if(t=(0,R.w_)(t),function(e){const t=new te.h(e||(0,le.zp)());return"1"===t.get("vptest")||"vp"===t.get("reqsrc")}())return t;const i=new URLSearchParams((0,le.zp)()).getAll("item");if(null!=i&&i.length){const e=new URL(t);return i.forEach((t=>{t&&e.searchParams.append("item",t)})),e.href}return t}class Zo{setLoggerInstanceId(e){this.loggerInstanceId=e}static getTransformErrors(){return new Set([O.Nh3,O.bIr,O.HKi])}transformPersonalizationResponse(e,t,i){var n;if(!e)return Ao(O.HKi,"Provided 1s response for Sports Personalization Data Mapper to is null or undefined.",void 0,void 0,this.loggerInstanceId),null;const o=e.value&&e.value[0].items;if(!o)return Ao(O.Nh3,"Sports Personalization Data Mapper recieved unexpected schema in response",`data=${JSON.stringify(e)}`,void 0,this.loggerInstanceId),null;const r=null===(n=this.transformSportsEntities(o,i))||void 0===n?void 0:n.sort(((e,i)=>{var n,o;return null!=t&&null!==(n=t.UserBehavior)&&void 0!==n&&n.isSportsEntityFollowed(e.id,e.yId)?-1:null!=t&&null!==(o=t.UserBehavior)&&void 0!==o&&o.isSportsEntityFollowed(i.id,i.yId)?1:0}));if(!r||r.length<1)return null;return new _o(r)}transformRecommendationResponse(e,t){if(!e)return Ao(O.HKi,"Provided 1s response for Sports Personalization Data Mapper to is null or undefined.",void 0,void 0,this.loggerInstanceId),null;const i=e.value&&e.value[0].items;if(!i)return Ao(O.Nh3,"Sports Personalization Data Mapper recieved unexpected schema in response",`data=${JSON.stringify(e)}`,void 0,this.loggerInstanceId),null;const n=this.transformSportsEntities(i,t,!0);if(!n||n.length<1)return null;return new _o(n)}transformSportsEntities(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=[];return e.forEach((e=>{var o,r,s,a,l;const c=null===(o=e.itemType)||void 0===o?void 0:o.toLowerCase(),d=c&&e[c],p=d&&(null===(r=d.secondaryIds)||void 0===r?void 0:r.find((e=>"SatoriId"===e.idType))),u=d&&(null===(s=d.secondaryIds)||void 0===s?void 0:s.find((e=>"InterestId"===e.idType)));let h=d.sport;var g;"unknown"!==d.sport&&d.sport||null===(a=d.sportWithLeague)||void 0===a||!a.length||(h=null===(g=d.sportWithLeague)||void 0===g?void 0:g.split("_")[0]);if(d&&null!==(l=d.name)&&void 0!==l&&l.rawName&&p){var f;const o=d.navUrls?d.navUrls.scores||Object.values(d.navUrls)[0]:"";n.push({id:p.id,yId:(null==u?void 0:u.id)||"",name:d.name.rawName,displayName:d.name.localizedName||d.name.rawName,sportwithLeagueName:d.sportWithLeague,sportName:this.getSportName(h,t,!0),type:e.itemType,imageUrl:(null===(f=d.image)||void 0===f?void 0:f.id)&&Ko(d.image.id,i?zo:jo),entityClickThroughUrl:Jo(o)})}else Ao(O.bIr,"Sports Personalization Entity is missing essential data",`data=${JSON.stringify(e)}`,void 0,this.loggerInstanceId)})),n}mapSearchSuggestions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[];return e&&e.forEach((e=>{if(e&&e.yId){var i;let n=e.requery;n=n&&(n.startsWith("/")?null===(i=n)||void 0===i?void 0:i.slice(1):n);let o=Ko(e.thumbnailId||"",Bo);o=o&&o.startsWith("//")?`https:${o}`:o;const r=null==e?void 0:e.satoriId,s=e.yId;t.push({id:r,yId:s,name:e.displayText,sportName:this.getSportName(e.sportType),type:e.dataType,displayName:e.displayText,entityClickThroughUrl:n?Jo(n):"",imageUrl:o})}else Ao(O.bIr,"Sports Personalization Entity is missing essential data",`data=${JSON.stringify(e)}`,void 0,this.loggerInstanceId)})),t}getSportName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;const n=null==e?void 0:e.toLowerCase();if(!n||null!=n&&n.includes("unknown"))return"";if(t&&i){const i=Object.keys(t).find((e=>e.toLowerCase()===n));return i?t[i]:e.slice(0,1).toUpperCase()+e.slice(1)}return e}}let Xo;Zo.getMsnLinkHost=e=>"zh-cn"===e?"www.msn.cn":"www.msn.com";class Yo{constructor(){this.createPersonalizationTelemetry=(e,t)=>{if(!e||!t||!t.sportsEntities)return Ao(O.hig,"Passed inputs to map Sports Personalization telemetry are invalid.",`data=${JSON.stringify(t)}`,void 0,this.loggerInstanceId),null;const i=new Map,n=new Map,o=new Map;let r=null,s=null,a=null,l=null,c=null;const d=this.getTelemetryObject(qo.CarouselNext,e,{headline:qo.CarouselNext});d&&(r=d.getMetadataTag());const p=this.getTelemetryObject(qo.CarouselPrevious,e,{headline:qo.CarouselPrevious});p&&(s=p.getMetadataTag());const u=this.getTelemetryObject(qo.SportsPersonalizationStrip,e,{});u&&(a=u.getMetadataTag());const h=this.getTelemetryObject(qo.SportsSearchBox,e,{category:Xo.Sport,subcategory:Xo.League});h&&(l=h.getMetadataTag());const g=this.getTelemetryObject(qo.SportsSearchInput,e,{category:Xo.Sport,subcategory:Xo.League});g&&(c=g.getMetadataTag());const f={componentRoot:e,entities:i,followEntities:n,unfollowEntities:o,carouselNext:r,carouselPrevious:s,sportsPersonalizationModule:a,sportsSearchModule:l,sportsSearchInput:c};for(const n of t.sportsEntities.values())if(i&&!this.updatePersonalizationTelemetry(e,n,f))return null;return f},this.updatePersonalizationTelemetry=(e,t,i)=>{var n;if(!e||!t||null==i||!i.entities)return Ao(O.hig,"Passed inputs to map Sports Personalization telemetry are invalid.",JSON.stringify(t),void 0,this.loggerInstanceId),!1;if(i.entities.has(t.id))return!0;const o=this.getTelemetryObject(qo.NavigateEntity,e,{category:t.sportName,subcategory:t.sportwithLeagueName,headline:t.name,teamId:t.id,isFollowed:null==Xo||null===(n=Xo.UserBehavior)||void 0===n?void 0:n.isSportsEntityFollowed(t.id,t.yId),destinationUrl:t.entityClickThroughUrl});o&&i.entities.set(t.id,o.getMetadataTag());const r=this.getTelemetryObject(qo.FollowEntity,e,{category:t.sportName,subcategory:t.sportwithLeagueName,headline:t.name,teamId:t.id,isFollowed:!1});r&&i.followEntities.set(t.id,r.getMetadataTag());const s=this.getTelemetryObject(qo.UnfollowEntity,e,{category:t.sportName,subcategory:t.sportwithLeagueName,headline:t.name,teamId:t.id,isFollowed:!0});return s&&i.unfollowEntities.set(t.id,s.getMetadataTag()),!0}}setLoggerInstanceId(e){this.loggerInstanceId=e}getTelemetryObject(e,t,i){if(!t)return Ao(O.hig,"parentTelemetryObject input to get telemetry objects for sports personalization is invalid.",void 0,void 0,this.loggerInstanceId),null;if((e===qo.NavigateEntity||e===qo.FollowEntity||e===qo.UnfollowEntity)&&!i)return Ao(O.hig,"AdditionalParams inputs to get telemetry objects for sports personalization is invalid.",e,void 0,this.loggerInstanceId),null;const n=t.addOrUpdateChild({name:qo.SportsPersonalizationStrip,type:It.c9.Module}),o=null==t?void 0:t.contract,r=null==o?void 0:o.ext;switch(e){case qo.NavigateEntity:return n.addOrUpdateChild({name:qo.SportsItem,behavior:It.wu.Navigate,destinationUrl:i.destinationUrl,content:{vertical:qo.Vertical,category:i.category,subcategory:i.subcategory,headline:i.headline,type:It.uH.StructuredData,id:i.teamId},ext:r},i.savedChildObject);case qo.FollowEntity:return n.addOrUpdateChild({name:qo.SportsItem,behavior:It.wu.Follow,content:{vertical:qo.Vertical,category:i.category,subcategory:i.subcategory,headline:i.headline,type:It.uH.StructuredData,id:i.teamId},ext:r},i.savedChildObject);case qo.UnfollowEntity:return n.addOrUpdateChild({name:qo.SportsItem,behavior:It.wu.Unfollow,content:{vertical:qo.Vertical,category:i.category,subcategory:i.subcategory,headline:i.headline,type:It.uH.StructuredData,id:i.teamId},ext:r},i.savedChildObject);case qo.CarouselNext:return n.addOrUpdateChild({name:qo.CarouselNext,behavior:It.wu.Paginate,content:{vertical:qo.Vertical,headline:i.headline,type:It.uH.StructuredData},ext:r},i.savedChildObject);case qo.CarouselPrevious:return n.addOrUpdateChild({name:qo.CarouselPrevious,behavior:It.wu.Paginate,content:{vertical:qo.Vertical,headline:i.headline,type:It.uH.StructuredData},ext:r},i.savedChildObject);case qo.SportsPersonalizationStrip:return n.addOrUpdateChild({name:qo.SportsPersonalizationStrip,type:It.c9.Module},i.savedChildObject);case qo.SportsSearchBox:return n.addOrUpdateChild({name:qo.SportsSearchBox,content:{category:i.category,subcategory:i.subcategory},type:It.c9.Module},i.savedChildObject);case qo.SportsSearchInput:return n.addOrUpdateChild({name:qo.SportsSearchInput,behavior:It.wu.TextSearch,content:{category:i.category,subcategory:i.subcategory},type:It.c9.InputBox},i.savedChildObject)}}}var er=i(78058);function tr(e){return{baseUrl:e.apiBaseUrl||"https://api.msn.com",apiKey:e.apiKey,version:e.apiVersion||"1.0",ocid:e.apiOcid}}class ir{constructor(e){var t,i,n,o;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.data=new _o([]),this.personalizationDataMapper=new Zo,this.sportsPersonalizationTelemetryMapper=new Yo,this.getSportsRecommendations=async e=>{var t;return await this.fetchSportsRecommendations(e)?null===(t=this.data)||void 0===t?void 0:t.sportsEntities:[]},this.fetchSearchSuggestions=async e=>{const t=(0,E.Yq)().CurrentMarket||"en-us",i=[];i.push({key:"query",value:e}),i.push({key:"count",value:this.config.suggestionCount||8}),i.push({key:"market",value:t});const n={...this.apiOptions,baseUrl:this.config.fetchSearchSuggestionBaseUrl,additionalParameters:i},o=await async function(e,t,i){const n=yo(e,t.baseUrl,!1!==t.reportErrors);return n?(await bo(n,t),await So(no.get,n,!0,void 0,!1,!1,i)):null}(this.config.fetchSearchSuggestionEndpoint,n);if(!o||!o.length)return Ao(O.QQY,"Fetching sports entity search returned null response.",`market=${t}, input:${e}, searchUrl:${n.baseUrl+this.config.fetchSearchSuggestionEndpoint}`,void 0,this.loggerInstanceId),[];const r=this.personalizationDataMapper.mapSearchSuggestions(o);return r.forEach((e=>{this.sportsPersonalizationTelemetryMapper.updatePersonalizationTelemetry(this.telemetryObject,e,this.telemetryContext)})),r},this.apiOptions={...tr({...e,apiEndpoint:e.personalizationStripEndpoint}),reportErrors:!0,includeUserId:!0,includeUserLoc:!0,includeFlights:!0},null!=Xo&&null!==(t=Xo.PageContext)&&void 0!==t&&null!==(i=t.PageConfig)&&void 0!==i&&i.apiKey&&(this.apiOptions.apiKey=Xo.PageContext.PageConfig.apiKey),null!=Xo&&null!==(n=Xo.PageContext)&&void 0!==n&&null!==(o=n.PageConfig)&&void 0!==o&&o.apiOcid&&(this.apiOptions.ocid=Xo.PageContext.PageConfig.apiOcid),this.config=e,this.localizedStrings=r}static getAllErrors(){return[...Zo.getTransformErrors(),O.hig,O.bIr,O.QQY]}setLoggerInstanceId(e){this.loggerInstanceId=e,this.personalizationDataMapper.setLoggerInstanceId(e),this.sportsPersonalizationTelemetryMapper.setLoggerInstanceId(e);!function(e){const t=Lo.get(e);for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t&&null!=n&&n.length&&t.addAggregators(...n)}(e,{id:"PersonalizationAggregator",applicableErrors:new Set(ir.getAllErrors())})}resetData(e){if(!e)return Ao(O.HKi,"Received JSON response to initialize the Personalization experience is null or undefined!",`jsonData:${JSON.stringify(e)}.`,void 0,this.loggerInstanceId),!1;const t=this.personalizationDataMapper.transformPersonalizationResponse(e,Xo,this.localizedStrings);if(!t)return Ao(O.bIr,"The data for Sports Personalization Strip could not be parsed and is returned as null or undefined.",`data:${JSON.stringify(e)}.`,void 0,this.loggerInstanceId),!1;const i=new er.D({name:qo.SportsPersonalizationStrip,type:It.c9.Module}),n=this.sportsPersonalizationTelemetryMapper.createPersonalizationTelemetry(i,t);return n?(this.data=t,this.telemetryObject=i,this.telemetryContext=n,!0):(Ao(O.hig,"sports Personalization Strip experience transformed data could not be mapped to its related telemetry.",`data:${t}.`,void 0,this.loggerInstanceId),!1)}resetRecommendationData(e){if(!e)return Ao(O.HKi,"Received JSON response to initialize the recommendation for Personalization experience is null or undefined!",`jsonData:${JSON.stringify(e)}.`,void 0,this.loggerInstanceId),!1;const t=this.personalizationDataMapper.transformRecommendationResponse(e,this.localizedStrings);return t?(this.data=t,!0):(Ao(O.bIr,"The data for Sports Personalization Strip could not be parsed and is returned as null or undefined.",`data:${JSON.stringify(e)}.`,void 0,this.loggerInstanceId),!1)}async followEntity(e){const t=null==Xo?void 0:Xo.UserBehavior;if(!t)return null;const i=await t.follow({...e,type:e.type}),n=this.data.sportsEntities.some((t=>t.yId===e.yId));i&&204!==i.status&&!n&&(this.data.sportsEntities.unshift(e),this.sportsPersonalizationTelemetryMapper.updatePersonalizationTelemetry(this.telemetryObject,e,this.telemetryContext))}async getTelemetryData(){return await this.fetchDataIfNeeded()&&this.telemetryObject&&this.telemetryContext?{sportsPersonalizationTelemetryObject:this.telemetryObject,sportsPersonalizationTelemetryContext:this.telemetryContext}:null}async getSportsEntities(){var e;return await this.fetchDataIfNeeded()?null===(e=this.data)||void 0===e?void 0:e.sportsEntities:null}async fetchSportsRecommendations(e){const t=[],i=[],n="SportsVertical",o=e?"League":"SportsVertical";t.push({key:"type",value:n}),i.push({key:"type",value:o}),e&&i.push({key:"id",value:e});const r={...this.apiOptions,additionalParameters:i},s=await Fo(this.config.personalizationStripEndpoint,r);let a=s&&this.resetRecommendationData(s);if(!a&&o!==n){const e={...this.apiOptions,defaultadditionalParameters:t},i=await Fo(this.config.personalizationStripEndpoint,e);a=s&&this.resetRecommendationData(i)}return a}async fetchDataIfNeeded(){if(!this.data||!this.telemetryObject||!this.telemetryContext){let e=[];const t=null==Xo?void 0:Xo.League,i=this.config.personalizeStripTypeOverride??(t?"League":"SportsVertical");e.push({key:"type",value:i}),t&&null!=Xo&&Xo.SportWithLeague&&"League"===i&&e.push({key:"id",value:Xo.SportWithLeague});const n={...this.apiOptions,additionalParameters:e},o=await Fo(this.config.personalizationStripEndpoint,n);let r=o&&this.resetData(o);if(!r&&"SportsVertical"!==i){e=[],e.push({key:"type",value:"SportsVertical"});const t={...this.apiOptions,additionalParameters:e},i=await Fo(this.config.personalizationStripEndpoint,t);r=i&&this.resetData(i)}return r}return!!(this.data&&this.telemetryObject&&this.telemetryContext)}}ir.cricketErrorsMap={[O.Nh3.id]:O.dhI,[O.bIr.id]:O.dhI,[O.HKi.id]:O.dhI,[O.hig.id]:O.$eE,[O.bV8.id]:O.dhI,[O.QQY.id]:O.W56,[O.S8$.id]:O.dhI,[O.rfm.id]:O.dhI};var nr=i(78125),or=i(52965),rr=i(98604),sr=i(26197),ar=i(22691),lr=i(65518),cr=i(22745),dr=i(42689),pr=i(28632),ur=i(26738),hr=i(29717),gr=i(80303),fr=i(22798),vr=i(80986);const mr="\nbody,body.js-focus-visible{overflow:hidden}",yr=S.i` .prong2-design msft-search-box{background:var(--dark-fill-color-control-default,rgba(255,255,255,0.06));border-bottom:1px solid rgba(255,255,255,0.08);--fill-color-accent-default:#60CDFF}.prong2-design msft-search-box::part(control){color:var(--dark-fill-color-text-secondary,rgba(255,255,255,0.79))}.prong2-design .container-background{background:var(--colors-high-contrast-aquatic-canvas,#202020)}.prong2-design .description,.prong2-design .header .description{color:var(--dark-fill-color-text-secondary,rgba(255,255,255,0.79))}.prong2-design .highlight{color:var(--dark-fill-color-accent-text-primary,#99EBFF)}.prong2-design .search-icon{color:var(--dark-fill-color-text-secondary,rgba(255,255,255,0.79))}.prong2-design .title{color:white}.prong2-design .vertical-button-group .vertical-button{border:1px solid var(--dark-stroke-color-control-stroke-default,rgba(255,255,255,0.07));background:var(--dark-fill-color-control-default,rgba(255,255,255,0.06));color:white}.prong2-design .vertical-button-group .vertical-button.selected{border:1px solid var(--dark-fill-color-accent-default,#60CDFF);background:var(--dark-fill-color-accent-default,#60CDFF);color:black}.prong2-design .left-nav-container{background:transparent}.prong2-design .following-tiles{background-color:rgb(69,69,69)}.prong2-design .follow-button{background-color:rgba(255,255,255,0.06)}`,br=S.i`
${yr}
.following-tiles {
background-color: rgb(77, 77, 77);
}
.topic-type {
font-size: 12px;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
display: -webkit-box;
color: #adadad;
}
.menu-item-divider {
border-top-color: #666666;
}
.follow-button {
border: 1px solid #666666;
margin-left: auto;
border-radius: 4px;
font-weight: 600;
font-size: 14px;
color: #ffffff;
background-color: #292929;
}
.selected-channel {
background: #235ccf;
}
.left-nav-container {
background: #2c2c2cf5;
}
.personalize-overlay {
background: url(<path-to-image>), lightgray 0% 0% / 100px 100px repeat,
linear-gradient(
0deg,
rgba(44, 44, 44, 0.15) 0%,
rgba(44, 44, 44, 0.15) 100%
),
rgba(44, 44, 44, 0.96);
background-blend-mode: normal, color, luminosity;
backdrop-filter: blur(30px);
}
.content-divider {
border: 1px solid #666666;
}
.personalize-overlay:hover .content-container::-webkit-scrollbar-thumb,
.personalize-overlay:hover .notifications::-webkit-scrollbar-thumb,
.personalize-overlay:hover .interest-content::-webkit-scrollbar-thumb {
border-radius: 9px;
background: #ffffff72;
}
.following-tiles::-webkit-scrollbar-thumb {
border-radius: 9px;
background: #ffffff72;
}
.topic-list .dot {
background: #8f8f8f;
}
.container-background {
background: #2c2c2cf5;
}
msft-stripe .fliper {
background: #292929;
fill: #fff;
}
.vertical-button-group .vertical-button {
background: transparent;
border: 1px solid #ffffff1f;
color: rgba(255, 255, 255, 0.7412);
}
.vertical-button-group .vertical-button.selected {
background: #2169eb;
}
`,wr=S.i` .prong2-design msn-fre-topic-card{width:176px}.prong2-design msft-stripe .title{font-size:14px}.prong2-design msft-search-box{background:var(--background-neutral-1-rest,rgba(255,255,255,0.70));border-bottom:1px solid rgba(0,0,0,0.06);height:30px;width:360px;--fill-color-accent-default:#005FB8}.prong2-design msft-search-box::part(control){color:var(--light-foreground-foreground-3,var(--colors-neutral-grey-38,#616161));padding:4px 0px 6px 11px;font-size:14px;line-height:20px}.prong2-design .footer{margin-block:0 32px}.prong2-design .search-box{height:32px}.prong2-design .search-icon{color:var(--light-fill-color-text-secondary,rgba(0,0,0,0.61));display:flex}.prong2-design .selected .display{font-weight:normal}.prong2-design .container-background{background:var(--light-background-fill-color-solid-background-base,#F3F3F3)}.prong2-design .content-container .header{margin-bottom:8px;width:100%}.prong2-design .description,.prong2-design .header .description{color:var(--light-fill-color-text-secondary,rgba(0,0,0,0.61));font-size:14px;line-height:20px}.prong2-design .highlight{color:var(--light-fill-color-accent-text-primary,#003E92)}.prong2-design .vertical-button-group .vertical-button{border:1px solid var(--light-stroke-color-control-stroke-default,rgba(0,0,0,0.06));background:var(--background-neutral-1-rest,rgba(255,255,255,0.70));font-size:14px;line-height:20px;padding:4px 11px 6px}.prong2-design .vertical-button-group .vertical-button.selected{border:1px solid var(--light-fill-color-accent-default,#005FB8);background:var(--light-fill-color-accent-default,#005FB8)}.prong2-design msn-account-settings{margin-inline:32px;display:block}`,Sr=S.i`
${wr} .header .title{color:${dr.C};font-weight:600;font-size:20px;line-height:28px;margin-bottom:8px}.header .description{font-weight:400;font-size:16px;line-height:22px;color:${pr.ak} margin-top:8px}.description .highlight{cursor:pointer}.highlight{color:${ur.D9}}.highlight::before{content:" ";color:rgba(15,108,189,1)}.interest-content{flex:1;overflow-y:auto}.content-container::-webkit-scrollbar,.notifications::-webkit-scrollbar,.interest-content::-webkit-scrollbar{width:5px}.content-container::-webkit-scrollbar-track,.notifications::-webkit-scrollbar-track,.interest-content::-webkit-scrollbar-track{background:transparent;margin-bottom:24px;width:4px}.content-container::-webkit-scrollbar-thumb,.notifications::-webkit-scrollbar-thumb,.interest-content::-webkit-scrollbar-thumb{border-radius:9px;background:transparent}.personalize-overlay:hover .content-container::-webkit-scrollbar-thumb,.personalize-overlay:hover .notifications::-webkit-scrollbar-thumb,.personalize-overlay:hover .interest-content::-webkit-scrollbar-thumb{border-radius:9px;background:#00000072}.footer{text-align:center;margin:24px 0}.empty-search-text{margin-top:8px}fluent-tree-item .display{font-size:14px;font-weight:normal}msft-search-box{width:calc(100% - 32px)}msft-search-box::part(root){width:100%}msft-search-box,.header{width:calc(100% - 80px)}msft-stripe{--fill-color:transparent;--scroll-align:flex-start}msft-stripe .title{font-size:16px;font-weight:600;line-height:20px}msft-stripe .fliper{display:flex;align-items:center;justify-content:center;background-color:white;width:24px;height:48px;border-radius:4px;cursor:pointer;box-shadow:0px 0px 2px 0px rgba(0,0,0,0.12),0px 2px 4px 0px rgba(0,0,0,0.14)}msft-stripe .fliper svg{width:20px;height:20px}msft-stripe .left-fliper{position:absolute;left:-200px;top:calc(50% - 48px/2 - 1.5px);transform:rotate(180deg)}msft-stripe:hover .left-fliper{left:4px}msft-stripe .right-fliper{position:absolute;right:-200px;top:calc(50% - 48px/2 - 1.5px)}msft-stripe:hover .right-fliper{right:4px}.interest-table{display:inline-flex;flex-direction:row}.table-column{display:inline-flex;flex-direction:column;gap:8px;margin-right:4px;padding:2px}.topic-list{position:relative;margin-top:0px;margin-bottom:16px;margin-inline-end:10px}.topic-list .navigation{--dot-size:4px;display:grid;margin-top:12px;align-content:center;gap:calc(var(--stroke-width) * 1px);z-index:calc(var(--sloppy-click-z-index,2) + 1)}.topic-list .tablist{height:14px;font-size:0px;text-align:center;width:auto}.topic-list .tab-no-click{cursor:default}.topic-list .tab{cursor:pointer;display:inline-block;height:14px;position:relative;transition:width 0.3s ease-in-out 0s;width:12px}.topic-list .tab[aria-selected="true"] .dot{width:6px;height:6px}.topic-list .dot{background:var(--sd-card-pagination-dot-color,rgb(0 0 0 / 0.45));border-radius:3px;display:inline-block;height:var(--dot-size);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:width 0.3s ease-in-out 0s,height 0.3s ease-in-out 0s;width:var(--dot-size)}.animation-fade{animation-name:fade;animation-duration:.8s;animation-timing-function:linear}@keyframes fade{0%{opacity:0}100%{opacity:1}}.vertical-topic{width:auto}.vertical-publisher{width:110px}msn-fre-topic-card{width:188px}msft-stripe::part(scroll-view){-webkit-mask-image:linear-gradient(90deg,#FFF 0%,#FFF 4.69%,#FFF 95.31%,rgba(255,255,255,0.00) 100%)}msft-stripe.mid-page::part(scroll-view){-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0.00) 0%,#FFF 4.69%,#FFF 95.31%,rgba(255,255,255,0.00) 100%);padding-left:30px}msft-stripe.last-page::part(scroll-view){-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0.00) 0%,#FFF 4.69%,#FFF 95.31%,#FFF 100%)}.search-box{margin-bottom:16px}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}`.withBehaviors((0,hr.vF)(S.i` .selected .display{color:${fr.H.CanvasText}}.highlight{color:${fr.H.Highlight}}.topic-list .dot{background:${fr.H.Highlight};
}
`)),Cr=S.i` .prong2-design .following,.prong2-design .blocked{padding-bottom:32px;max-height:503px}.prong2-design .following-tiles{margin-bottom:0px;max-width:588px;width:588px}.prong2-design .following-title{display:none}`,xr=S.i`
${Cr} .discover-link{background:transparent;font-weight:400;font-size:14px;color:rgba(15,108,189,1);border-width:0px}.discover-link:hover{text-decoration:underline;cursor:pointer}.follow-button{border:1px solid ${pr.ak};opacity:0.8;background:transparent;opacity:1;margin-left:auto;border-radius:4px;font-weight:600;font-size:14px}.selected-channel{background:#2169eb;color:#ffffff}.following-empty{font-weight:400;font-size:14px}.following-empty-container{display:flex}.following-tiles{background-color:white;border-radius:10px;overflow-y:auto;overflow-x:hidden;margin-bottom:20px;max-width:580px;.topic img{background:white}}.following-title{font-weight:600;font-size:20px;margin-bottom:16px}.menu-item-divider{border-top-color:#f0f0f0;margin-bottom:0px;margin-left:16px;margin-top:0px;width:546px}.topic{height:56px;width:auto;max-width:100%;box-sizing:border-box;display:flex;align-items:center;flex-direction:row;padding-right:20px;padding-left:12px;padding-top:8px;padding-bottom:8px}.topic-name-container{display:flex;flex-direction:column}.topic-type{font-size:12px;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;display:-webkit-box;color:#707070}`,Tr=S.i` .prong2-design .personalize-overlay{width:652px;height:652px;display:block}.prong2-design .left-nav-header{font-size:20px;line-height:28px;margin-top:32px;margin-inline-start:32px}.prong2-design .left-nav-tree{align-items:center;display:flex;flex-direction:row;height:40px;margin-top:16px}.prong2-design .left-nav-tree-item::after{top:29px;height:3px;width:16px;left:calc(50% - 8px)}.prong2-design .left-nav-tree-item::part(content-region){margin-inline:12px}.prong2-design .left-nav-container{width:100%}.prong2-design .content-container{width:100%;max-width:calc(100% - 64px);padding:8px 32px 0px 32px}.prong2-design .experience-link{display:none}.prong2-design .interest-content{width:608px;max-height:452px}.prong2-design .has-account-settings .interest-content{max-height:350px}`,kr=S.i`
${Tr} .background{width:100%;height:100%;position:fixed;background:rgba(0,0,0,0.5);top:0;left:0;z-index:${vr.K.Dialog.toString()};display:flex;justify-content:center;align-items:center}.close-button{background:transparent;position:absolute;top:4px;right:7px}.close-button svg{width:20px;height:20px}.short-overlay .content-container{overflow-y:scroll}.short-overlay .interest-content{overflow-y:unset}.content-container{width:656px;padding:24px 16px 0px 21px;display:flex;flex-direction:column;max-width:calc(100% - 250px)}.content-container .header{margin-bottom:16px}.experience-link{margin-inline-start:14px;bottom:14px;position:absolute;background:transparent;color:${ur.D9};padding-bottom:8px;padding-left:11px;font-size:14px;cursor:pointer}.experience-link div{margin-inline-start:4px}.experience-link svg{width:20px;height:20px;padding-left:4px;position:absolute;font-size:14px;bottom:7px;fill:${ur.D9}}.left-nav-tree-item svg{width:20px;height:20px}.selected svg{fill:${ur.go}}.selected .display{font-weight:bolder}.left-nav-tree-item::after{top:8px}.left-nav-header{font-weight:600;font-size:24px;line-height:32px;color:rgb(36,36,36);margin-inline-start:24px;margin-top:24px;letter-spacing:0em;text-align:left;color:${dr.C}}.left-nav-container{width:218px;min-width:218px}.left-nav-tree{margin-inline-start:24px;margin-top:21px}.left-nav-tree-item,.left-nav-tree-item::part(positioning-region),.left-nav-tree-item::part(positioning-region):hover{background:transparent;height:32px}.leftnav-1c{display:none}.content-divider{border:1px solid #0000001f;height:100%;margin:0px}.personalize-overlay{position:fixed;height:716px;width:906px;border-radius:8px;z-index:${vr.K.Dialog.toString()};
display: flex;
flex-direction: row;
max-width: 90%;
max-height: 90%;
overflow: hidden;
background: var(
--light-background-fill-color-acrylic-background-default,
url(<path-to-image>),
lightgray 0% 0% / 100px 100px repeat,
linear-gradient(
0deg,
rgba(252, 252, 252, 0) 0%,
rgba(252, 252, 252, 0) 100%
),
rgba(252, 252, 252, 0.85)
);
background-blend-mode: normal, color, luminosity;
backdrop-filter: blur(30px);
}
.container-background {
background: rgba(252, 252, 252, 0.85);
z-index: -1;
width: 100%;
height: 100%;
position: absolute;
}
.right-container {
display: flex;
flex-direction: column;
height: 100%;
}
.navigation-button {
display: none;
}
@media (max-width: 644px) {
.left-nav-container {
display: none;
position: absolute;
background: rgba(252, 252, 252, 1);
height: 100%;
z-index: ${vr.K.Dialog.toString()}}.forced-view{display:block}.leftnav-1c{display:block;position:absolute}.content-container{max-width:calc(100% - 48px);margin-top:78px}.content-divider{width:100%;height:0px;position:absolute;margin-top:76px}.navigation-button{background:transparent;display:block;position:absolute;left:16px;top:24px}.navigation-button svg{width:20px;height:20px;margin:6px}.left-nav-header{margin-inline-start:52px;margin-bottom:19px}}`.withBehaviors((0,hr.vF)(S.i` :host .left-nav-tree-item::part(positioning-region):hover{color:${fr.H.HighlightText};
background-color: ${fr.H.Highlight};
}`)),Ir=S.i` .vertical-button-group{display:flex;gap:4px;margin-bottom:16px}.vertical-button-group .vertical-button{background:linear-gradient( 0deg,rgba(255,255,255,0.85),rgba(255,255,255,0.85) ),linear-gradient(0deg,rgba(0,0,0,0.1216),rgba(0,0,0,0.1216));border:1px solid rgba(0,0,0,0.1216);border-radius:99px;box-sizing:border-box;cursor:pointer;height:32px;font-size:12px;line-height:16px;padding:6px 12px 6px 12px}.vertical-button-group .vertical-button.selected{background:rgba(33,105,235,1);color:#ffffff}`,Pr=S.i` .background.detail-page{z-index:901}`,$r=S.i` .notifications{height:412px;max-height:412px;width:100%;padding-right:8px;margin-bottom:16px;overflow:auto}`,Fr=S.i`
${kr}
${Sr}
${xr}
${Ir}
${Pr}
${$r} .following-feed{display:flex;flex-direction:column;width:auto;max-height:100%}msn-topic-image{margin-right:11px}.topic-name{font-weight:600;font-size:14px;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;display:-webkit-box}`.withBehaviors(new gr.Y(null,br));class Lr extends tn.l{constructor(){var e;super(...arguments),e=this,this.launchChannelStore="launchChannelStore",this.resultCount=0,this.searchResultAriaText="",this.showOverlay=!1,this.forceTreeView=!1,this.inputOnFocus=!1,this.clearButtonOnFocus=!1,this.followActions=new Map,this.blockActions=new Map,this.noSearchResults=!1,this.showFooter=!0,this.showBtnGroup=!1,this.topics=[],this.publishers=[],this.showSportsSuggests=!1,this.noSuggestSportsResult=!0,this.sportsTable=[],this.topicLineLimit=4,this.publisherLineLimit=4,this.topicsTable=[],this.publishersTable=[],this.topic_list_class="first-page",this.publisher_list_class="first-page",this.topic_list_index_arr=[],this.publisher_list_index_arr=[],this.currentPublisherPage=0,this.currentTopicPage=0,this.currentVertical=Dt.Recommended,this.overlayClass="",this.enableFeedCustomization=!1,this.useDetailPageStyles=!1,this.searchInputValue="",this.openChannelStore=async e=>{var t;this.useDetailPageStyles=e&&e.detail&&e.detail.useDetailPageStyles;const i=e&&e.detail&&e.detail.openSportsChannelStore;this.focusObjectOnClose=e&&e.detail&&e.detail.focusObjectOnClose;const n=e&&e.detail&&e.detail.selectedNavId;this.showPublishersTop=this.showPublishersTop||this.softLandingActive||this.config.enablePublishersFirst,n&&(this.selectedNavId=n),(i||"sports"===E.jG.AppType)&&(this.showBtnGroup=!0,this.currentVertical=Dt.Sports,this.initialSportsServiceClient()),window.addEventListener("keydown",this.documentKeydownHandler),window.addEventListener("resize",this.onResize),on.gL.subscribe(on.Iq.IsDashboardVisible,this.dashboardVisibilityChangeHandler),on.gL.subscribe(on.Iq.IsDarkMode,this.themeChangeHandler),this.showOverlay=!0,_.M0.addOrUpdateTmplProperty("channel-store","1"),await this.loadAndSubscribeInterestsDataConnector(),this.initServiceClient(),this.getRecommendedTopics(),this.showMutedPublishers(),await(0,nn.y)(),null===(t=this.inputElement)||void 0===t||t.focus(),this.onResize(),this.applyGlobalStyles()},this.onCloseOverlayClick=()=>{this.inputElement&&(this.inputElement.value=""),this.showBtnGroup=!1,this.currentVertical=Dt.Recommended,window.removeEventListener("keydown",this.documentKeydownHandler),window.removeEventListener("resize",this.onResize),on.gL.unsubscribe(on.Iq.IsDashboardVisible,this.dashboardVisibilityChangeHandler),on.gL.unsubscribe(on.Iq.IsDarkMode,this.themeChangeHandler),this.showOverlay=!1,this.selectedNavId="discover",this.topicsTable=[],this.publishersTable=[],this.resetPageIndicator(),this.focusObjectOnClose&&this.focusObjectOnClose.focus(),this.softLandingActive&&(window.dispatchEvent(new CustomEvent("manageInterestsClosed")),this.softLandingActive=!1),this.styleElement&&this.styleElement.parentElement&&this.styleElement.parentElement===window.document.head&&window.document.head.removeChild(this.styleElement);0!=Array.from(this.followActions.values()).filter((e=>e)).length+Array.from(this.blockActions.values()).filter((e=>e)).length&&(this.followActions.clear(),this.blockActions.clear(),window.dispatchEvent(new CustomEvent("refreshOnChannelStore")),E.jG.isWindowsDashboard&&document.dispatchEvent(new CustomEvent("refreshFeed",{detail:{useBackgroundTask:!1,refreshType:Ji.Rx.Api}})),this.config.channelFilterEnabled||window.setTimeout((async()=>{Yi.h.renderToast({id:"channelstore-update-feed",toastType:en.p.Refresh,inputText:this.strings.updateFeedToastMessage??"",expirationInMs:3e3})}),3e3))},this.documentKeydownHandler=e=>{var t;if("Escape"!==e.key)switch(this.selectedNavId){case"discover":this.onKeydownDiscover(e);break;case"following":case"blocked":this.onKeydownFollowingAndBlocked(e)}else this.inputElement==(null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement)?this.resetSearch():(this.onCloseOverlayClick(),_.M0.sendActionEvent(this,It.Aw.KeyPress,It.wu.Close))},this.getToastShadowRoot=()=>{var e,t;const i=(0,rr.b_)(sr._.gridViewFeed);if(!i)return null;const n=null===(e=i.shadowRoot)||void 0===e||null===(t=e.querySelector)||void 0===t?void 0:t.call(e,"ms-toast");return n?n.shadowRoot:null},this.isToastFoundAndFocused=()=>{var e,t;const i=null===(e=this.getToastShadowRoot())||void 0===e||null===(t=e.querySelector)||void 0===t?void 0:t.call(e,ei);return!!i&&(i.focus(),!0)},this.onKeydownDiscover=e=>{if("Tab"===e.key)if(e.shiftKey&&this.shadowRoot){if(this.isToastFoundAndFocused())return void e.preventDefault();this.shadowRoot.activeElement&&"close-button"===this.shadowRoot.activeElement.id&&(e.preventDefault(),this.setFocus("footer-search-link"))}else this.shadowRoot&&this.shadowRoot.activeElement&&"footer-search-link"===this.shadowRoot.activeElement.id&&(e.preventDefault(),this.setFocus("close-button"))},this.onKeydownFollowingAndBlocked=e=>{if("Tab"===e.key)if(e.shiftKey&&this.shadowRoot){if(this.isToastFoundAndFocused())return void e.preventDefault();this.shadowRoot.activeElement&&"close-button"===this.shadowRoot.activeElement.id&&(e.preventDefault(),this.setFocus("last-following-blocked-btn","following-blocked-empty"))}else if(this.shadowRoot&&this.shadowRoot.activeElement)if("last-following-blocked-btn"===this.shadowRoot.activeElement.id)e.preventDefault(),this.setFocus("close-button");else if("following-blocked-empty"===this.shadowRoot.activeElement.id){if("following"===this.selectedNavId&&this.followedTopicsAndPublishers&&this.followedTopicsAndPublishers.length||"blocked"===this.selectedNavId&&this.mutedPublishers&&this.mutedPublishers.length)return;e.preventDefault(),this.setFocus("close-button")}else this.shadowRoot.activeElement.id===this.selectedNavId?(e.preventDefault(),"following"===this.shadowRoot.activeElement.id?this.setFocus("following-title"):this.setFocus("blocked-title")):"close-button"===this.shadowRoot.activeElement.id?(e.preventDefault(),this.setFocus("experience-link")):"experience-link"===this.shadowRoot.activeElement.id&&(e.preventDefault(),this.setFocus(this.selectedNavId))},this.onResize=()=>{this.overlayRef&&this.overlayRef.clientHeight&&(this.overlayRef.clientHeight<420?this.overlayClass="short-overlay":this.overlayClass="")},this.onBackgroundClick=e=>{const t=e&&e.composedPath();if(!t||!t.length)return;t.find((e=>e.className&&e.className.includes&&e.className.includes("personalize-overlay")))||(_.M0.sendActionEvent(this,It.Aw.Click,It.wu.Close),this.onCloseOverlayClick())},this.onNavButtonClick=(e,t)=>{this.forceTreeView=t},this.onVerticalButtonClick=e=>{this.resetPageIndicator(),this.currentVertical=e},this.followedTopics=[],this.followedPublishers=[],this.followedTopicsAndPublishers=[],this.mutedPublishers=[],this.noFollowedChannels=!1,this.noMutedPublishers=!1,this.selectedNavId="discover",this.navItems=ii,this.flattenedNavItems=this.navItems,this.onAppError=e=>_.M0.sendAppErrorEvent(e),this.fetchFollowedTopicsAndPublishers=async()=>{await this.fetchFollowedChannels(),this.followedTopicsAndPublishers=this.followedTopics.concat(this.followedPublishers),this.followedTopicsAndPublishers[0]?(this.followedTopicsAndPublishers[0].showDivider=!1,this.noFollowedChannels=!1):this.noFollowedChannels=!0},this.fetchFollowedChannels=async()=>{const e={feedName:"filteredChannels",fcl:!0},t=await(null==xt?void 0:xt.fetchChannelFilter("Channel Store",e)),i=(null==t?void 0:t.subCards)||[],n=[],o=[];i.forEach(((e,t)=>{const i=null==xt?void 0:xt.mapChannel(e,t);i.isTopic?n.push(this.mapTopic(i)):o.push(this.mapPublisher(i))})),this.followedTopics=n,this.followedPublishers=o},this.addIconParams=e=>{if(!e)return"";const t=new URL(e);return t&&(t.searchParams.append("w",24..toString()),t.searchParams.append("h",24..toString())),t.toString()},this.mapTopic=e=>{const t=null!=e&&e.imgSrc?new URL(e.imgSrc):"";return t&&(t.searchParams.append("w",24..toString()),t.searchParams.append("h",24..toString())),{name:null==e?void 0:e.title,id:null==e?void 0:e.id,icon:this.addIconParams(null==e?void 0:e.imgSrc),selected:!1,type:Ut.Topic,typeName:this.strings.topicCardDescription,followButtonProps:{onClick:this.followButtonOnClick,string:this.strings.followedButtonText,selectedString:this.strings.unfollowedButtonText,telemetryObject:Pt(this.telemetryObject,null==e?void 0:e.id,null==e?void 0:e.title,"unfollow")},showDivider:!0,isInferred:!1}},this.mapPublisher=e=>({name:null==e?void 0:e.title,id:null==e?void 0:e.id,icon:this.addIconParams(null==e?void 0:e.imgSrc),type:Ut.Publisher,typeName:this.strings.publisherCardDescription,followButtonProps:{onClick:this.followButtonOnClick,string:this.strings.followedButtonText,selectedString:this.strings.unfollowedButtonText,telemetryObject:Pt(this.telemetryObject,null==e?void 0:e.id,null==e?void 0:e.title,"following")},showDivider:!0}),this.waitAndFocus=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;const n=e.getToastShadowRoot();return n?new Promise(((e,o)=>{let r;const s=new MutationObserver((i=>{i.forEach((i=>{i.addedNodes.forEach((i=>{if(i instanceof Element){var n;const o=i,a=null===(n=o.querySelector)||void 0===n?void 0:n.call(o,t);a&&(clearTimeout(r),s.disconnect(),a.focus(),e(o))}}))}))}));s.observe(n,{childList:!0,subtree:!0}),r=window.setTimeout((()=>{s.disconnect(),o(new Error("Timeout: Element not found"))}),i)})):Promise.reject(new Error("Toast root not found"))},this.followButtonOnClick=async(e,t,i,n)=>{let o=!1;o=await this.followCallback(!e,t,i,n),o?(this.setFollowedSelectedState(e,t,n),Yi.h.renderToast({id:`${t}-channelstore-follow`,toastType:en.p.Unfollow,inputText:n,expirationInMs:3e3}),await this.waitAndFocus(ei),this.updateActionsMap(this.followActions,t),window.setTimeout((async()=>{this.clearSelectedState(t)}),3e3)):(this.failureInterestToast(t??"",e?"Unfollow":"Follow"),await this.waitAndFocus(ei))},this.followCallback=async(e,t,i,n)=>{let o=!1;if(i===Ut.Topic){if(t&&this.topicsDataConnector)try{if(e){var r;o=await(null===(r=this.topicsDataConnector)||void 0===r?void 0:r.followTopic(t))}else{var s;o=await(null===(s=this.topicsDataConnector)||void 0===s?void 0:s.unfollowTopic(t))}o&&window.dispatchEvent(new CustomEvent("trackTopicFollowStatus",{detail:{id:t,follow:e}}))}catch(e){this.onAppError(O.jns)}}else if(i===Ut.Publisher&&t&&this.publisherServiceClient)try{const i=await this.publisherServiceClient.updateSourceFollowState(t,e);o=i,i&&window.dispatchEvent(new CustomEvent("trackPublisherFollowStatus",{detail:{id:t,follow:e}}))}catch(e){this.onAppError(O.fNQ)}return o},this.fetchMutedPublishers=async()=>{this.publisherServiceClient||this.initServiceClient();try{var e;const t=await(null===(e=this.publisherServiceClient)||void 0===e?void 0:e.getUserMutedPublishers())??[];this.mutedPublishers=t.sort(((e,t)=>e.displayName.localeCompare(t.displayName,e.locale,{sensitivity:"base"}))).map((e=>{var t,i;return{name:e.displayName,id:e.id,icon:null===(t=e.logos[0])||void 0===t||null===(i=t.imageLink)||void 0===i?void 0:i.href,type:Ut.Publisher,typeName:this.strings.publisherCardDescription,followButtonProps:{onClick:this.blockedButtonOnClick,string:this.strings.blockedButtonText,telemetryObject:Pt(this.telemetryObject,null==e?void 0:e.id,null==e?void 0:e.name,"unmute")},showDivider:!0,isMuted:!0,cmsProviderId:e.profileId}}))}catch(e){this.onAppError({...O.yf9,message:"Failed fetching muted publishers."}),this.mutedPublishers=[]}},this.blockedButtonOnClick=async(e,t,i,n,o)=>{let r=!1;r=await this.blockedCallback("DELETE",t),r?(this.showMutedPublishers(),this.updateActionsMap(this.blockActions,t),o||(Yi.h.renderToast({id:`${t}-channelstore-unmute`,toastType:en.p.UnhideSource,inputText:n,expirationInMs:3e3}),await this.waitAndFocus(ei))):(this.failureInterestToast(t??"",e?"Block":"Unblock"),await this.waitAndFocus(ei))},this.blockedCallback=async(e,t)=>{let i=!1;if(t&&this.publisherServiceClient)try{await this.publisherServiceClient.publisherUserAction(t,vt.S.Mute,e),i=!0}catch(e){this.onAppError(O.sf4)}return i},this.onKeypress=e=>{if("Enter"!==e.key)return!0;this.searchInterests()},this.onChange=async()=>{var e;null===(e=this.inputElement)||void 0===e||e.value;this.searchInterests()},this.fetchSportSuggestions=async e=>{var t;this.noSuggestSportsResult=!1;const i=await(null===(t=this.sportsPersonalizationDataService)||void 0===t?void 0:t.fetchSearchSuggestions(e));if(this.searchInputValue!==e)return[];if(i&&i.length){const e=i.map((e=>({id:e.yId,selected:this.followedTopicIds.findIndex((t=>t==e.yId))>=0,title:e.name,images:[{url:e.imageUrl}]}))),t=3,n=Math.ceil(e.length/t);this.sportsTable=this.restructInterests(e,n<this.topicLineLimit?n:this.topicLineLimit,t),this.noSearchResults=!1}else this.noSuggestSportsResult=!0,this.sportsTable=[];return i&&i.length?i:[]},this.clearSelectedState=e=>{var t;const i=null===(t=this.followedTopicsAndPublishers)||void 0===t?void 0:t.find((t=>t.id==e));if(i){var n;if(i.selected)this.followedTopicsAndPublishers=null===(n=this.followedTopicsAndPublishers)||void 0===n?void 0:n.filter((t=>t.id!=e));this.followedTopicsAndPublishers&&this.followedTopicsAndPublishers[0]?(this.followedTopicsAndPublishers[0].showDivider=!1,this.noFollowedChannels=!1):this.noFollowedChannels=!0}},this.getUnfollowedInterests=e=>e.filter((e=>!e.selected)),this.topicsChanged=async()=>{this.topics&&this.topics.length>0&&(this.topics.forEach((e=>{e.selected=null!=this.followedTopics.find((t=>t.id==e.id))})),this.imageResize(this.topics,40),this.topicsTable=this.restructInterests(this.getUnfollowedInterests(this.topics),this.topicLineLimit),this.topicsTable=(0,or.Z)(this.topicsTable),this.topic_list_index_arr=new Array(Math.floor(this.topicsTable.length/2)).fill(0).map(((e,t)=>t)))},this.publishersChanged=async()=>{this.publishers&&this.publishers.length>0&&(this.publishers.forEach((e=>{e.selected=null!=this.followedPublishers.find((t=>t.name==e.title))})),this.markLocalPublisherTmpl(),this.imageResize(this.publishers,84),this.publishersTable=this.restructInterests(this.getUnfollowedInterests(this.publishers),this.publisherLineLimit),this.publishersTable=(0,or.Z)(this.publishersTable),this.publisher_list_index_arr=new Array(Math.floor(this.publishersTable.length/2)).fill(0).map(((e,t)=>t)))},this.onSelectedChange=async e=>{e.stopPropagation();const t=e.target.id;if(this.selectedNavId===t||"following"!==t&&"blocked"!==t||this.resetSearch(),!e.target||!this.flattenedNavItems.length)return;if(!(0,Nt.t)(e.target))return;if(!e.target.selected||!e.target.id)return;if(this.flattenedNavItems.find((e=>e.id===t))){switch(t){case"discover":await this.onDiscoverOpen();break;case"following":await this.fetchFollowedTopicsAndPublishers(),_.M0.addOrUpdateTmplProperty("channel-store-fol","1");break;case"blocked":this.showMutedPublishers()}this.selectedNavId=t}},this.onNavigationItemClick=(e,t)=>{if(e.stopPropagation(),e&&_.M0.sendActionEvent(e.currentTarget,It.Aw.Click,It.wu.Click),t&&t.id){const t=e.currentTarget.id;this.flattenedNavItems.find((e=>e.id===t))&&(this.selectedNavId=t,this.forceTreeView=!1)}},this.onNavigationTabClick=(e,t)=>{let i;if(e?(i=this.ref_publisher_list,this.currentPublisherPage=t):(i=this.ref_topic_list,this.currentTopicPage=t),i&&i.scrollContainer&&i.scrollStops){const e=i.scrollStops;i.scrollToPosition(e[2*t])}},this.onFlipperClick=(e,t,i)=>{let n;e&&_.M0.sendActionEvent(e.currentTarget,It.Aw.Click,It.wu.Click);let o=0,r=0;if(t?(n=this.ref_publisher_list,o=this.currentPublisherPage,r=this.publisher_list_index_arr.length-1):(n=this.ref_topic_list,o=this.currentTopicPage,r=this.topic_list_index_arr.length),n){const e=i?o+1:o-1;e>=0&&e<=r&&(t?this.currentPublisherPage=e:this.currentTopicPage=e)}},this.followSportsEntity=async e=>{if(e){const t=e.selected??!1;if(!await this.followCallback(!t,e.id,Ut.Topic,e.title))return this.failureInterestToast(e.id,t?"Follow":"Unfollow"),!1;this.updateActionsMap(this.followActions,e.id),this.displayFollowToast(t,e.id,Ut.Topic,e.title)}return await this.fetchFollowedTopicsAndPublishers(),!0},this.getSportsRecommendation=async e=>this.sportsPersonalizationDataService&&await this.sportsPersonalizationDataService.getSportsRecommendations(e)||[],this.onExperienceLinkClick=e=>{var t;const i={pivotId:"myInterests_experienceSettings",displayName:"Experience Settings"},n={isRequestFromMutePublisherToast:!1,noScroll:!0,pageType:Yt};if(!i||"windows"!==E.jG.AppType&&"edgeChromium"!==E.jG.AppType)if(lr.Nd.getRouteById("experience-settings"))this.navigateTo("experience-settings");else if(E.jG.isWindowsDashboard&&"sidebar"===(null===ie.Al||void 0===ie.Al||null===(t=ie.Al.ClientSettings)||void 0===t?void 0:t.pagetype)){const e=`https://${E.jG.NavTargetHostName}/${E.jG.CurrentMarket}/feed/personalize/settings`;window.open(e,"_blank")}else{const e=new URL(window.location.href);e.pathname=`/${E.jG.CurrentMarket}/feed/personalize/settings`,window.history.pushState({...n,shouldPush:!0},"",e.toString())}else{const e=(0,Ae.Eo)("default");(0,ar.l)().switchPivot({pivotId:i.pivotId,configIndexRef:e,context:n,telemetryPageName:n.pageType,display:i.displayName})}this.onCloseOverlayClick()},this.followingFeedClick=e=>{e&&_.M0.sendActionEvent(e.currentTarget,It.Aw.Click,It.wu.Click);let t="";if("edgeChromium"===E.jG.AppType)t=null===ie.Al||void 0===ie.Al?void 0:ie.Al.SwitchedPivot,t=t||(0,_t.NJ)();else if(E.jG.isWindowsDashboard){var i;if("sidebar"===(null===ie.Al||void 0===ie.Al||null===(i=ie.Al.ClientSettings)||void 0===i?void 0:i.pagetype)){const e=`https://${E.jG.NavTargetHostName}/${E.jG.CurrentMarket}/feed/interest/following`;window.open(e,"_blank")}else{const e=(0,ar.l)().getSelectedPivot();t=e&&e.pivotId||""}}else{const e=lr.Nd.getCurrentRoute();t=(null==e?void 0:e.id)??""}if(t!==ti&&"Following"!==t){const e={pivotId:E.jG.isWindowsDashboard?"Following":ti,displayName:"Following"},t={isRequestFromMutePublisherToast:!1,noScroll:!0,pageType:"Following"};if(e&&("windows"===E.jG.AppType||"edgeChromium"===E.jG.AppType||E.jG.isWindowsDashboard))"edgeChromium"===E.jG.AppType&&(ie.Al.SwitchedPivot=ti),(0,ar.l)().switchPivot({pivotId:e.pivotId,context:t,telemetryPageName:t.pageType,display:e.displayName});else if(lr.Nd.getRouteById(ti))this.navigateTo(ti);else{const e=new URL(window.location.href);e.pathname=`/${E.jG.CurrentMarket}/feed/following`,window.history.pushState({...t,shouldPush:!0},"",e.toString())}}this.onCloseOverlayClick()},this.getRecommendedTopics=async()=>{const e=await this.fetchRecomendedInterest();return await this.updateFetch(e),await this.fetchFollowedTopicsAndPublishers(),await this.publishersChanged(),await this.topicsChanged(),!0},this.dashboardVisibilityChangeHandler=()=>{on.gL&&!on.gL.get(on.Iq.IsDashboardVisible)&&this.onCloseOverlayClick()},this.themeChangeHandler=e=>{this.backgroundColor=e?"#333333":"#FFFFFF",this.baseLayerLuminance=e?nr.h.DarkMode:nr.h.LightMode},this.setFocus=(e,t)=>{var i,n,o,r;if(!this.shadowRoot)return;const s=null===(i=(n=this.shadowRoot).getElementById)||void 0===i?void 0:i.call(n,e);if(s)return void s.focus();const a=t&&(null===(o=(r=this.shadowRoot).getElementById)||void 0===o?void 0:o.call(r,t));a&&a.focus()},this.getLeftNavHeaderStr=()=>{var e,t;return this.config.enableProng2Design?(null===(e=this.strings)||void 0===e?void 0:e.personalizeHeader)||"":(null===(t=this.strings)||void 0===t?void 0:t.channelsHeader)||""}}async experienceConnected(){window.addEventListener(this.launchChannelStore,this.openChannelStore),this.TelemetryConstants=(e=>{if(!e)return;const t=e.contract,i=(null==t||t.ext,e.addOrUpdateChild({name:$t})),n=i.addOrUpdateChild({name:Ft,action:It.Aw.Click,behavior:It.wu.Close,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),o=i.addOrUpdateChild({name:Ot,action:It.Aw.Click,behavior:It.wu.Navigate,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),r=i.addOrUpdateChild({name:Mt,action:It.Aw.Click,behavior:It.wu.Show,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}});return{componentRoot:e,closeDialog:n,experienceSettings:i.addOrUpdateChild({name:Et,action:It.Aw.Click,behavior:It.wu.Navigate,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),followingFeed:o,search:r,NavItem:e=>i.addOrUpdateChild({name:Lt+e,action:It.Aw.Click,behavior:It.wu.Show,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),NextSlideArrow:e=>i.addOrUpdateChild({name:Rt+e,action:It.Aw.Click,behavior:It.wu.Paginate,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),PreviousSlideArrow:e=>i.addOrUpdateChild({name:At+e,action:It.Aw.Click,behavior:It.wu.Paginate,destinationUrl:"",content:{headline:$t,type:It.uH.Overlay}}),RecommendedFollowUnFollow:(e,t,n,o,r)=>i.addOrUpdateChild({name:`${o?"Unfollow":"Follow"}${e}`,action:It.Aw.Click,behavior:o?It.wu.Unfollow:It.wu.Follow,destinationUrl:"",content:{brand:n,brandId:t,headline:$t,isLocal:r,type:It.uH.Overlay}})}})(this.telemetryObject);const e=this.config.cardProviderConfig;e&&(this.ServiceApiKey=e.initialRequest.apiKey),Tt.A.singleMark("ChannelStore.connectedCallback");const{localizedStrings:t,enableNotificationSettings:i}=this.config;var n,o,r,s,a,l,c,d,p,u,h,g,f,v,m,y,b,w,S,C,x,T,k,I,P,$,F,L,R,A,O,M,U,D,N,H,_,j,B,z,q,G,W,V,K,Q,J,Z,X,Y;t&&(this.navItems=this.navItems.map((e=>{let i=e.display;switch(e.id){case"discover":i=t.discoverHeader||e.display;break;case"following":i=t.followingHeader||e.display;break;case"blocked":i=t.blockedHeader||e.display}return{...e,display:i}}))),i&&(this.notificationItems=(n=this.strings.notificationSettingsStrings,[{verticalId:an,label:null===(o=null==n?void 0:n.newsStrings)||void 0===o?void 0:o.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerNews.svg`,items:[{pdpType:Cn,label:null===(r=null==n?void 0:n.newsStrings)||void 0===r?void 0:r.breakingNews},{pdpType:xn,label:null===(s=null==n?void 0:n.newsStrings)||void 0===s?void 0:s.trendingStories},{pdpType:Tn,label:null===(a=null==n?void 0:n.newsStrings)||void 0===a?void 0:a.followedByYou}]},{verticalId:pn,label:null===(l=null==n?void 0:n.weatherStrings)||void 0===l?void 0:l.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerWeather.svg`,items:[{pdpType:kn,label:null===(c=null==n?void 0:n.weatherStrings)||void 0===c?void 0:c.eTree},{pdpType:In,label:null===(d=null==n?void 0:n.weatherStrings)||void 0===d?void 0:d.weatherSummary},{pdpType:Pn,label:null===(p=null==n?void 0:n.weatherStrings)||void 0===p?void 0:p.pollen},{pdpType:$n,label:null===(u=null==n?void 0:n.weatherStrings)||void 0===u?void 0:u.nowcast},{pdpType:Fn,label:null===(h=null==n?void 0:n.weatherStrings)||void 0===h?void 0:h.AQI},{pdpType:Ln,label:null===(g=null==n?void 0:n.weatherStrings)||void 0===g?void 0:g.hurricane},{pdpType:En,label:null===(f=null==n?void 0:n.weatherStrings)||void 0===f?void 0:f.severeWeather},{pdpType:Rn,label:null===(v=null==n?void 0:n.weatherStrings)||void 0===v?void 0:v.wildfire},{pdpType:An,label:null===(m=null==n?void 0:n.weatherStrings)||void 0===m?void 0:m.sunriseSet},{pdpType:On,label:null===(y=null==n?void 0:n.weatherStrings)||void 0===y?void 0:y.lifeIndex},{pdpType:Mn,label:null===(b=null==n?void 0:n.weatherStrings)||void 0===b?void 0:b.teaserHumidity},{pdpType:Un,label:null===(w=null==n?void 0:n.weatherStrings)||void 0===w?void 0:w.teaserUVIndex},{pdpType:Dn,label:null===(S=null==n?void 0:n.weatherStrings)||void 0===S?void 0:S.teaserVisibility},{pdpType:Nn,label:null===(C=null==n?void 0:n.weatherStrings)||void 0===C?void 0:C.teaserWind},{pdpType:Hn,label:null===(x=null==n?void 0:n.weatherStrings)||void 0===x?void 0:x.teaserTempChange},{pdpType:_n,label:null===(T=null==n?void 0:n.weatherStrings)||void 0===T?void 0:T.teaserTemp},{pdpType:jn,label:null===(k=null==n?void 0:n.weatherStrings)||void 0===k?void 0:k.teaserSummary},{pdpType:Bn,label:null===(I=null==n?void 0:n.weatherStrings)||void 0===I?void 0:I.teaserTempRecord},{pdpType:zn,label:null===(P=null==n?void 0:n.weatherStrings)||void 0===P?void 0:P.teaserRain},{pdpType:qn,label:null===($=null==n?void 0:n.weatherStrings)||void 0===$?void 0:$.storm}]},{verticalId:ln,label:null===(F=null==n?void 0:n.sportsStrings)||void 0===F?void 0:F.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerSports.svg`,items:[{pdpType:Gn,label:null===(L=null==n?void 0:n.sportsStrings)||void 0===L?void 0:L.sportsMatch}]},{verticalId:sn,label:null===(R=null==n?void 0:n.financeStrings)||void 0===R?void 0:R.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerFinance.svg`,items:[{pdpType:un,label:null===(A=null==n?void 0:n.financeStrings)||void 0===A?void 0:A.earningsBrief},{pdpType:hn,label:null===(O=null==n?void 0:n.financeStrings)||void 0===O?void 0:O.priceMovement},{pdpType:gn,label:null===(M=null==n?void 0:n.financeStrings)||void 0===M?void 0:M.marketBrief},{pdpType:fn,label:null===(U=null==n?void 0:n.financeStrings)||void 0===U?void 0:U.earningRelease},{pdpType:vn,label:null===(D=null==n?void 0:n.financeStrings)||void 0===D?void 0:D.institutionalHolding},{pdpType:mn,label:null===(N=null==n?void 0:n.financeStrings)||void 0===N?void 0:N.sentiment},{pdpType:yn,label:null===(H=null==n?void 0:n.financeStrings)||void 0===H?void 0:H.watchlistSummary},{pdpType:bn,label:null===(_=null==n?void 0:n.financeStrings)||void 0===_?void 0:_.prepopulatedWatchlist},{pdpType:wn,label:null===(j=null==n?void 0:n.financeStrings)||void 0===j?void 0:j.eventBrief},{pdpType:Sn,label:null===(B=null==n?void 0:n.financeStrings)||void 0===B?void 0:B.flashNews}]},{verticalId:dn,label:null===(z=null==n?void 0:n.trafficStrings)||void 0===z?void 0:z.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerTraffic.svg`,items:[{pdpType:Wn,label:null===(q=null==n?void 0:n.trafficStrings)||void 0===q?void 0:q.commute},{pdpType:Vn,label:null===(G=null==n?void 0:n.trafficStrings)||void 0===G?void 0:G.highestImpactIncident},{pdpType:Kn,label:null===(W=null==n?void 0:n.trafficStrings)||void 0===W?void 0:W.areaSummary},{pdpType:Qn,label:null===(V=null==n?void 0:n.trafficStrings)||void 0===V?void 0:V.accident},{pdpType:Jn,label:null===(K=null==n?void 0:n.trafficStrings)||void 0===K?void 0:K.construction},{pdpType:Zn,label:null===(Q=null==n?void 0:n.trafficStrings)||void 0===Q?void 0:Q.roadHazard},{pdpType:Xn,label:null===(J=null==n?void 0:n.trafficStrings)||void 0===J?void 0:J.roadClosure},{pdpType:Yn,label:null===(Z=null==n?void 0:n.trafficStrings)||void 0===Z?void 0:Z.congestion}]},{verticalId:cn,label:null===(X=null==n?void 0:n.shoppingStrings)||void 0===X?void 0:X.categoryLabel,iconLink:`${E.jG.StaticsUrl}latest\\icons-wc\\icons\\BannerShopping.svg`,items:[{pdpType:eo,label:null===(Y=null==n?void 0:n.shoppingStrings)||void 0===Y?void 0:Y.dealOfTheDay}]}]),this.navItems.push(ni),this.flattenedNavItems=this.navItems);const ee=new URLSearchParams(window.location.search);"true"===(null==ee?void 0:ee.get("open_cs"))&&(0,kt.b1)().then((()=>{window.requestAnimationFrame(this.openChannelStore)}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(this.launchChannelStore,this.openChannelStore)}renderProng2ChannelStoreEventChanged(){this.renderProng2ChannelStoreEvent&&this.openChannelStore(this.renderProng2ChannelStoreEvent)}applyGlobalStyles(){this.styleElement=document.createElement("style"),this.styleElement.innerText=mr,window.document.head.appendChild(this.styleElement)}getExperienceType(){return F.x.channelStore}get followedTopicIds(){var e;return(null===(e=this.followedTopicsAndPublishers)||void 0===e?void 0:e.map((e=>(null==e?void 0:e.id)||"")))||[]}setupDataConnectors(){const e=to._.getInstance(),t=new jt.fH;new zi(L.z.TopicData,"",e.rootReducer,new Vi,e.store,{},t)}async loadAndSubscribeInterestsDataConnector(e){if(!this.topicsDataConnector){if(e&&this.setupDataConnectors(),this.topicsDataConnector=await(0,mt.K0)(L.z.TopicData),this.topicsDataConnector)return this.topicsDataConnector.setApiKey(this.ServiceApiKey),void(0,cr.Uo)(L.z.TopicData,(e=>{this.topicDataState=e}));e?this.onAppError({...O.T4K,message:"Topic Data Connector is not defined."}):this.loadAndSubscribeInterestsDataConnector(!0)}}initServiceClient(){(0,ce.N)()&&(this.publisherServiceClient=this.publisherServiceClient||new vt.PublisherServiceClient(window.fetch.bind(window),!1),this.publisherServiceClient&&this.publisherServiceClient.setForcedApiKey(this.ServiceApiKey))}updateActionsMap(e,t){const i=e.get(t);e.has(t)?e.set(t,!i):e.set(t,!0)}handleImageError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,A.H)(O.kAq,"Failed to load image in Channel Store",`Broken image for '${t}'. Image src: ${e}`)}initialSportsServiceClient(){var e;if(!this.config||null===(e=this.config)||void 0===e||!e.sportsRecommendationConfig)return;const t=this.config.sportsRecommendationConfig;if(!(t.fetchSearchSuggestionUrl&&t.fetchSportsRecommendationsUrl&&t.sportsApiKey&&t.ocid))return;const i={apiKey:t.sportsApiKey||"",apiVersion:"1.0",fetchSearchSuggestionBaseUrl:t.fetchSearchSuggestionBaseUrl||"",fetchSearchSuggestionEndpoint:t.fetchSearchSuggestionUrl||"",personalizationStripEndpoint:t.fetchSportsRecommendationsUrl||"",apiOcid:t.ocid||""};this.sportsPersonalizationDataService=new ir(i,this.strings)}async showMutedPublishers(){await this.fetchMutedPublishers(),this.mutedPublishers[0]?(this.mutedPublishers[0].showDivider=!1,this.noMutedPublishers=!1):this.noMutedPublishers=!0}failureInterestToast(e,t){Yi.h.renderToast({id:`${e}-${t}-channelstore`,toastType:en.p.InterestFailure,expirationInMs:3e3})}resetSearch(){this.inputElement&&this.inputElement.value&&(this.inputElement.value=""),this.topicsTable=this.restructInterests(this.getUnfollowedInterests(this.topics),this.topicLineLimit),this.publishersTable=this.restructInterests(this.getUnfollowedInterests(this.publishers),this.publisherLineLimit),this.noSearchResults=!1,this.sportsTable=[],this.showFooter=!0,this.resultCount=-1,this.updateSearchResultAriaText()}clearBtnFocused(){this.clearButtonOnFocus=!0}clearBtnUnFocused(){this.clearButtonOnFocus=!1}searchBoxOnFocus(){this.inputOnFocus=!0}searchBoxOnBlurs(){this.inputOnFocus=!1}async searchInterests(){var e,t;this.resetPageIndicator(),this.noSearchResults=!1;let i=null===(e=this.inputElement)||void 0===e?void 0:e.value;if(!i)return void this.resetSearch();this.showFooter=!1,this.interestsSearchServiceClient=this.interestsSearchServiceClient||new Qi(window.fetch.bind(window),this.onAppError),this.interestsSearchServiceClient.setForcedApiKey(this.ServiceApiKey),i=i&&i.replace(/[[@^_=;\]&/\\#,+()$~%.":*?!<>{}]/g," ").trim(),this.searchInputValue=i;let n=[],o=[];if(this.showBtnGroup?[n=[],o=[]]=await Promise.all([this.fetchSportSuggestions(i),this.interestsSearchServiceClient.getSuggestedInterestsAndSources(encodeURIComponent(i),50,this.config.searchSuggestionSourceType)]):o=await this.interestsSearchServiceClient.getSuggestedInterestsAndSources(encodeURIComponent(i),50,this.config.searchSuggestionSourceType)||[],n&&n.length){const e=n.map((e=>e.yId));o=o.filter((t=>!e.includes(t.id)))}if(this.searchInputValue!==i)return;const r=[],s=[];if(0==o.length&&(this.noSearchResults=!0),o.forEach((e=>{const t={id:e.id,title:e.displayText,selected:!1,images:[{url:e.imageUrl}]};if("topic"===e.kind)r.push(t);else s.push(t)})),0==r.length&&0==s.length&&(this.noSearchResults=!0),this.followedTopics&&this.followedTopics.forEach((e=>{const t=r.find((t=>t.id==e.id));t&&(t.selected=!0)})),this.followedPublishers&&this.followedPublishers.forEach((e=>{const t=s.find((t=>t.title==e.name));t&&(t.selected=!0)})),this.topicsTable.forEach((e=>{e.forEach((e=>{if(e.selected){const t=r.find((t=>t.id==e.id));t&&(t.selected=!0)}}))})),this.publishersTable.forEach((e=>{e.forEach((e=>{if(e.selected){const t=s.find((t=>t.title==e.title));t&&(t.selected=!0)}}))})),i=null===(t=this.inputElement)||void 0===t?void 0:t.value,!i)return this.resetSearch(),void(this.resultCount=0);const a=Math.ceil((null==s?void 0:s.length)/3);this.publishersTable=this.restructInterests(s,a<this.publisherLineLimit?a:this.publisherLineLimit,3);const l=Math.ceil((null==r?void 0:r.length)/3);this.topicsTable=this.restructInterests(r,l<this.topicLineLimit?l:this.topicLineLimit,3);const c=this.publishersTable.reduce(((e,t)=>e+t.length),0),d=this.topicsTable.reduce(((e,t)=>e+t.length),0);this.resultCount=c+d,this.updateSearchResultAriaText()}setFollowedSelectedState(e,t,i){var n;const o=this.topics.find((e=>e.id==t));o&&(o.selected=e);const r=this.publishers.find((e=>e.title==i));r&&(r.selected=e);const s=null===(n=this.followedTopicsAndPublishers)||void 0===n?void 0:n.find((e=>e.id==t));s&&(s.selected=e,this.followedTopicsAndPublishers=(0,or.Z)(this.followedTopicsAndPublishers))}async currentPublisherPageChanged(){const e=this.publisher_list_index_arr.length-1;0===this.currentPublisherPage?this.publisher_list_class="first-page":this.currentPublisherPage===e?this.publisher_list_class="last-page":this.publisher_list_class="mid-page"}async currentTopicPageChanged(){const e=this.topic_list_index_arr.length-1;0===this.currentTopicPage?this.topic_list_class="first-page":this.currentTopicPage===e?this.topic_list_class="last-page":this.topic_list_class="mid-page"}restructInterests(e,t,i){if(0===e.length)return[];const n=[];if(i)for(let o=0;o<t&&0!==(null==e?void 0:e.length);o++)for(let t=0;t<i&&0!==(null==e?void 0:e.length);t++)n[t]?n[t].push(e.shift()):n.push([e.shift()]);else for(let i=0;i<=e.length/t;i++)n.push(e.slice(i*t,(i+1)*t));return n}imageResize(e,t){e&&e.length&&e.forEach((e=>{const{images:i}=e;if(i&&i.length&&i[0]&&i[0].url){const{url:n}=i[0];e.images[0].url=n.includes("?w=")?n:(0,Ho.mL)(n,{width:t,height:t,enableDpiScaling:!0,devicePixelRatio:1})}}))}async onDiscoverOpen(){this.resetPageIndicator(),this.fetchFollowedTopicsAndPublishers(),await this.topicsChanged(),await this.publishersChanged()}resetPageIndicator(){this.topic_list_class="first-page",this.publisher_list_class="first-page",this.currentPublisherPage=0,this.currentTopicPage=0}async searchClick(e){var t;e&&_.M0.sendActionEvent(e.currentTarget,It.Aw.Click,It.wu.Click),this.ref_interest_content&&this.ref_interest_content.scrollTo(0,0),null===(t=this.inputElement)||void 0===t||t.focus()}emptyFeedOnClick(){this.selectedNavId="discover"}displayFollowToast(e,t,i,n){const o=e?`${t}-channelstore-follow`:`${t}-channelstore-unfollow`;Yi.h.renderToast({id:o,toastType:e?en.p.Unfollow:en.p.Follow,inputText:n,expirationInMs:3e3})}updateSearchResultAriaText(){const e=1===this.resultCount?" is ":" are ",t=1===this.resultCount?" result ":" results ";this.searchResultAriaText="There"+e+this.resultCount+t+"showing for "+this.searchInputValue}async onClickSportsCard(e){if(e){const t=e.selected??!1;this.updateActionsMap(this.followActions,e.id);if(!await this.followCallback(!t,e.id,Ut.Topic,e.title))return void this.failureInterestToast(e.id,t?"Follow":"Unfollow");this.displayFollowToast(t,e.id,Ut.Topic,e.title)}const t=e.selected??!1;this.setFollowedSelectedState(!t,e.id),this.sportsTable.forEach((i=>{i.forEach((i=>{if(i.id===e.id)return i.selected=!t,void(this.sportsTable=(0,or.Z)(this.sportsTable))}))}))}async onClickTopicCard(e){if(e){const t=e.selected??!1;this.updateActionsMap(this.followActions,e.id);if(!await this.followCallback(!t,e.id,Ut.Topic,e.title))return void this.failureInterestToast(e.id,t?"Follow":"Unfollow");this.displayFollowToast(t,e.id,Ut.Topic,e.title)}const t=e.selected??!1;this.setFollowedSelectedState(!t,e.id),this.topicsTable.forEach((i=>{i.forEach((i=>{if(i.id===e.id)return i.selected=!t,void(this.topicsTable=(0,or.Z)(this.topicsTable))}))})),await this.fetchFollowedChannels()}async onClickPublisherCard(e){if(e){var t;const i=e.selected??!1;this.updateActionsMap(this.followActions,e.id);const n=null===(t=this.mutedPublishers.find((t=>t.cmsProviderId===e.id)))||void 0===t?void 0:t.id;!i&&n&&this.blockedButtonOnClick(!0,n,void 0,e.title,!0);const o=e&&e.provider&&e.provider.profileId||e.id;if(!await this.followCallback(!i,o,Ut.Publisher,e.title))return void this.failureInterestToast(e.id,i?"follow":"unfollow");this.displayFollowToast(i,e.id,Ut.Publisher,e.title)}const i=e.selected??!1;this.setFollowedSelectedState(!i,void 0,e.title),this.publishersTable.forEach((t=>{t.forEach((t=>{if(t.id===e.id)return t.selected=!i,void(this.publishersTable=(0,or.Z)(this.publishersTable))}))})),await this.fetchFollowedChannels()}navigateTo(e){const t=lr.Nd.getRouteById(e);if(t.useExternalRouting)return $.H.set($.a.CurrentRoute,t),void window.dispatchEvent(new CustomEvent("header-route-changed",{detail:{route:t}}));const i=t.destinationUrl;i&&(window.location.href=decodeURIComponent(i??""))}async fetchRecomendedInterest(){const e=void 0,t=this.config.cardProviderConfig;this.dataProvider=new Xi(!0);const i={...t&&t.initialRequest,nextPageUrl:e,useNextPageUrl:!1,enableWpoAdPlacements:!0,taboolaSessionId:"init",enableRightRailColumnLayout:void 0,useSuperFeed:!0,feedId:void 0};try{var n;let e,t=!1;if(e=await this.dataProvider.fetch(i),(null===(n=e.appError)||void 0===n?void 0:n.id)===O.gX7.id&&(t=!0,e=await this.dataProvider.fetch(i)),!this.responseContainsCardsData(e)){var o;if(!this.lastResponse)null!==(o=e)&&void 0!==o&&o.userEndError?_.M0.sendAppErrorEvent({...O.L_b,message:"Showing blank recommendations for issue on user's end",pb:{...O.L_b.pb,viewLayout:"Channel Store",isRetry:t}}):_.M0.sendAppErrorEvent({...O.z48,message:"Rendered blank recommendations",pb:{...O.z48.pb,userImpact:!0,associatedAppError:e&&e.appError,viewLayout:"Channel Store",isRetry:t}});return this.lastResponse}return this.lastResponse=e,e}catch(e){}}responseContainsCardsData(e){return!(!e||(0,Bt.x)(e.sections)&&(0,Bt.x)(e.regions))}async updateFetch(e){if(e){const i=(e,t)=>{if(t&&t.length>0&&t[0].template&&"interestdiscoverymanagerdefault"==t[0].template){const e=t[0].cards;if(e&&e.length>0){const t=e[0];if(t&&"UserInterestTopicAndProvider"==t.type&&t.subCards){const e=t.subCards;if(e&&e.length>0){const t=e.find((e=>"Topics"==e.type));t&&t.subCards&&t.subCards.length>0?this.topics=t.subCards??[]:_.M0.sendAppErrorEvent({...O.ATu,message:"Emtpy Topics list from response.",pb:{...O.ATu.pb,userImpact:!0}});const i=e.find((e=>"Providers"==e.type));i&&i.subCards&&i.subCards.length>0?this.publishers=i.subCards??[]:_.M0.sendAppErrorEvent({...O.j7$,message:"Emtpy Publishers list from response.",pb:{...O.j7$.pb,userImpact:!0}})}}}}};var t;if(e.sections)null===(t=e.sections)||void 0===t||t.forEach((e=>{i(e.region,e.subSections)}))}}markLocalPublisherTmpl(){this.publishers.some((e=>e.isLocalContent))&&_.M0.addOrUpdateTmplProperty("storelocalpubux",this.config.enableLocalBadge?"1":"0")}}(0,s.gn)([Ht.LO],Lr.prototype,"resultCount",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"searchResultAriaText",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"showOverlay",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"forceTreeView",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"inputOnFocus",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"clearButtonOnFocus",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_interest_content",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_following_tiles",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_following_tiles_Blocked",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_notifications",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"notificationItems",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"noSearchResults",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"showFooter",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"showBtnGroup",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topics",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"publishers",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"showSportsSuggests",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"noSuggestSportsResult",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"sportsTable",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topicLineLimit",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"publisherLineLimit",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topicsTable",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"publishersTable",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"TelemetryConstants",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_topic_list",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"ref_publisher_list",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topic_list_class",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"publisher_list_class",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topic_list_index_arr",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"publisher_list_index_arr",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"currentPublisherPage",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"currentTopicPage",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"currentVertical",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"backgroundColor",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"baseLayerLuminance",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"overlayClass",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"enableFeedCustomization",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"renderProng2ChannelStoreEvent",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"softLandingActive",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"showPublishersTop",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"topicDataState",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"followedTopics",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"followedPublishers",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"followedTopicsAndPublishers",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"mutedPublishers",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"noFollowedChannels",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"noMutedPublishers",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"selectedNavId",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"treeView",void 0),(0,s.gn)([Ht.LO],Lr.prototype,"navItems",void 0),(0,s.gn)([Ht.lk],Lr.prototype,"followedTopicIds",null);var Er=i(89150),Rr=i(28904),Ar=i(51523);const Or=new class{constructor(){this.fallbackOptions={light:{defaultTextColor:"#FFF",bgColors:["#E3008C","#C239B3","#2169EB","#8230FF","#00B7C3","#CA5010","#986F0B","#004E8C"]},dark:{defaultTextColor:"#000",bgColors:["#EE5FB7","#DA7ED0","#69A1FA","#B696FF","#58D3DB","#DF8E64","#C1A256","#4A89BA"]}},this.fallbackImageCache={}}generate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&this.fallbackImageCache[e])return this.fallbackImageCache[e];const{defaultTextColor:i,bgColors:n}=this.fallbackOptions[t?"dark":"light"],o=this.pickBgColor(n),r=i,s={letterLogo:e?e[0].toLocaleUpperCase():"",textColor:r,bgColor:o};return e&&(this.fallbackImageCache[e]=s),s}pickBgColor(e){return e[Math.floor(Math.random()*e.length)]}};var Mr=i(90061);function Ur(e){if(e)return{alt:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",src:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",size:{height:e,width:e}}}class Dr extends Rr.H{constructor(){super(...arguments),this.showFallbackImage=!1,this.fontContainerScaling=1.75,this.defaultImagePath="/AAtCmK3",this.themeSubscriber={handleThemeChange:e=>{var t;this.fallbackImage=Or.generate(null===(t=this.imageInfo)||void 0===t?void 0:t.alt,e)}},this.generateSizedSrc=()=>{const{src:e,size:t}=this.imageInfo||{};if(!e||e.includes(this.defaultImagePath))return this.showFallbackImage=!0,"";if(this.showFallbackImage=!1,!t)return e;let i;try{const t=(n=e).startsWith("http:")||n.startsWith("https:")?n:(0,le.SJ)()+n;i=new URL(t)}catch(t){return(0,A.OO)(t,O.fDR,"Invalid URL for topic image",`Image url: ${e}`),e}var n;const{width:o,height:r}=t;return[["w",2*o],["h",2*r]].forEach((e=>{let[t,n]=e;i.searchParams.set(t,`${n}`)})),i.toString()}}imageInfoChanged(){var e;this.sizedSrc=this.generateSizedSrc(),this.fallbackImage=Or.generate(null===(e=this.imageInfo)||void 0===e?void 0:e.alt,Ar.k.appInDarkMode())}get roundedClass(){return this.rounded?"rounded":"squared"}connectedCallback(){super.connectedCallback(),(0,ce.N)()&&(0,Mr.l_)(this).then((()=>{Ar.k.subscribeThemeChange(this.themeSubscriber)}))}disconnectedCallback(){super.disconnectedCallback(),Ar.k.unsubscribeThemeChange(this.themeSubscriber)}handleTopicImageError(){var e,t,i;this.showFallbackImage=!0,null===(e=this.onImageError)||void 0===e||e.call(this,(null===(t=this.imageInfo)||void 0===t?void 0:t.src)||"",(null===(i=this.imageInfo)||void 0===i?void 0:i.alt)||"")}}(0,s.gn)([Ht.LO],Dr.prototype,"imageInfo",void 0),(0,s.gn)([Ht.LO],Dr.prototype,"rounded",void 0),(0,s.gn)([Ht.LO],Dr.prototype,"onImageError",void 0),(0,s.gn)([Ht.LO],Dr.prototype,"fallbackImage",void 0),(0,s.gn)([Ht.LO],Dr.prototype,"showFallbackImage",void 0),(0,s.gn)([Ht.LO],Dr.prototype,"sizedSrc",void 0);const Nr=S.i` :host{display:flex}.fallback-topic-image{display:flex;align-items:center;justify-content:center}.fallback-topic-image span{font-weight:600}.rounded{border-radius:100%}.squared{border-radius:8px}`;function Hr(e){return e?`${e}px`:""}const _r=d.dy`
${(0,g.g)((e=>e.fallbackImage),d.dy`<div class="fallback-topic-image ${e=>e.roundedClass}" style="${function(e){var t,i,n;const{height:o,width:r}=(null===(t=e.imageInfo)||void 0===t?void 0:t.size)||{};return[["background-color",null===(i=e.fallbackImage)||void 0===i?void 0:i.bgColor],["color",null===(n=e.fallbackImage)||void 0===n?void 0:n.textColor],["height",Hr(o)],["width",Hr(r)]].map((e=>{let[t,i]=e;return i&&`${t}:${i}`})).filter(Boolean).join(";")}}"><span style="font-size: ${function(e){var t;const{height:i}=(null===(t=e.imageInfo)||void 0===t?void 0:t.size)||{};return i?`${Math.round(i/e.fontContainerScaling)}px`:"100%"}}">${e=>{var t;return null===(t=e.fallbackImage)||void 0===t?void 0:t.letterLogo}}</span></div>`)}`,jr=d.dy`<img part="topic-image" class="${e=>e.roundedClass}" @error=${(e,t)=>e.handleTopicImageError()} src=${e=>e.sizedSrc} style=${e=>{var t,i,n;return(null===(t=e.imageInfo)||void 0===t?void 0:t.size)&&`height: ${Hr(null===(i=e.imageInfo)||void 0===i?void 0:i.size.height)}; width: ${Hr(null===(n=e.imageInfo)||void 0===n?void 0:n.size.width)}`}} alt=${e=>{var t;return null===(t=e.imageInfo)||void 0===t?void 0:t.alt}}
/>`,Br=d.dy` ${(0,g.g)((e=>{var t;return null===(t=e.imageInfo)||void 0===t?void 0:t.size}),(e=>e.sizedSrc&&!e.showFallbackImage?jr:_r))}
`;let zr=class extends Dr{};zr=(0,s.gn)([(0,Rr.M)({name:"msn-topic-image",template:Br,styles:Nr})],zr);var qr=i(52296),Gr=i.n(qr),Wr=i(66747),Vr=i.n(Wr);const Kr=d.dy`<span slot="start">${e=>e.selected?d.dy`${d.dy.partial(Vr())}`:d.dy`${d.dy.partial(Gr())}`}</span>`,Qr=d.dy`<fluent-button class="follow-button ${e=>e.selected?"selected-channel":""}" appearance="stealth" @click=${e=>{var t;return null===(t=e.followButtonProps)||void 0===t?void 0:t.onClick(!e.selected,e.id,e.type,e.name)}} title="${e=>{var t;return null===(t=e.followButtonProps)||void 0===t?void 0:t.string}}" aria-label="${e=>{var t;return null===(t=e.followButtonProps)||void 0===t?void 0:t.string}}" selected="${e=>e.selected}" data-t="${e=>{var t;return null===(t=e.followButtonProps)||void 0===t?void 0:t.telemetryObject}}" id=${(e,t)=>t.index===t.length-1?"last-following-blocked-btn":""}>${(0,g.g)((e=>!e.isMuted),Kr)} ${e=>{var t,i;return e.selected?null===(t=e.followButtonProps)||void 0===t?void 0:t.selectedString:null===(i=e.followButtonProps)||void 0===i?void 0:i.string}}</fluent-button>`,Jr=d.dy`<fluent-divider class="menu-item-divider"></fluent-divider>`,Zr=d.dy`
${(0,g.g)((e=>e.showDivider),Jr)}<div class= "topic"><msn-topic-image role="presentation" :imageInfo=${e=>Ur(40,e.name,e.icon)} :rounded=${()=>!1} :onImageError=${(e,t)=>t.parent.handleImageError}></msn-topic-image><div tabindex="0" class="topic-name-container"><span class="topic-name">${e=>e.name}</span><span class="topic-type">${e=>e.typeName}</span></div>${Qr}</div>`,Xr=d.dy`<div class="following-empty-container"><div tabindex="0" class="following-empty" id="following-blocked-empty">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.followingEmptyFeedText.split("{0}")[0].trim()}}<button class="discover-link" role="button" title=${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.followingEmptyFeedLinkText}} @click=${e=>e.emptyFeedOnClick()}>${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.followingEmptyFeedLinkText}}</button>${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.followingEmptyFeedText.split("{0}")[1].trim()}}</div></div>`,Yr=d.dy`<div class="interest-content following"
${(0,p.i)("ref_following_tiles")}><div class="following-tiles topic-list">${(0,Er.rx)((e=>e.followedTopicsAndPublishers),Zr,{positioning:!0})}</div></div>`,es=d.dy`<div class="interest-content blocked"
${(0,p.i)("ref_following_tiles_Blocked")}><div class="following-tiles topic-list">${(0,Er.rx)((e=>e.mutedPublishers),Zr,{positioning:!0})}</div></div>`,ts=d.dy`<div class="following-feed"><span tabindex="0" class="following-title" id="following-title">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.followingHeader}}</span>${(0,g.g)((e=>!e.noFollowedChannels),Yr)} ${(0,g.g)((e=>e.noFollowedChannels),Xr)}</div>`,is=d.dy`<div><span tabindex="0" class="following-empty" id="following-blocked-empty">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.blockedEmptyFeedText}}</span></div>`,ns=d.dy`<div class="following-feed"><span tabindex="0" class="following-title" id="blocked-title">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.blockedHeader}}</span>${(0,g.g)((e=>!e.noMutedPublishers),es)} ${(0,g.g)((e=>e.noMutedPublishers),is)}</div>`;var os=i(41869),rs=i(45991),ss=i.n(rs),as=i(3379),ls=i.n(as),cs=i(93530),ds=i.n(cs),ps=i(54256);const us={background:"#FFFFFF",hover:"#F5F5F5",iconOutline:"#D1D1D1",iconHoverBackground:"#E5E5E5",iconHoverOutline:"#BDBDBD"},hs={background:"#454545",hover:"#515151",iconOutline:"#666666",iconHoverBackground:"#3D3D3D",iconHoverOutline:"#757575"},gs=e=>`${e} -8px -10px 4px 0px, ${e} -8px 0px 7px, ${e} -8px 10px 4px`,fs="follow-button",vs=S.i` :host(.square-design){outline:none;box-shadow:0px 2px 4px 0px rgba(0,0,0,0.10)}:host(.square-design.selected),:host(.is-channel-link.selected){background:${us.background};outline:none}:host(.square-design:hover),:host(.square-design.selected:hover){background:${us.hover}}:host(.is-channel-link:hover) .topic-name{text-decoration:underline}:host(.square-design) msn-topic-image{margin-inline:8px}:host(.square-design) .icon{border:none;border-radius:4px;box-sizing:border-box;outline:1px solid ${us.iconOutline};overflow:hidden;padding:0px 4px;width:auto;transition:all 0.2s ease-in-out}:host(.square-design.selected) .icon,:host(.square-design) .icon:hover,:host(.is-channel-link) .icon:hover{background-color:${us.iconHoverBackground};
outline: 1px solid ${us.iconHoverOutline};color:rgba(0,0,0,0.86)}:host(.square-design.selected) .icon svg,:host(.square-design) .icon:hover svg,:host(.is-channel-link) .icon:hover svg{fill:rgba(0,0,0,0.86)}:host(.square-design) .${fs} .icon::after{content:attr(data-label);box-sizing:border-box;font-size:12px;max-width:0;opacity:0;transition:all 0.2s ease-in-out;text-overflow:ellipsis;overflow:hidden}:host(.square-design) .${fs}:hover .icon,
:host(.square-design) .${fs}:focus .icon{box-shadow:${gs(us.hover)};
}
:host(.square-design) .${fs}:hover .icon::after,
:host(.square-design) .${fs}:focus .icon::after{margin-inline:4px 1px;max-width:80px;opacity:1}`,ms=S.i` :host(.square-design.selected),:host(.is-channel-link.selected){background:${hs.background}}:host(.square-design:hover),:host(.square-design.selected:hover){background:${hs.hover}}:host(.square-design) .icon{outline-color:${hs.iconOutline}}:host(.square-design.selected) .icon,:host(.square-design) .icon:hover,:host(.is-channel-link) .icon:hover{background-color:${hs.iconHoverBackground};
outline-color: ${hs.iconHoverOutline};color:white}:host(.square-design.selected) .icon svg,:host(.square-design) .icon:hover svg,:host(.is-channel-link) .icon:hover svg{fill:white}:host(.square-design) .${fs}:hover .icon,
:host(.square-design) .${fs}:focus .icon{box-shadow:${gs(hs.hover)};
}`,ys=S.i` .local-badge{align-items:center;display:flex;color:#038387;font-size:12px;font-weight:600;gap:1.5px;margin-top:2px}.local-badge path{fill:currentColor}.topic-content-section.is-local .topic-content-attribution-section{margin-top:-3px}.topic-content-section.is-local .topic-content-title{line-height:18px}:host(.is-local) .topic-name{display:flex;height:20px;min-width:100%;-webkit-mask-image:linear-gradient(270deg,rgba(255,255,255,0) 26%,rgb(255,255,255) 40%)}`,bs=S.i` .local-badge{color:#A4E9ED}`,ws=S.i`
:host(.prong2-design:hover):not(.is-channel-link){background-color:#515151}:host(.prong2-design) .icon{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.09)}:host(.prong2-design) .topic-name{color:white}:host(.prong2-design.selected) .icon{background-color:#60CDFF}:host(.prong2-design.selected){outline:2px solid var(--dark-fill-color-accent-default,#60CDFF);background:#1A3440}:host(.prong2-design.selected:hover):not(.is-channel-link){background:#112A35}:host(.prong2-design.selected:active):not(.is-channel-link){background:#09232F}:host(.prong2-design) svg{fill:white}:host(.prong2-design.selected) svg{fill:black;color:black}`,Ss=S.i`
${ws}
:host{background-color:#454545}:host(:hover){background-color:#4D4D4D}:host(:active),:host(.prong2-design:active){background-color:#343434}:host(.selected){background:#1A2338;outline:2px solid #235CCF}.icon{background:#292929;fill:white;border:1px solid #666666}${ms}
${bs}
`,Cs=S.i`
.prong2-design msn-topic-image{margin-inline-end:8px}.prong2-design .topic-name{margin-inline-end:30px}.prong2-design .icon{background:rgba(255,255,255,0.70);border:1px solid rgba(0,0,0,0.06)}:host(.prong2-design.selected) .icon{background-color:#005FB8}:host(.prong2-design.selected){outline:2px solid var(--light-fill-color-accent-default,#005FB8);background:#D3EAFF}:host(.prong2-design.selected:hover){background:#BCDFFF}:host(.prong2-design.selected:active){background:#ACD7FF}`,xs=S.i`
${Cs} :host{border-radius:6px;height:56px;width:200px;background-color:#FFFFFF;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;position:relative;box-shadow:0px 1px 2px rgba(0,0,0,0.08)}:host(:hover){background-color:#F5F5F5;box-shadow:0px 3px 6px rgba(0,0,0,0.12)}:host(:active){background-color:#E0E0E0;box-shadow:0px 3px 6px 0px rgba(0,0,0,0.12)}fluent-design-system-provider{background:transparent;width:100%}.container{display:flex;align-items:center;width:100%;background:transparent}.attribution{width:144px}.icon{align-items:center;background:white;border-radius:12px;display:none;height:20px;position:absolute;inset-inline-end:8px;width:20px;border:1px solid #D1D1D1}:host(:hover) .icon,:host .icon-show{display:flex;justify-content:center}msn-topic-image{margin-block:8px;margin-inline-start:8px;margin-inline-end:10px}msn-topic-image::part(topic-image){background:white}svg{height:12px;top:-2px;width:12px}:host(.selected){background:linear-gradient(0deg,rgba(68,100,255,0.1),rgba(68,100,255,0.1)),rgba(255,255,255,0.94);outline:2px solid #4464FF}:host(.selected) .icon{background-color:#405CE8;color:white;display:flex;justify-content:center;align-items:center;border:none}:host(.selected) svg{height:12px;position:initial;fill:white;width:12px}.topic-name{font-weight:600;font-size:var(--type-ramp-base-font-size,14px);line-height:var(--type-ramp-base-line-height,20px);margin-inline-end:32px;display:-webkit-box;overflow:hidden;user-select:none;-webkit-line-clamp:2;-webkit-box-orient:vertical}.${fs}{display:flex;align-items:center}${vs}
${ys} @media (-ms-high-contrast:active){:host(.selected){outline:2px solid buttontext !important}:host(:hover){outline:2px solid fieldtext !important}}`.withBehaviors((0,hr.Uu)(Ss)),Ts=d.dy`<div class="local-badge">${d.dy.partial(ds())}<span class="local-text">${e=>e.localBadgeLabel}</span></div>`,ks=d.dy`<span class="icon ${e=>e.consistentlyShowIcon?"icon-show":""}" data-label="${e=>e.followButtonLabel}">${e=>e.topic.selected?d.dy`${d.dy.partial(ls())}`:d.dy`${d.dy.partial(ss())}`}</span>`,Is=d.dy`<div class="${fs}" role="button" title="${e=>e.topicFollowTooltip}" aria-label="${e=>e.topicFollowTooltip}" data-t="${e=>e.followButtonTelemetryTag}" @click=${(e,t)=>e.onFollowClick(t.event)} @keypress="${(e,t)=>e.handleFollowButtonKeyPress(t.event)}">${e=>ks}</div>`,Ps=d.dy`<template tabindex="0" role="button" title="${e=>e.topicTooltip}" aria-label="${e=>e.topicTooltip}" aria-pressed="${e=>!!e.topic.selected&&!e.enableChannelLink}" ?data-customhandled="${e=>e.enableChannelLink||e.telemetryCustomHandled}" data-t="${e=>e.topicTelemetryTag}" class="${e=>(0,ps.A)("topic-card",["selected",e.topic.selected],["prong2-design",e.enableProng2Design],["square-design",e.enableSquareDesign],["is-local",e.enableLocalBadge&&e.topic.isLocalContent],["is-channel-link",e.enableChannelLink])}" @click=${(e,t)=>e.onClickTopicCard(t.event)} @keypress="${(e,t)=>e.handleTopicKeyPress(t.event)}"><div class="container"><msn-topic-image :imageInfo=${e=>{var t,i;return Ur(40,e.topic.title,Array.isArray(null===(t=e.topic)||void 0===t?void 0:t.images)&&(null===(i=e.topic.images[0])||void 0===i?void 0:i.url)||e.defaultImageSrc)}} :rounded=${()=>!1}></msn-topic-image><div class="attribution"><span class="topic-name">${e=>e.topic.title}</span>${(0,g.g)((e=>e.enableLocalBadge&&e.topic.isLocalContent),Ts)}</div><slot name="icon">${e=>e.enableChannelLink?Is:ks}<slot></div></template>`;const $s=/[:/?#[\]@!$&'()*+,;=]/g;function Fs(e,t,i,n){let o=`${E.jG.NavTargetUrlWithLocale}/channel`;if(e&&i){const n="source"===i?"sr":"tp";o+="/"+[i,t?encodeURIComponent(t.replace($s,"")):"",`${n}-${e}`].filter((e=>e)).join("/")}const r=new URL(o);return n||(r.search=(0,le.zp)()),(0,le.zw)().includes("localhost.msn.com")&&(r.host=(0,le.zw)()),r.toString()}class Ls extends Rr.H{constructor(){super(...arguments),this.defaultImageSrc="",this.consistentlyShowIcon=!1,this.selectButtonTooltip="{0}",this.selectedButtonTooltip="{0}",this.selectTelemetryTag="",this.unselectTelemetryTag="",this.enableProng2Design=!1,this.enableSquareDesign=!1,this.enableChannelLink=!1,this.enableLocalBadge=!1,this.telemetryCustomHandled=!1,this.onChannelLinkClick=e=>{var t;const i=(null===(t=this.topic.provider)||void 0===t?void 0:t.profileId)||this.topic.id,n=i===this.topic.id?"topic":"source",o=function(e,t){if(!t||!e)return e;const i=new URLSearchParams(decodeURIComponent(t)).getAll("item");if(!i||!i.length)return e;const n=new URL(e);return i.forEach((e=>{const t=n.search?"&":"?";-1===n.search.indexOf(e)&&(n.search+=`${t}item=${e}`)})),n.toString()}(Fs(i,this.topic.title,n,!0),(0,le.zp)());_.M0.sendActionEvent(e,It.Aw.Click,It.wu.Navigate,o),window.open(o,"_blank")}}get topicFollowTooltip(){const e=this.topic.selected?this.selectedButtonTooltip:this.selectButtonTooltip;return e?(0,mo.WU)(e,this.topic.title):""}get topicTooltip(){return this.enableChannelLink?this.topic.title:this.topicFollowTooltip}get followButtonTelemetryTag(){return this.topic.selected?this.unselectTelemetryTag:this.selectTelemetryTag}get topicTelemetryTag(){var e;return this.enableChannelLink?(e=this.topic,new er.D({name:e.title,action:It.Aw.Click,behavior:It.wu.Navigate,content:{id:e.id,isLocal:e.isLocalContent}})).getMetadataTag():this.followButtonTelemetryTag}get followButtonLabel(){const e=this.followButtonStrings||{};return this.topic.selected?e.unfollow:e.follow}onClickTopicCard(e){e.composedPath().some((e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains(fs)}))||(this.enableChannelLink?this.onChannelLinkClick(e.currentTarget):this.onFollowClick())}onFollowClick(e){this.$emit("click-fre-topic-card")}handleTopicKeyPress(e){e&&"Enter"===e.key&&this.onClickTopicCard(e)}handleFollowButtonKeyPress(e){e&&"Enter"===e.key&&this.onFollowClick(e)}}(0,s.gn)([Ht.LO],Ls.prototype,"topic",void 0),(0,s.gn)([Ht.LO],Ls.prototype,"defaultImageSrc",void 0),(0,s.gn)([Ht.LO],Ls.prototype,"consistentlyShowIcon",void 0),(0,s.gn)([Ht.LO],Ls.prototype,"followButtonStrings",void 0),(0,s.gn)([Ht.LO],Ls.prototype,"localBadgeLabel",void 0),(0,s.gn)([(0,a.Lj)({attribute:"select-button-tooltip"})],Ls.prototype,"selectButtonTooltip",void 0),(0,s.gn)([(0,a.Lj)({attribute:"selected-button-tooltip"})],Ls.prototype,"selectedButtonTooltip",void 0),(0,s.gn)([(0,a.Lj)({attribute:"select-telemetry-tag"})],Ls.prototype,"selectTelemetryTag",void 0),(0,s.gn)([(0,a.Lj)({attribute:"unselect-telemetry-tag"})],Ls.prototype,"unselectTelemetryTag",void 0),(0,s.gn)([(0,a.Lj)({attribute:"enable-prong2-design",mode:"boolean"})],Ls.prototype,"enableProng2Design",void 0),(0,s.gn)([(0,a.Lj)({attribute:"enable-square-design",mode:"boolean"})],Ls.prototype,"enableSquareDesign",void 0),(0,s.gn)([(0,a.Lj)({attribute:"enable-channel-link",mode:"boolean"})],Ls.prototype,"enableChannelLink",void 0),(0,s.gn)([(0,a.Lj)({attribute:"enable-local-badge",mode:"boolean"})],Ls.prototype,"enableLocalBadge",void 0),(0,s.gn)([(0,a.Lj)({attribute:"telemetry-custom-handled",mode:"boolean"})],Ls.prototype,"telemetryCustomHandled",void 0),(0,s.gn)([Ht.lk],Ls.prototype,"topicFollowTooltip",null),(0,s.gn)([Ht.lk],Ls.prototype,"topicTooltip",null),(0,s.gn)([Ht.lk],Ls.prototype,"followButtonTelemetryTag",null),(0,s.gn)([Ht.lk],Ls.prototype,"topicTelemetryTag",null),(0,s.gn)([Ht.lk],Ls.prototype,"followButtonLabel",null);let Es=class extends Ls{};Es=(0,s.gn)([(0,Rr.M)({name:"msn-fre-topic-card",template:Ps,styles:xs})],Es);var Rs=i(53095),As=i.n(Rs),Os=i(4310),Ms=i.n(Os),Us=i(74449);const Ds=S.i`
.prong2-design .chevron-right-icon{fill:#FFFFFF}.prong2-design .sports-recommendation-header .sports-recommendation-title{color:#FFFFFF}.prong2-design .sports-recommendation-header .sports-recommendation-subtitle{color:rgba(255,255,255,0.79)}`,Ns=S.i`
${Ds}
`,Hs=S.i`
.prong2-design msn-fre-topic-card{width:176px}.prong2-design.sports-recommendation-content .vertical-topic{gap:8px}`,_s=S.i`
${Hs} .table-column{display:inline-flex;flex-direction:column;gap:8px;margin-right:4px;padding:2px}.topic-list{position:relative;margin-top:0px;margin-bottom:16px;margin-inline-end:10px}.animation-fade{animation-name:fade;animation-duration:.8s;animation-timing-function:linear}@keyframes fade{0%{opacity:0}100%{opacity:1}}.vertical-topic{width:auto}msn-fre-topic-card{width:188px}.sports-recommendation-content .vertical-topic{display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}.sports-recommendation-header{display:flex;flex-direction:column;margin-bottom:8px}.sports-recommendation-header .sports-recommendation-title{color:${dr.C};display:flex;font-weight:400;font-size:16px;line-height:22px}.sports-recommendation-title .chevron-right-icon{padding:0px 7.5px;vertical-align:text-top}.sports-recommendation-title .title-text-clickable{cursor:pointer}.sports-recommendation-title .title-text-focus{font-weight:600}.sports-recommendation-header .sports-recommendation-subtitle{color:${Us.Q};font-weight:400;font-size:12px;line-height:16px;margin:2px 0}.sports-recommendation-content .chevron-right-icon{align-items:center;display:flex;fill:${dr.C}}.sports-recommendation-content .sports-icon{position:absolute;inset-inline-end:8px}`.withBehaviors((0,hr.Uu)(Ns));var js;!function(e){e[e.landings=0]="landings",e[e.league=1]="league",e[e.team=2]="team"}(js||(js={}));var Bs=i(42251),zs=i.n(Bs);const qs=d.dy`
<div id="empty-search-text" role="alert">${e=>e.localizedStrings&&e.localizedStrings.searchEmptyResultsText}</div>
`,Gs=d.dy`
<span class="icon icon-show sports-icon chevron-right-icon" slot="icon">${e=>d.dy`${d.dy.partial(zs())}`}</span>
`,Ws=d.dy`
<span class="icon chevron-right-icon">${e=>d.dy`${d.dy.partial(zs())}`}</span>
<span class="title-text-focus">
${e=>{var t;return null===(t=e.currentLeague)||void 0===t?void 0:t.title}}
</span>`,Vs=d.dy`<div class="sports-recommendation-subtitle">${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.sportsSectionInstructions}}</div>`,Ks=d.dy`
<msn-fre-topic-card
:topic=${e=>e}
:consistentlyShowIcon=${(e,t)=>0==t.parent.enableSubSportsEntities(e)}
enable-prong2-design=${(e,t)=>t.parent.enableProng2Design}
select-telemetry-tag=${(e,t)=>t.parent.telemetryConstants&&t.parent.telemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!1).getMetadataTag()}
unselect-telemetry-tag=${(e,t)=>t.parent.telemetryConstants&&t.parent.telemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!0).getMetadataTag()}
@click-fre-topic-card=${(e,t)=>t.parent.onClickSportsCard(e,t.event)}>
${(0,g.g)(((e,t)=>t.parent.enableSubSportsEntities(e)),Gs)}
</msn-fre-topic-card>
`,Qs=d.dy`
<div class="table-column animation-fade vertical-topic">
${(0,Er.rx)((e=>e.entityList),Ks)}
</div>
`,Js=d.dy`
<div class="topic-list sports-recommendation-content ${e=>e.enableProng2Design?"prong2-design":""}">
<div class="sports-recommendation-header">
<div class="sports-recommendation-title">
<span
@click=${e=>e.resetData()}
class="${e=>e.currentPageType==js.landings?"title-text-focus":"title-text-clickable"}">
${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.sportsPopularLeagueHeader}}
</span>
${(0,g.g)((e=>e.currentPageType==js.league&&null!=e.currentLeague),Ws)}
</div>
${(0,g.g)((e=>e.currentPageType==js.landings),Vs)}
</div>
${(0,g.g)((e=>{var t;return(null===(t=e.entityList)||void 0===t?void 0:t.length)>0}),Qs)}
${(0,g.g)((e=>e.isExperienceLoaded&&(!e.entityList||0==e.entityList.length)),qs)}
</div>`;class Zs extends Rr.H{connectedCallback(){super.connectedCallback(),this.initialOnService()}constructor(){super(),this.enableProng2Design=!1,this.entityList=[],this.currentPageType=js.landings,this.followedTopicIds=[],this.isExperienceLoaded=!1,this.onClickSportsCard=async e=>{if(e)return this.enableSubSportsEntities(e)?await this.updateLeagueTeams(e):await this.handleInterestMangement(e)},this.updateLeagueTeams=async e=>{this.loadingStart(),this.entityList=[],e&&e.sportwithLeagueName?(this.currentLeague=e,this.currentPageType=js.league,await this.getSportsRecommendations(e.sportwithLeagueName)):this.loadingComplete()},this.getSportsRecommendations=async e=>{const t=this.getSportsRecommendation&&await this.getSportsRecommendation(e);if(!t||!t.length)return void this.loadingComplete();const i=t.map((e=>({id:e.yId,title:e.displayName,type:e.type,sportwithLeagueName:e.sportwithLeagueName,images:[{url:e.imageUrl||""}],selected:!1})));if(!this.currentLeague||this.currentPageType==js.landings)return this.entityList=i,void this.loadingComplete();const n=this.sortEntityList(i);this.currentLeague.selected=this.followedTopicIds.findIndex((e=>{var t;return e==(null===(t=this.currentLeague)||void 0===t?void 0:t.id)}))>=0,this.entityList=[this.currentLeague,...n],this.loadingComplete()},this.handleInterestMangement=async e=>{if(!(this.followSportsCallback&&await this.followSportsCallback(e)))return;const t=e.selected??!1,i=this.entityList.find((t=>t.id==e.id));i&&(i.selected=!t,this.entityList=(0,or.Z)(this.entityList));const n=this.followedTopicIds.findIndex((e=>e==i.id));n>=0?this.followedTopicIds.splice(n,1):this.followedTopicIds=[i.id,...this.followedTopicIds],this.followedTopicIds=(0,or.Z)(this.followedTopicIds)}}async initialOnService(){this.telemetryConstants&&await this.resetData()}loadingComplete(){this.isExperienceLoaded=!0}loadingStart(){this.isExperienceLoaded=!1}enableSubSportsEntities(e){return e?this.currentPageType==js.landings&&"League"==e.type:null!=this.currentLeague&&null!=this.currentLeague.title&&this.currentPageType==js.landings}async resetData(){this.loadingStart();try{this.currentPageType=js.landings,this.entityList=[],this.currentLeague=void 0,await this.getSportsRecommendations()}finally{this.loadingComplete()}}sortEntityList(e){if(!e||(null==e?void 0:e.length)<1)return[];const t=[],i=[];return e.forEach((e=>{this.followedTopicIds.findIndex((t=>t==e.id))>=0?(e.selected=!0,t.push(e)):i.push(e)})),t.sort(((e,t)=>this.compareFn(e,t))).concat(i.sort(((e,t)=>this.compareFn(e,t))))}compareFn(e,t){return null!=e&&e.title?null!=t&&t.title?e.title<t.title?-1:e.title>t.title?1:0:-1:null!=t&&t.title?1:0}}(0,s.gn)([(0,a.Lj)({attribute:"enable-prong2-design",mode:"boolean"})],Zs.prototype,"enableProng2Design",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"telemetryConstants",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"localizedStrings",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"config",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"entityList",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"currentPageType",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"currentLeague",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"followedTopicIds",void 0),(0,s.gn)([Ht.LO],Zs.prototype,"isExperienceLoaded",void 0);let Xs=class extends Zs{};Xs=(0,s.gn)([(0,Rr.M)({name:"sports-recommendation",template:Js,styles:_s,shadowOptions:{delegatesFocus:!0}})],Xs);const Ys=d.dy`<div class="fliper">${d.dy.partial(As())}</div>`;function ea(e){return d.dy`<div class="left-fliper" @click="${(t,i)=>t.onFlipperClick(i.event,e,!1)}" data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.PreviousSlideArrow("").getMetadataTag()}">${Ys}</div>`}function ta(e){return d.dy`<div class="right-fliper" @click="${(t,i)=>t.onFlipperClick(i.event,e,!0)}" data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.NextSlideArrow("").getMetadataTag()}">${Ys}</div>`}function ia(e){var t,i;return{follow:null===(t=e.strings)||void 0===t?void 0:t.unfollowedButtonText,unfollow:null===(i=e.strings)||void 0===i?void 0:i.followedButtonText}}const na=d.dy`<msn-fre-topic-card :topic=${e=>e} :consistentlyShowIcon=${e=>!0} :followButtonStrings=${(e,t)=>ia(t.parentContext.parent)} :localBadgeLabel=${(e,t)=>t.parentContext.parent.strings.localBadgeLabel} enable-channel-link=${(e,t)=>t.parentContext.parent.config.enableGoToChannel} enable-local-badge=${(e,t)=>t.parentContext.parent.config.enableLocalBadge} enable-square-design=${(e,t)=>t.parentContext.parent.config.enableSquareDesign} enable-prong2-design=${(e,t)=>t.parentContext.parent.config.enableProng2Design} select-button-tooltip=${(e,t)=>t.parentContext.parent.strings&&t.parentContext.parent.strings.followButtonTooltip} selected-button-tooltip=${(e,t)=>t.parentContext.parent.strings&&t.parentContext.parent.strings.unfollowButtonTooltip} select-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!1).getMetadataTag()} unselect-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!0).getMetadataTag()} @click-fre-topic-card=${(e,t)=>t.parentContext.parent.onClickTopicCard(e,t.event)}></msn-fre-topic-card>`,oa=d.dy`<div class="table-column animation-fade vertical-topic">${(0,Er.rx)((e=>e||[]),na)}</div>`,ra=d.dy` ${(0,Er.rx)((e=>e.topicsTable||[]),oa)}
`,sa=d.dy`<msn-fre-topic-card :topic=${e=>e} :consistentlyShowIcon=${e=>!0} :followButtonStrings=${(e,t)=>ia(t.parentContext.parent)} :localBadgeLabel=${(e,t)=>t.parentContext.parent.strings.localBadgeLabel} enable-channel-link=${(e,t)=>t.parentContext.parent.config.enableGoToChannel} enable-local-badge=${(e,t)=>t.parentContext.parent.config.enableLocalBadge} enable-square-design=${(e,t)=>t.parentContext.parent.config.enableSquareDesign} enable-prong2-design=${(e,t)=>t.parentContext.parent.config.enableProng2Design} select-button-tooltip=${(e,t)=>t.parentContext.parent.strings&&t.parentContext.parent.strings.followButtonTooltip} selected-button-tooltip=${(e,t)=>t.parentContext.parent.strings&&t.parentContext.parent.strings.unfollowButtonTooltip} select-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Publisher",e.id,e.title,!1,e.isLocalContent).getMetadataTag()} unselect-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Publisher",e.id,e.title,!0,e.isLocalContent).getMetadataTag()} @click-fre-topic-card=${(e,t)=>t.parentContext.parent.onClickPublisherCard(e,t.event)}></msn-fre-topic-card>`,aa=d.dy`<div class="table-column animation-fade vertical-topic">${(0,Er.rx)((e=>e||[]),sa)}</div>`,la=d.dy` ${(0,Er.rx)((e=>e.publishersTable||[]),aa)}
`,ca=d.dy` ${la}
`,da=d.dy` ${ra}
`,pa=d.dy`<div class="vertical-button-group"><div class="vertical-button ${e=>e.currentVertical===Dt.Recommended?"selected":""}" @click=${(e,t)=>e.onVerticalButtonClick(Dt.Recommended)}>${e=>e.strings&&e.strings.recommendedButton}</div><div class="vertical-button ${e=>e.currentVertical===Dt.Sports?"selected":""}" @click=${(e,t)=>e.onVerticalButtonClick(Dt.Sports)}>${e=>e.strings&&e.strings.sportsButton}</div></div>`,ua=d.dy`<div role="tab" aria-selected="${(e,t)=>e===t.parent.currentPublisherPage}" tabindex="0" class="tab-no-click tab " @click=${(e,t)=>t.parent.onNavigationTabClick(!0,e)}><div part="dot" class="dot-no-click dot"></div></div>`,ha=d.dy`<div class="navigation"><div class="tablist" part="tablist" role="tablist">${(0,Er.rx)((e=>e.publisher_list_index_arr||[]),ua)}</div></div>`,ga=d.dy`<div class="topic-list"><msft-stripe role="group" tabindex="0" aria-label="${e=>{var t,i;return e.showFooter?null===(t=e.strings)||void 0===t?void 0:t.publishersSubheader:null===(i=e.strings)||void 0===i?void 0:i.searchResultsPublishersHeader}}" speed="3600" part="msft-stripe" class="${e=>e.publisher_list_class}" ${(0,p.i)("ref_publisher_list")}><div slot="heading"><div class="title">${e=>{var t,i;return e.showFooter?null===(t=e.strings)||void 0===t?void 0:t.publishersSubheader:null===(i=e.strings)||void 0===i?void 0:i.searchResultsPublishersHeader}}</div></div><div slot="previous-flipper">${ea(!0)}</div><div slot="next-flipper">${ta(!0)}</div>${ca}</msft-stripe>${(0,g.g)((e=>e.showFooter),ha)}</div>`,fa=d.dy`<msn-fre-topic-card :topic=${e=>e} :consistentlyShowIcon=${e=>!0} enable-prong2-design=${(e,t)=>t.parentContext.parent.config.enableProng2Design} select-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!1).getMetadataTag()} unselect-telemetry-tag=${(e,t)=>t.parentContext.parent.TelemetryConstants&&t.parentContext.parent.TelemetryConstants.RecommendedFollowUnFollow("Topic",e.id,e.title,!0).getMetadataTag()} @click-fre-topic-card=${(e,t)=>t.parentContext.parent.onClickSportsCard(e,t.event)}></msn-fre-topic-card>`,va=d.dy`<div class="table-column animation-fade vertical-topic">${(0,Er.rx)((e=>e||[]),fa)}</div>`,ma=d.dy` ${(0,Er.rx)((e=>e.sportsTable||[]),va)}
`,ya=d.dy` ${ma}
`,ba=d.dy`<div class="topic-list"><msft-stripe aria-label="${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.searchResultsSportsHeader}}" tabindex="0" role="group" speed="3600" part="msft-stripe" class="${e=>e.publisher_list_class}" ${(0,p.i)("ref_publisher_list")}><div slot="heading"><div class="title">${e=>{var t;return(null===(t=e.strings)||void 0===t?void 0:t.searchResultsSportsHeader)??"sports"}}</div></div><div slot="previous-flipper">${ea(!0)}</div><div slot="next-flipper">${ta(!0)}</div>${ya}</msft-stripe></div>`,wa=d.dy`<div role="tab" aria-selected="${(e,t)=>e===t.parent.currentTopicPage}" tabindex="0" class="tab-no-click tab " @click=${(e,t)=>t.parent.onNavigationTabClick(!1,e)}><div part="dot" class="dot-no-click dot"></div></div>`,Sa=d.dy`<div class="navigation"><div class="tablist" part="tablist" role="tablist">${(0,Er.rx)((e=>e.topic_list_index_arr||[]),wa)}</div></div>`,Ca=d.dy`<div class="topic-list"><msft-stripe aria-label="${e=>{var t,i;return e.showFooter?null===(t=e.strings)||void 0===t?void 0:t.topicsSubheader:null===(i=e.strings)||void 0===i?void 0:i.searchResultsTopicsHeader}}" tabindex="0" role="group" speed="3600" part="msft-stripe" class="${e=>e.topic_list_class}" ${(0,p.i)("ref_topic_list")}><div slot="heading"><div class="title">${e=>{var t,i;return e.showFooter?null===(t=e.strings)||void 0===t?void 0:t.topicsSubheader:null===(i=e.strings)||void 0===i?void 0:i.searchResultsTopicsHeader}}</div></div><div slot="previous-flipper">${ea(!1)}</div><div slot="next-flipper">${ta(!1)}</div>${da}</msft-stripe>${(0,g.g)((e=>e.showFooter),Sa)}</div>`,xa=d.dy`<div id="empty-search-text" role="alert">${e=>e.strings&&e.strings.searchEmptyResultsText}</div>`,Ta=d.dy`<div class="description footer">${e=>e.strings&&e.strings.discoverFooter.split("{0}")[0]}<span class="highlight" data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.search.getMetadataTag()}" @click=${(e,t)=>e.searchClick(t.event)} @keypress=${(e,t)=>e.searchClick(t.event)} tabindex="0" role="link" id="footer-search-link">${e=>e.strings&&e.strings.discoverFooterLink}</span>${e=>e.strings&&e.strings.discoverFooter.split("{0}")[1]}</div>`,ka=d.dy`<sports-recommendation :localizedStrings=${e=>e.strings} :config=${e=>e.config} :telemetryConstants=${e=>e.TelemetryConstants} :followSportsCallback=${e=>e.followSportsEntity} :getSportsRecommendation=${e=>e.getSportsRecommendation} :followedTopicIds=${e=>e.followedTopicIds} enable-prong2-design=${e=>e.config.enableProng2Design}></sports-recommendation>`,Ia=d.dy`
${(0,g.g)((e=>{var t;return(null===(t=e.publishersTable)||void 0===t?void 0:t.length)>0&&e.showPublishersTop}),ga)}
${(0,g.g)((e=>{var t;return(null===(t=e.topicsTable)||void 0===t?void 0:t.length)>0}),Ca)}
${(0,g.g)((e=>{var t;return(null===(t=e.publishersTable)||void 0===t?void 0:t.length)>0&&!e.showPublishersTop}),ga)}
${(0,g.g)((e=>{var t;return e.showBtnGroup&&(null===(t=e.sportsTable)||void 0===t?void 0:t.length)>0}),ba)}
${(0,g.g)((e=>e.noSearchResults),xa)}
${(0,g.g)((e=>e.showFooter),Ta)}
`;const Pa=d.dy`<div class="visually-hidden" aria-live="polite">${e=>e.searchResultAriaText}</div>`,$a=d.dy`<div class="title" tabindex="0">${e=>e.strings&&e.strings.discoverHeader}</div>`,Fa=d.dy`<span class="search-icon" slot="end">${d.dy.partial(Ms())}</span>`,La=d.dy`<div class="right-container"><div class="header">${(0,g.g)((e=>!e.config.enableProng2Design),$a)}<div class="description" tabindex="0">${e=>e.strings&&e.strings.discoverDescription.split("{0}")[0]}<span class="highlight" role="link" data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.followingFeed.getMetadataTag()}" @click=${(e,t)=>e.followingFeedClick(t.event)} @keypress=${(e,t)=>e.followingFeedClick(t.event)} tabindex="0">${e=>e.strings&&e.strings.discoverDescriptionLink}</span>${e=>e.strings&&e.strings.discoverDescription.split("{0}")[1]}</div></div><div class="search-box"><msft-search-box ${(0,p.i)("inputElement")} isOnImage="true" title="${e=>e.strings.searchBarText}" placeholder="${e=>e.strings&&e.strings.searchBarText}" clear-label="${e=>e.strings&&e.strings.clearButton}" clear-title="${e=>e.strings&&e.strings.clearButton}" aria-live="polite" @keypress=${(e,t)=>e.onKeypress(t.event)} @change=${e=>e.onChange()} @focus=${e=>e.searchBoxOnFocus()} @blur=${e=>e.searchBoxOnBlurs()} enableClearButton=${e=>!e.config.enableProng2Design} :clearButtonCallback=${e=>e.resetSearch.bind(e)} :clearButtonFocusCallback=${e=>e.clearBtnFocused.bind(e)} :clearButtonBlurCallback=${e=>e.clearBtnUnFocused.bind(e)} style="border-radius: ${e=>e.config.enableProng2Design?"4px":"30px"}; outline: ${e=>function(e){return!e.inputOnFocus||e.clearButtonOnFocus?"2px solid transparent":e.config.enableProng2Design?"2px solid var(--fill-color-accent-default, #005FB8)":"2px solid rgba(15, 108, 189, 1)"}(e)};" data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.search.getMetadataTag()}">${(0,g.g)((e=>e.config.enableProng2Design),Fa)}</msft-search-box></div>${(0,g.g)((e=>e.showBtnGroup&&e.showFooter&&!e.config.enableProng2Design),pa)} ${(0,g.g)((e=>e.resultCount>0),Pa)}<div class="interest-content discover" ${(0,p.i)("ref_interest_content")}>${(0,g.g)((e=>e.showBtnGroup&&e.showFooter&&e.config.enableProng2Design),pa)} ${(0,g.g)((e=>e.currentVertical===Dt.Recommended||!e.showFooter),Ia)} ${(0,g.g)((e=>e.currentVertical===Dt.Sports&&e.showFooter),ka)}</div></div>`;var Ea,Ra,Aa,Oa,Ma,Ua,Da,Na,Ha,_a=i(79403),ja=i(54655),Ba=i(20782),za=i(32236);!function(e){e[e.Unknown=0]="Unknown",e[e.SignedIn=1]="SignedIn",e[e.SignedOut=2]="SignedOut"}(Ea||(Ea={})),function(e){e[e.none=0]="none",e[e.bgTask=1]="bgTask",e[e.badge=2]="badge",e[e.rotationalPreview=4]="rotationalPreview",e[e.expandedView=8]="expandedView",e[e.fullWv=16]="fullWv",e[e.reauthRequiredUser=32]="reauthRequiredUser",e[e.signedOutUser=64]="signedOutUser",e[e.unify1SCall=128]="unify1SCall",e[e.railModel=256]="railModel",e[e.prefetchFeedContent=512]="prefetchFeedContent",e[e.pinWidgetsFlyout=1024]="pinWidgetsFlyout",e[e.widgetPinning=2048]="widgetPinning",e[e.feedCustomization=4096]="feedCustomization",e[e.platformFeed=8192]="platformFeed",e[e.boards=16384]="boards",e[e.aepEvolvedNotifications=32768]="aepEvolvedNotifications",e[e.aepBadgeIdsPayload=65536]="aepBadgeIdsPayload"}(Ra||(Ra={})),function(e){e.modifyUrl="modifyUrl"}(Aa||(Aa={})),function(e){e[e.header=0]="header",e[e.content=1]="content",e[e.moreOptions=2]="moreOptions"}(Oa||(Oa={})),function(e){e[e.widgetPicker=0]="widgetPicker",e[e.profilePicture=1]="profilePicture",e[e.expanded=2]="expanded",e[e.collapsed=3]="collapsed",e[e.refresh=4]="refresh",e[e.home=5]="home",e[e.video=6]="video",e[e.shopping=7]="shopping",e[e.play=8]="play",e[e.event=9]="event",e[e.personalized=10]="personalized",e[e.pinDashboardToDesktop=11]="pinDashboardToDesktop",e[e.unpinDashboardToDesktop=12]="unpinDashboardToDesktop"}(Ma||(Ma={})),function(e){e[e.resize=0]="resize",e[e.customize=1]="customize",e[e.unpin=2]="unpin",e[e.hide=3]="hide",e[e.pin=4]="pin",e[e.other=5]="other"}(Ua||(Ua={})),function(e){e[e.signIn=0]="signIn",e[e.signOut=1]="signOut",e[e.search=2]="search",e[e.follow=3]="follow",e[e.unfollow=4]="unfollow",e[e.viewProfile=5]="viewProfile",e[e.block=6]="block",e[e.unblock=7]="unblock"}(Da||(Da={})),function(e){e[e.BoardScrolled=0]="BoardScrolled",e[e.NavBarCLicked=1]="NavBarCLicked",e[e.BoardButtonClicked=2]="BoardButtonClicked",e[e.SettingsButtonClicked=3]="SettingsButtonClicked",e[e.DashboardShown=4]="DashboardShown",e[e.DashboardHidden=5]="DashboardHidden",e[e.BoardContentViewed=6]="BoardContentViewed",e[e.StartPersonalizationPageInteracted=7]="StartPersonalizationPageInteracted"}(Na||(Na={})),function(e){e[e.Failed=0]="Failed",e[e.Succeed=1]="Succeed",e[e.Running=2]="Running"}(Ha||(Ha={}));var qa;!function(e){e[e.ProfileClicked=0]="ProfileClicked",e[e.AddButtonClicked=1]="AddButtonClicked"}(qa||(qa={}));const Ga=(0,za.p)((()=>document.getElementById("widgetGroup-testpage")&&("winWidgets"===E.jG.AppType||"windowsNewsPlus"===E.jG.AppType)));var Wa,Va,Ka,Qa;!function(e){e[e.none=0]="none",e[e.productAndServicePerformance=16777216]="productAndServicePerformance"}(Wa||(Wa={})),function(e){e[e.Alert=0]="Alert",e[e.NoAlert=1]="NoAlert",e[e.HighImpact=2]="HighImpact",e[e.Critical=3]="Critical"}(Va||(Va={})),function(e){e.RailModel="1.0",e.Boards="2.0"}(Ka||(Ka={})),function(e){e.Pinned="pinned",e.Muted="Muted"}(Qa||(Qa={}));var Ja=i(61494),Za=i(11591);let Xa=window.__com_microsoft_dsh_widgetModelApiFactory,Ya=Xa&&Xa.tryGetApi("velocity",1,1);const el=Xa&&Xa.tryGetApi("widgetuserinfo",1,1);let tl,il=1;const nl="com.msn.desktopfeed",ol=(0,za.p)((async()=>{const e=cl();if(e)return await e.getDefaultAccountIdAsync()})),rl=(0,za.p)((async()=>{const e=cl();if(e)return await e.getSignedInAccount(nl)})),sl={clientId:"00000000400F9D16",scope:"service::www.msn.com::MBI_SSL",resource:"https://www.api.msn.com/"},al={clientId:"3a4d129e-7f50-4e0d-a7fd-033add0a29f4",scope:"User.Read Userinfo.ReadWrite",resource:"https://enterprisenews.microsoft.com/"};async function ll(e,t,i){try{if(!t)throw Error("Property is null");if(!e)throw Error("IAuthenticator is null");const i=(0,Za.Yb)(`GetProperty_${il}`),n=5===il?await rl():await ol(),o=await e.getAccountPropertyAsync(n,t);return i(),o}catch(e){return pl(e,i),null}}function cl(){if(tl)return tl;const e=ul("Feature_AuthApiV5"),t=ul("Feature_MultiAccount");return e||t?(Xa||(Xa=window.__com_microsoft_dsh_widgetModelApiFactory),il=e?5:1,tl=null==Xa?void 0:Xa.tryGetApi("authenticator",il,il),tl):void 0}const dl=(0,za.p)((async()=>{const e=ul("Feature_AuthApiV5"),t=ul("Feature_SignedOutUser");if(!e&&!t)return!1;try{const e=cl();if(!e)return!1;if(5!==il){return!await e.isUserSignedInAsync()}{const t=await e.getSignInType(nl);if(0===t){const t=await hl(e,nl);if(null==t?void 0:t.interactionRequired)return!0}else if(1===t){if(!await rl())return!0;const t=await hl(e,nl);if(null==t?void 0:t.interactionRequired)return!0}}}catch(e){pl(e,O.fCp)}return!1}));function pl(e,t){t?_.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e.message,authVersion:il})})):Ri.k.logError(e.message)}function ul(e){var t;return Ya||(Ya=null===(t=window.__com_microsoft_dsh_widgetModelApiFactory)||void 0===t?void 0:t.tryGetApi("velocity",1,1)),!(!Ya||!Ya.isFeatureEnabled(e))}async function hl(e,t){const[i,n]=await Promise.all([ll(e,"ProviderAuthority"),rl()]),o="consumers"===i;if(o||"organizations"===i){return await e.getAccountTokenAsync(n,o?sl.clientId:al.clientId,o?sl.scope:al.scope,o?sl.resource:al.resource,"",t)}return null}Object.freeze({AddWidgets:"AddWidgets",BingAppIcon:"BingAppIcon",BingNotificationIcon:"BingNotificationIcon",Collapse:"Collapse",Event:"Event",Expand:"Expand",Feedback:"Feedback",Home:"Home",Personalized:"Personalized",PinDashboardToDesktop:"PinDashboardToDesktop",Play:"Play",Profile:"Settings",Refresh:"Refresh",Shopping:"Shopping",UnpinDashboardToDesktop:"UnpinDashboardToDesktop",Video:"Video",EventToggle:"EventToggle"}),Object.freeze({SignIn:"SignInFeedPersonalization",SignOut:"SignOutFeedPersonalization",Search:"interestSearch",Follow:/^(.+)_follow$/i,Unfollow:/^(.+)_unfollow$/i,ViewProfile:"ViewProfile",Block:/^(.+)_block$/i,UnBlock:/^(.+)_unblock$/i});const gl=(0,N.Ou)();let fl,vl;const ml=()=>{var e,t;return fl||(fl=null===(t=null===(e=null===E.jG||void 0===E.jG?void 0:E.jG.WidgetAttributes)||void 0===e?void 0:e.propertyBag)||void 0===t?void 0:t.widgetInstance),fl},yl=1;let bl;async function wl(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=ml(),r=Object.assign(Object.assign({},O.Rln),{message:"Exception calling GetToken",pb:Object.assign(Object.assign({},O.Rln.pb),{widgetId:o&&o.widgetId,widgetInstanceId:o&&o.instanceId,widgetState:o&&o.widgetState})});try{const s=cl();if(s)return await async function(e,t,i,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;try{if(!e)throw Error("IAuthenticator is null");if(await dl())return null;const s=(0,Za.Yb)(`GetToken_${il}`),a=5===il?await rl():await ol(),l=await e.getAccountTokenAsync(a,t,i,n,o,r||nl);return s(),l}catch(e){return pl(e,s),null}}(s,e,t,i,n,o&&o.widgetId,r);if(!o)throw Error("Widget instance is null");const a=xl("GetToken"),l=o.tryGetApi("authenticator",yl,yl),c=await l.getToken(e,t,i,n);return a(),{token:c,errorResult:0,interactionRequired:!1}}catch(e){return Ga()||_.M0.sendAppErrorEvent(Object.assign(Object.assign({},r),{pb:Object.assign(Object.assign({},r.pb),{error:e})})),null}}async function Sl(e){const t=ml(),i=Object.assign(Object.assign({},O.Rln),{message:`Exception calling getProperty api for property: ${e}`,pb:Object.assign(Object.assign({},O.Rln.pb),{widgetId:t&&t.widgetId,widgetInstanceId:t&&t.instanceId,widgetState:t&&t.widgetState,property:`property: ${e}`})});try{const n=cl();if(n)return await ll(n,e,i);if(!t)throw Error("Widget instance is null");if(!e)throw Error("Property is null");const o=t.tryGetApi("authenticator",yl,yl);return await o.getProperty(e)}catch(e){return Ga()||_.M0.sendAppErrorEvent(Object.assign(Object.assign({},i),{pb:Object.assign(Object.assign({},i.pb),{error:e})})),null}}function Cl(e,t){const i=new URLSearchParams(window.location.href),n=i&&i.get("aver"),o="00000000000000000000000000000000";e===o&&n<"423.11600.0.9"||e&&e!==o||function(e,t,i,n,o){_.M0.sendAppErrorEvent(Object.assign(Object.assign({},e),{message:o,pb:Object.assign(Object.assign({},e.pb),{MUIDorCookie:t,appVersion:i,muidValue:n})}))}(e?O.oq6:O.dTs,t,n,e,`muid ${e?"equals "+o:"is empty"} `)}const xl=e=>(0,_a.FF)(`WidgetApi.${e}`,{logDuration:!0,firstTimeOnly:!0});window.createWindowsWidget1SAuthHeaders=async function(){var e;const t={},i=ml();if(!i)return Ga()||"sidebar"===(null===(e=E.jG.CurrentRequestTargetScope)||void 0===e?void 0:e.pageType)||_.M0.sendAppErrorEvent(Object.assign(Object.assign({},O.Zj1),{message:"Failed to retrieve user auth token and MUID from WDX client due to undefined widget instance",pb:Object.assign(Object.assign({},O.Zj1.pb),{windowsSessionId:on.gL.get(on.Iq.SessionId)})})),t;const n=Math.round(performance.now()),o=await async function(){if(vl&&(0,Ja.Nv)("prg-pr2-cache-acttype"))return vl;const e=ml(),t=Object.assign(Object.assign({},O.Rln),{message:"Exception fetching ProviderAuthority",pb:Object.assign(Object.assign({},O.Rln.pb),{widgetId:e&&e.widgetId,widgetInstanceId:e&&e.instanceId,widgetState:e&&e.widgetState})});try{const i=cl();if(i){if(await dl())return null;const e=await ll(i,"ProviderAuthority",t);return vl=e,e}if(!e)throw Error("Widget instance is null");const n=xl("GetAccountType"),o=e.tryGetApi("authenticator",yl,yl),r=await o.getProperty("ProviderAuthority");return vl=r,n(),r}catch(e){return Ga()||_.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e})})),null}}(),r="organizations"===o,s="consumers"===o;if(s||r){const e=await wl(r?al.clientId:sl.clientId,r?al.scope:sl.scope,r?al.resource:sl.resource),n=e&&e.token;if(n)r?t[Ae.Yu.entAuthorization]=n:s&&(t[Ae.Yu.rpsToken]=n);else{!await async function(){if(!ul("Feature_ReauthRequiredUser"))return!1;try{const e=cl();return!!e&&await e.getReauthRequiredStatusAsync()}catch(e){pl(e,O.u4l)}return!1}()&&on.gL.get(on.Iq.IsDashboardVisible)&&s&&_.M0.sendAppErrorEvent(Object.assign(Object.assign({},O.ZSB),{message:"WDX Client failed to return user auth token",pb:Object.assign(Object.assign({},O.ZSB.pb),{widgetId:i.widgetId,widgetInstanceId:i.instanceId,windowsSessionId:on.gL.get(on.Iq.SessionId),widgetState:i.widgetState,isMsaUser:s,isBackgroundRefresh:!on.gL.get(on.Iq.IsDashboardVisible)})}))}}bl||(bl=await async function(){const e=xl("GetMuid"),t=await Sl("MUID");return e(),Cl(t,"MUIDFromWidgetInstance"),t}());const a=(0,Oi.jG)();return bl?(t[Ae.Yu.muid]=bl,bl!==a&&(_.M0.sendAppErrorEvent(Object.assign(Object.assign({},O.fV1),{message:"Cookie muid and windows muid desync detected",pb:Object.assign(Object.assign({},O.fV1.pb),{muidCookie:a,windowsMuid:bl})})),function(e){var t;const i=E.jG.IsChinaCompliance||"zh-cn"===(null===(t=null===ie.Al||void 0===ie.Al?void 0:ie.Al.Locale)||void 0===t?void 0:t.toLowerCase());e&&(0,Oi.sq)(ja.pA,e,365,i?".msn.cn":".msn.com","/",!0,Ba.f.None)}(bl))):a&&(t[Ae.Yu.muid]=a,Cl(a,"muidCookie")),gl.Prepare1SHeader=Math.round(performance.now())-n,t};class Tl extends Rr.H{constructor(){var e;super(),this.enableFeedCustomization=!1,this.onChannelStore=!1,this.widgetModelApi=window.__com_microsoft_dsh_widgetModelApiFactory,this.widgetUserInfoApi=null===(e=this.widgetModelApi)||void 0===e?void 0:e.tryGetApi("widgetuserinfo",yl,yl),this.enableFeedCustomization&&this.setupAccountOptions()}connectedCallback(){super.connectedCallback(),this.setupAccountOptions()}async setupAccountOptions(){const e=new er.D({name:"SignInFeedPersonalization",action:It.Aw.Click,behavior:It.wu.SignIn,type:It.c9.ActionButton,content:{type:It.uH.Settings,headline:"SignInFeedPersonalization"}}).getMetadataTag(),t=new er.D({name:"SignOutFeedPersonalization",action:It.Aw.Click,behavior:It.wu.SignOut,type:It.c9.ActionButton,content:{type:It.uH.Settings,headline:"SignOutFeedPersonalization"}}).getMetadataTag(),i=await this.setSignInState();this.accountSettingsOptions={userAvatar:i?await this.getUserAvatar():void 0,accountName:i?await Sl("UserName"):"",isUserSignedIn:i,telemetry:{signInTelemetry:e,signOutTelemetry:t}}}async setSignInState(){if(this.enableFeedCustomization)try{return!await dl()}catch(e){(0,A.OO)(e,O.fCp,"Exception fetching isUserSignedInAsync from WidgetsSettings",e&&e.message)}}async getUserAvatar(){if(this.enableFeedCustomization)if(this.widgetUserInfoApi)try{return await async function(){try{let e;if(il<5)e=(await el.getUserInfo()).userProfileImage;else{const t=cl(),i=await rl();e=await t.getAccountPictureAsync(i)}return e?`data:image/png;base64,${e}`:void 0}catch(e){pl(e,O.$8R)}}()}catch(e){(0,A.OO)(e,O.K7e,"Failed to get user's image info from WDX",e.message)}else(0,A.H)(O.K7e,"Failed to get user widget user API")}async handleSignOut(){await async function(){try{const e=cl();if(il<5)return await e.setSignInStatus(2),void window.location.reload();await e.signOutAccount(nl)}catch(e){pl(e,O.DWx)}}()}async handleSignIn(){await async function(e){try{const t=cl();if(5===il){const i=await t.getSignInType(nl),n=e?`${nl}.banner`:nl;if(0===i)await hl(t,n),await t.signInUserAsync();else if(1===i){const e=await t.getAccountPickedTokenAsync(sl.clientId,al.clientId,sl.scope,al.scope,sl.resource,al.resource,"",n);e.token&&1!==e.errorResult&&await t.signInUserAsync()}}else await t.signInUserAsync()}catch(e){pl(e,O.BHd)}}(!0)}}(0,s.gn)([Ht.LO],Tl.prototype,"localizedStrings",void 0),(0,s.gn)([Ht.LO],Tl.prototype,"enableFeedCustomization",void 0),(0,s.gn)([Ht.LO],Tl.prototype,"accountSettingsOptions",void 0),(0,s.gn)([Ht.LO],Tl.prototype,"backgroundColor",void 0),(0,s.gn)([Ht.LO],Tl.prototype,"baseLayerLuminance",void 0),(0,s.gn)([(0,a.Lj)({attribute:"on-channel-store",mode:"boolean"})],Tl.prototype,"onChannelStore",void 0);var kl=i(79896);var Il=i(46179),Pl=i(17993),$l=i(958);const Fl=S.i`
.content{display:grid;grid-template-rows:auto auto;width:max-content;margin:12px 0px;font-weight:400}fluent-button{background:transparent}fluent-button::part(control){padding:0px}fluent-design-system-provider{display:inherit}#accountContainer{display:flex;padding:10px 16px;align-items:center;background:rgba(255,255,255);border:1px solid rgba(0,0,0,0.0578);border-radius:7px;--elevation:4}#accountTitle{font-size:14px;line-height:20px;display:flex;align-items:center;color:rgba(0,0,0,0.8956)}.account-button{width:120px;height:32px;background:rgba(255,255,255);border:1px solid rgba(0,0,0,0.0578);border-radius:4px;--elevation:4}#avatar-image{display:flex;margin-inline-end:20px;width:32px;height:32px;border-radius:50%;object-fit:cover}#interestTitle{font-size:14px;font-weight:600;line-height:20px;display:flex;align-items:center;color:rgba(0,0,0,0.8956)}#interestType{height:16px;font-size:12px;line-height:16px;display:flex;align-items:center;color:rgba(0,0,0,0.6063)}.login-info-container{flex-grow:1}.login-info-container:focus,.login-info-container:focus-visible{box-shadow:0px 0px 0px 2px ${Pl.yG};outline:none}.signin-button{background:${$l.Av};
}
`.withBehaviors((0,Il.U)(S.i` #interestTitle,#accountTitle{color:#FFFFFF}#interestType{color:rgba(255,255,255,0.786)}#accountContainer{background:#454545;border:1px solid rgba(0,0,0,0.1)}.account-button{background:#454545;border:1px solid rgba(0,0,0,0.1)}`)),Ll=`${(0,E.Yq)().StaticsUrl}latest/winWidgets/default_persona.png`,El=d.dy`
${(0,g.g)((e=>e.accountSettingsOptions),d.dy`<fluent-design-system-provider fill-color=${e=>e.backgroundColor} base-layer-luminance=${e=>e.baseLayerLuminance}><div class="content" role="presentation"><span id="${e=>e.onChannelStore?"accountTitle":"interestTitle"}" aria-label="">${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.accountSettingsTitle}}</span></div><div id="accountContainer">${e=>{var t;return null!==(t=e.accountSettingsOptions)&&void 0!==t&&t.isUserSignedIn?d.dy`<img id="avatar-image" alt="" src="${e=>{var t,i;return null!==(t=e.accountSettingsOptions)&&void 0!==t&&t.userAvatar?null===(i=e.accountSettingsOptions)||void 0===i?void 0:i.userAvatar:Ll}}"></img><div class="login-info-container" role="presentation"><span id="interestTitle" title="${e=>{var t;return null===(t=e.accountSettingsOptions)||void 0===t?void 0:t.accountName}}" aria-label="${e=>{var t;return null===(t=e.accountSettingsOptions)||void 0===t?void 0:t.accountName}}" tabindex="0">${e=>{var t;return null===(t=e.accountSettingsOptions)||void 0===t?void 0:t.accountName}}</span><span id="interestType" title="${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.microsoftAccount}}" aria-label="${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.microsoftAccount}}" tabindex="0">${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.microsoftAccount}}</span></div><fluent-button class="account-button" appearance="stealth" role="button" title=${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signOutButtonTitle}} aria-label=${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signOutButtonTitle}} @click=${e=>e.handleSignOut()} data-t=${e=>{var t;return null===(t=e.accountSettingsOptions)||void 0===t?void 0:t.telemetry.signOutTelemetry}}>${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signOutButtonTitle}}</fluent-button>`:d.dy`<div class="login-info-container" role="presentation"><span id="sign-in-request-title" aria-label="">${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signInRequestTitle}}</span></div><fluent-button class="account-button signin-button" appearance="accent" role="button" title=${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signInButtonTitle}} aria-label=${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signInButtonTitle}} @click=${e=>e.handleSignIn()} data-t=${e=>{var t;return null===(t=e.accountSettingsOptions)||void 0===t?void 0:t.telemetry.signInTelemetry}}>${e=>{var t;return null===(t=e.localizedStrings)||void 0===t?void 0:t.signInButtonTitle}}</fluent-button>`}}</div></fluent-design-system-provider>`)}
`;let Rl=class extends Tl{};Rl=(0,s.gn)([(0,Rr.M)({name:"msn-account-settings",template:El,styles:Fl})],Rl),kl.D.define(o.H.registry);const Al=d.dy`<template tabindex="0" role="button" title="${e=>e.publisher.selected?(0,mo.WU)(e.selectedButtonTooltip,e.publisher.title):(0,mo.WU)(e.selectButtonTooltip,e.publisher.title)}" aria-label="${e=>e.publisher.selected?(0,mo.WU)(e.selectedButtonTooltip,e.publisher.title):(0,mo.WU)(e.selectButtonTooltip,e.publisher.title)}" aria-pressed="${e=>!!e.publisher.selected}" data-t="${e=>e.publisher.selected?e.unselectTelemetryTag:e.selectTelemetryTag}" class="source-card ${e=>e.publisher.selected?"selected":""}" @click=${e=>e.onClickPublisherCard&&e.onClickPublisherCard()} @keypress="${(e,t)=>e.handleKeyPress&&e.handleKeyPress(t.event)}" title="${e=>e.publisher.title}"><img src="${e=>{var t,i;return Array.isArray(null===(t=e.publisher)||void 0===t?void 0:t.images)&&(null===(i=e.publisher.images[0])||void 0===i?void 0:i.url)||e.defaultImageSrc}}" alt="${e=>e.publisher.title}"/><div class="source-name-container"><span class="source-name">${e=>e.publisher.title}</span></div><slot name="icon"><span class="icon ${e=>e.showIcon?"icon-show":""}">${e=>e.publisher.selected?d.dy`${d.dy.partial(ls())}`:d.dy`${d.dy.partial(ss())}`}</span><slot></template>`,Ol=S.i`
:host{background-color:#454545}:host(:hover){background-color:#4D4D4D}:host(.selected){background:#1A2338;outline:2px solid #235CCF}.icon{background:#292929;fill:white;border:1px solid #666666}`,Ml=S.i`
:host{border-radius:6px;height:142px;flex-direction:column;width:106px;background-color:#FFFFFF;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;position:relative;box-shadow:0px 1px 2px rgba(0,0,0,0.08)}img{height:84px;margin:11px 11px 0;width:84px;border-radius:6px}.icon{align-items:center;background:white;border-radius:12px;display:none;height:20px;inset-inline-end:8px;position:absolute;top:8px;width:20px;border:1px solid #D1D1D1}:host .icon-show{display:flex;justify-content:center}.source-name{font-size:var(--type-ramp-minus-1-font-size,12px);font-weight:600;line-height:var(--type-ramp-minus-1-line-height,16px);text-align:center;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;display:-webkit-box;user-select:none}.source-name-container{align-items:center;display:flex;height:100%;margin-inline:10px}:host(:hover){background-color:#F5F5F5;box-shadow:0px 3px 6px rgba(0,0,0,0.12)}:host(:hover) .icon{display:flex;justify-content:center}svg{height:12px;top:-2px;width:12px}:host(.selected){background:linear-gradient(0deg,rgba(68,100,255,0.1),rgba(68,100,255,0.1)),rgba(255,255,255,0.94);outline:2px solid #4464FF}:host(.selected) .icon{background-color:#405CE8;color:white;display:flex;justify-content:center;align-items:center;border:none}:host(.selected) svg{height:12px;position:initial;fill:white;width:12px}`.withBehaviors((0,hr.Uu)(Ol));class Ul extends Rr.H{constructor(){super(...arguments),this.defaultImageSrc="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtCmK3.img?w=58&h=58&q=90&m=6&f=jpg&u=t",this.showIcon=!1,this.selectButtonTooltip="",this.selectedButtonTooltip="",this.selectTelemetryTag="",this.unselectTelemetryTag=""}onClickPublisherCard(){this.$emit("click-fre-publisher-card")}handleKeyPress(e){e&&"Enter"===e.key&&this.onClickPublisherCard()}}(0,s.gn)([Ht.LO],Ul.prototype,"publisher",void 0),(0,s.gn)([Ht.LO],Ul.prototype,"defaultImageSrc",void 0),(0,s.gn)([(0,a.Lj)({attribute:"consistently-show-icon"})],Ul.prototype,"showIcon",void 0),(0,s.gn)([(0,a.Lj)({attribute:"select-button-tooltip"})],Ul.prototype,"selectButtonTooltip",void 0),(0,s.gn)([(0,a.Lj)({attribute:"selected-button-tooltip"})],Ul.prototype,"selectedButtonTooltip",void 0),(0,s.gn)([(0,a.Lj)({attribute:"select-telemetry-tag"})],Ul.prototype,"selectTelemetryTag",void 0),(0,s.gn)([(0,a.Lj)({attribute:"unselect-telemetry-tag"})],Ul.prototype,"unselectTelemetryTag",void 0);let Dl=class extends Ul{};Dl=(0,s.gn)([(0,Rr.M)({name:"msn-fre-publisher-card",template:Al,styles:Ml})],Dl);var Nl=i(2565),Hl=i(22674);const _l=S.i`
:host{display:flex;flex-direction:column}.settings-container{border-radius:3px}.notification-item-container{height:48px;display:flex;justify-content:space-between;align-items:center;background:rgb(255,255,255);padding:0 12px;border-radius:3px}.notification-item-container:hover{cursor:pointer}.notification-item-container .left{flex:1 1 0%;display:flex;flex-direction:column;justify-content:center;user-select:none}.notification-item-container .right > svg{width:16px;height:16px}.notification-item-container > img{user-select:none}.content-container{display:flex;flex-direction:column;background:#FCFCFC;border-radius:0 0 3px 3px;gap:16px;padding:12px 0;max-height:220px;overflow-y:auto}.content-container::-webkit-scrollbar-track{margin:12px 0;background-color:transparent;border-radius:8px}.content-container::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(0,0,0,0.4458)}.content-container::-webkit-scrollbar{width:2px}.subsetting-container{display:flex;padding:0 0 0 36px;gap:8px}.subsetting-title{margin:auto 0}::part(content){display:grid;grid-template-columns:auto auto 1fr;gap:12px;width:100%}::part(checked-indicator){fill:#FFFFFF;background:var(--accent-fill-rest)}.right{display:flex;gap:12px;justify-content:flex-end}.selected-indicator{font-size:12px;user-select:none}.hidden{display:none}`.withBehaviors(new Hl.O(null,S.i`
.subsetting-container{padding:0 36px 0 0}`),new gr.Y(null,S.i`
.notification-item-container{background:#2D2D2D}.content-container{background:#2F2F2F}.notification-item-container .right > svg{fill:var(--neutral-foreground-rest)}.content-container::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(255,255,255,0.4458)}`));var jl=i(9555),Bl=i.n(jl),zl=i(16061),ql=i.n(zl);const Gl=e=>({name:"showAllNotification",action:It.Aw.Click,behavior:e?It.wu.TurnOn:It.wu.TurnOff,content:{headline:"showAllNotification",type:It.uH.Settings}}),Wl=(e,t)=>({name:"expand",action:It.Aw.Click,behavior:t?It.wu.Expand:It.wu.Collapse,content:{headline:e,type:It.uH.Settings}}),Vl=(e,t,i)=>({name:`${e}>${t}`,action:It.Aw.Click,behavior:i?It.wu.Follow:It.wu.Unfollow,content:{headline:t,type:It.uH.Settings}}),Kl=(e,t)=>{if(e&&t)return null==e?void 0:e.addOrUpdateChild(t).getMetadataTag()},Ql=d.dy`<div class="subsetting-container"><fluent-checkbox class="checkbox" id="${e=>e.pdpType}" checked=${e=>!e.disabled} data-t="${(e,t)=>Kl(t.parent.telemetryObject,Vl(t.parent.verticalId,e.pdpType,e.disabled))}" @click=${(e,t)=>t.parent.handleCheckboxClick(e.pdpType,e.disabled,t.event)}></fluent-checkbox><span class="subsetting-title">${e=>e.label}<span></div>`,Jl=d.dy`${d.dy.partial(ql())}`,Zl=d.dy`${d.dy.partial(Bl())}`,Xl=d.dy`<div class="content-container hidden" ${(0,p.i)("contentContainer")}>${(0,Er.rx)((e=>e.settingItems),Ql)}</div>`,Yl=d.dy`<template><fluent-design-system-provider fill-color=${e=>e.backgroundColor} base-layer-luminance=${e=>e.baseLayerLuminance} class="settings-container ${e=>e.notificationsEnabled?"":"hidden"}"><fluent-button class="notification-item-container" data-t="${e=>Kl(e.telemetryObject,Wl(e.verticalId,!e.isExpanded))}" @click=${(e,t)=>e.toggleExpandedView(t.event)}><img src=${e=>e.iconLink} alt="${e=>e.verticalLabel} icon" aria-hidden="true"></img><div class="left">${e=>e.verticalLabel}</div><div class="right"><div class="selected-indicator">${e=>e.selectedCount} ${e=>{var t;return null===(t=e.locStrings)||void 0===t?void 0:t.selectedCountLabel}}</div>${(0,g.g)((e=>e.isExpanded),Jl,Zl)}</div></fluent-button>${Xl}</fluent-design-system-provider></template>`;let ec=class extends Rr.H{constructor(){super(...arguments),this.isExpanded=!1,this.handleKeyDown=e=>{if("Enter"===(null==e?void 0:e.key)){var t;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement;if(n){var i;const t=null===(i=this.settingItems)||void 0===i?void 0:i.find((e=>e.pdpType===n.id));t&&this.handleCheckboxClick(n.id,t.disabled,e)}}},this.handleCheckboxClick=async(e,t,i)=>{const n=null==i?void 0:i.target;if(this.settingItems){const i="Disabled",o={definitionName:e,targetType:"Notification"};if(t?await Nl.N.deleteUserAction(i,o):await Nl.N.setUserAction(i,o)){this.settingItems=(0,or.Z)(this.settingItems).map((i=>(i.pdpType===e&&(i.disabled=!t),i)));const i={settings:this.settingItems,verticalId:this.verticalId};document.dispatchEvent(new CustomEvent(rn,{detail:i}))}else(0,A.H)(O.dVt,"Notification Settings Failed to Update User Preferences",`ID: ${e}`),n&&(n.checked=!(null!=n&&n.checked))}},this.toggleExpandedView=e=>{this.isExpanded=!this.isExpanded,_.M0.sendActionEvent(e.target,It.Aw.Click),this.contentContainer&&(this.isExpanded?(this.contentContainer.classList.remove("hidden"),this.contentContainer.scrollIntoView()):this.contentContainer.classList.add("hidden"))}}get selectedCount(){var e;return null===(e=this.settingItems)||void 0===e?void 0:e.filter((e=>!e.disabled)).length}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.handleKeyDown)}};(0,s.gn)([Ht.LO],ec.prototype,"locStrings",void 0),(0,s.gn)([Ht.LO],ec.prototype,"backgroundColor",void 0),(0,s.gn)([Ht.LO],ec.prototype,"baseLayerLuminance",void 0),(0,s.gn)([Ht.LO],ec.prototype,"verticalLabel",void 0),(0,s.gn)([Ht.LO],ec.prototype,"verticalId",void 0),(0,s.gn)([a.Lj],ec.prototype,"settingItems",void 0),(0,s.gn)([Ht.LO],ec.prototype,"iconLink",void 0),(0,s.gn)([Ht.LO],ec.prototype,"isExpanded",void 0),(0,s.gn)([Ht.LO],ec.prototype,"telemetryObject",void 0),(0,s.gn)([Ht.LO],ec.prototype,"notificationsEnabled",void 0),(0,s.gn)([Ht.lk],ec.prototype,"selectedCount",null),ec=(0,s.gn)([(0,Rr.M)({name:"notification-settings-vertical",template:Yl,styles:_l})],ec);const tc=d.dy`<notification-settings-vertical :backgroundColor=${(e,t)=>t.parent.backgroundColor} :baseLayerLuminance=${(e,t)=>t.parent.baseLayerLuminance} :verticalLabel=${e=>e.label} :verticalId=${e=>e.verticalId} :settingItems=${e=>e.items} :iconLink=${e=>e.iconLink} :locStrings=${(e,t)=>{var i;return null===(i=t.parent.strings)||void 0===i?void 0:i.categoryItemStrings}} :telemetryObject=${(e,t)=>t.parent.telemetryObject} :notificationsEnabled=${(e,t)=>t.parent.enableNotifications}></notification-settings-vertical>`,ic=d.dy`<div class="content-container"><div class="item-container">${(0,Er.rx)((e=>e.leftItems),tc)}</div><div class="item-container">${(0,Er.rx)((e=>e.rightItems),tc)}</div></div>`,nc=d.dy`<template><fluent-design-system-provider fill-color=${e=>e.backgroundColor} base-layer-luminance=${e=>e.baseLayerLuminance} class="settings-container">${(0,g.g)((e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.notificationsTitle}),d.dy`<span class="widget-section-title">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.notificationsTitle}}</span>`)}<span class="headline">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.headline}}</span><div class="enable-notifications-container"><div class="left"><span class="title">${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.getNotifications}}</span></div><div class="right"><span>${e=>{var t,i;return e.enableNotifications?null===(t=e.strings)||void 0===t?void 0:t.onLabel:null===(i=e.strings)||void 0===i?void 0:i.offLabel}}</span><fluent-switch id="toggleAllSettings" checked="${e=>e.enableNotifications}" data-t="${e=>Kl(e.telemetryObject,Gl(!e.enableNotifications))}" @click=${(e,t)=>e.handleEnableNotification(t.event)}></fluent-switch></div></div>${ic}</fluent-design-system-provider></template>`,oc=S.i`
.settings-container{display:flex;flex-direction:column;gap:12px;background:transparent}.headline{font-size:14px;line-height:20px;font-weight:400}.enable-notifications-container{height:48px;display:flex;justify-content:space-between;align-items:center;padding:0 24px;background:rgb(255,255,255);border-radius:3px}.item-container .left{flex:1 1 0%;display:flex;flex-direction:column;justify-content:center}.content-container{display:grid;gap:12px;grid-template-columns:0.5fr 0.5fr}.item-container{display:flex;flex-direction:column;gap:12px}.widget-section-title{font-weight:600;font-size:14px;line-height:20px;color:rgba(0,0,0,0.894);margin:12px 0}.right{display:flex;gap:12px}.right > span{margin:auto}`.withBehaviors(new gr.Y(null,S.i` .enable-notifications-container{background:#2D2D2D}.widget-section-title{color:#FFFFFF}`));let rc=class extends Rr.H{constructor(){super(...arguments),this.leftItems=[],this.rightItems=[],this.enableNotifications=!0,this.settings=[],this.handleNotificationSettingsChanged=e=>{const t=e.detail;let i=!1;this.leftItems.forEach((e=>{e.verticalId===t.verticalId&&(e.items=t.settings,i=!0)})),i||this.rightItems.forEach((e=>{e.verticalId===t.verticalId&&(e.items=t.settings)}))},this.initializeNotificationSettings=async()=>{const e=await Nl.N.getUserActions("Disabled");e?e.forEach((e=>{var t;null===(t=this.settings)||void 0===t||t.forEach((t=>{var i;null===(i=t.items)||void 0===i||i.forEach((t=>{t.pdpType==e.definitionName&&(t.disabled=!0)}))}))})):(0,A.H)(O.dVt,"Notification Settings No User Preferences Response")},this.populateSettings=()=>{var e;this.leftItems=[],this.rightItems=[],null===(e=this.settings)||void 0===e||e.forEach(((e,t)=>{t%2==0?this.leftItems.push(e):this.rightItems.push(e)}))},this.handleKeyDown=e=>{if("Enter"==(null==e?void 0:e.key)){var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement;"toggleAllSettings"===(null==i?void 0:i.id)&&this.handleEnableNotification(e)}},this.handleEnableNotification=async e=>{const t=null==e?void 0:e.target,i={isBadgingEnabledInTaskbar:this.enableNotifications?"0":"1"};await Nl.N.updateUserSettings(i)?this.enableNotifications=!this.enableNotifications:((0,A.H)(O.dVt,"Notification Settings Failed to Update User Preferences","ID: Get all notifications"),t&&(t.checked=!(null!=t&&t.checked)))}}connectedCallback(){super.connectedCallback(),this.telemetryObject=new er.D({name:"notificationSettings"}),this.initEnableAllNotifications().then((e=>{this.enableNotifications=e})),this.initializeNotificationSettings().then((()=>{this.populateSettings()})),document.addEventListener(rn,this.handleNotificationSettingsChanged),window.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(rn,this.handleNotificationSettingsChanged),window.removeEventListener("keydown",this.handleKeyDown)}async initEnableAllNotifications(){const e=await Nl.N.getPdpUserPreference();if(e&&e.is404)return!0;const t=(null==e?void 0:e.value[0].userSettings)||void 0;if(t){const e=null==t?void 0:t.isBadgingEnabledInTaskbar;return"1"===e||null==e}return(0,A.H)(O.dVt,"Notification Settings No User Preferences Response"),!0}};(0,s.gn)([Ht.LO],rc.prototype,"strings",void 0),(0,s.gn)([Ht.LO],rc.prototype,"leftItems",void 0),(0,s.gn)([Ht.LO],rc.prototype,"rightItems",void 0),(0,s.gn)([Ht.LO],rc.prototype,"backgroundColor",void 0),(0,s.gn)([Ht.LO],rc.prototype,"baseLayerLuminance",void 0),(0,s.gn)([Ht.LO],rc.prototype,"enableNotifications",void 0),(0,s.gn)([Ht.LO],rc.prototype,"settings",void 0),rc=(0,s.gn)([(0,Rr.M)({name:"notification-settings",template:nc,styles:oc})],rc);var sc=i(2850),ac=i.n(sc),lc=i(7508),cc=i.n(lc),dc=i(10711),pc=i(41067),uc=i.n(pc);const hc=d.dy`<div class="notifications"><notification-settings :strings=${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.notificationSettingsStrings}} :settings=${e=>e.notificationItems} :baseLayerLuminance=${e=>e.baseLayerLuminance} :backgroundColor=${e=>e.backgroundColor}></notification-settings></div>`,gc=d.dy`<fluent-divider class="separator" role="presentation"></fluent-divider>`,fc=d.dy`<div :innerHTML=${(0,os.ak)((e=>e.glyph||""),dc.U)} slot="start"></div>`,vc=d.dy`<div :innerHTML=${(0,os.ak)((e=>e.selectedGlyph||""),dc.U)} slot="start"></div>`,mc=d.dy`<fluent-tree-item :selected="${(e,t)=>e.id===t.parent.selectedNavId}" @click=${(e,t)=>t.parent.onNavigationItemClick(t.event,e)} data-t="${(e,t)=>t.parent.TelemetryConstants&&t.parent.TelemetryConstants.NavItem(e.telemetryMetadata??"").getMetadataTag()}" id=${e=>e.id} tabindex="0" class="left-nav-tree-item ${(e,t)=>e.id===t.parent.selectedNavId?"selected":""}"><h2 class="display">${e=>e.display}</h2>${(0,g.g)(((e,t)=>!t.parent.config.enableProng2Design&&e.glyph&&e.id!==t.parent.selectedNavId),fc)} ${(0,g.g)(((e,t)=>!t.parent.config.enableProng2Design&&e.selectedGlyph&&e.id===t.parent.selectedNavId),vc)}</fluent-tree-item>${(0,g.g)((e=>e.showDivider),gc)}
`,yc=d.dy`<msn-account-settings :enableFeedCustomization=${e=>e.enableFeedCustomization} :localizedStrings=${e=>e.strings} on-channel-store="true"></msn-account-settings>`,bc=d.dy`<div class="left-nav-header">${e=>e.getLeftNavHeaderStr()}</div>`,wc=d.dy`<div class="left-nav-container ${e=>e.forceTreeView?"forced-view":""}">${bc} ${(0,g.g)((e=>e.enableFeedCustomization&&e.config.enableProng2Design),yc)}<fluent-button appearance="stealth" tabindex="0" @click=${(e,t)=>e.onNavButtonClick(t.event,!1)} data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.closeDialog.getMetadataTag()}" class="stealth navigation-button">${d.dy.partial(ac())}</fluent-button><fluent-tree-view @selected-change="${(e,t)=>e.onSelectedChange(t.event)}" ${(0,p.i)("treeView")} part="tree-view" class="left-nav-tree" aria-label="${e=>e.getLeftNavHeaderStr()}">${(0,Er.rx)((e=>e.navItems),mc)}</fluent-tree-view><a appearance="stealth" tabindex="0" @click=${(e,t)=>e.onExperienceLinkClick(t.event)} aria-label="${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.experienceSettingsLink}}" title=${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.experienceSettingsLink}} data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.experienceSettings.getMetadataTag()}" class="stealth experience-link" id="experience-link"><span>${e=>{var t;return null===(t=e.strings)||void 0===t?void 0:t.experienceSettingsLink}} ${d.dy.partial(cc())}</span></a></div>`,Sc=d.dy`<div class="content-container">${(0,g.g)((e=>e.selectedNavId&&"discover"==e.selectedNavId),La)} ${(0,g.g)((e=>e.selectedNavId&&"following"==e.selectedNavId),ts)} ${(0,g.g)((e=>e.selectedNavId&&"blocked"==e.selectedNavId),ns)} ${(0,g.g)((e=>e.selectedNavId&&"notifications"==e.selectedNavId),hc)}</div>`,Cc=d.dy`<div class="leftnav-1c"><fluent-button appearance="stealth" tabindex="0" @click=${(e,t)=>e.onNavButtonClick(t.event,!0)} data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.closeDialog.getMetadataTag()}" class="stealth navigation-button">${d.dy.partial(ac())}</fluent-button>${bc}
`,xc=d.dy`<fluent-divider orientation="vertical" class="content-divider"></fluent-divider>`,Tc=d.dy`<div class="background ${e=>e.config.enableProng2Design?"prong2-design":""} ${e=>e.useDetailPageStyles?"detail-page":""}" @click=${(e,t)=>e.onBackgroundClick(t.event)}><div class="personalize-overlay ${e=>e.overlayClass} ${e=>e.enableFeedCustomization&&e.config.enableProng2Design?"has-account-settings":""}" ${(0,p.i)("overlayRef")}><div class= "container-background"></div><fluent-button appearance="stealth" tabindex="0" @click=${(e,t)=>e.onCloseOverlayClick()} aria-label=${e=>e.strings.closeButton} title=${e=>e.strings.closeButton} data-t="${e=>e.TelemetryConstants&&e.TelemetryConstants.closeDialog.getMetadataTag()}" class="stealth close-button" id="close-button">${d.dy.partial(uc())}</fluent-button>${Cc} ${wc} ${(0,g.g)((e=>!e.config.enableProng2Design),xc)} ${Sc}</div></div>`,kc=d.dy` ${(0,g.g)((e=>e.showOverlay),Tc)}
`;T.define(x.j.registry),k.D3.define(x.j.registry);const Ic={experienceConfigSchema:undefined};n.D.define(o.H.registry),r.D.define(o.H.registry)},8887:function(e,t,i){"use strict";i.d(t,{N:function(){return s}});var n=i(5302),o=i(44132),r=i(21215);class s{constructor(e,t,i,n){this.chromiumApiRetryCount=5,this.isNtpPrivateApiAvailable=e=>window&&window.chrome&&window.chrome.ntpSettingsPrivate&&"function"==typeof window.chrome.ntpSettingsPrivate[e],this.prefSettingKey=e,this.searchForKeyName=t,this.targetKeyName=i,this.defaultItem=n}async getPreferenceSetting(e,t){try{const i=await this.getPreferenceSettingValueArray(t),n=i.findIndex((t=>t[this.searchForKeyName]===e));return n>-1?i[n]:null}catch(t){const i=`Failed to find user preference key: ${e}`;return this.logAppError(n.Aps,i,t),null}}async savePreferenceSetting(e,t){try{const i=await this.getPreferenceSettingValueArray()||[],n=i.findIndex((t=>t[this.searchForKeyName]===e));if(n>-1){const e={...i[n],...t};i[n]=e}else{const n={...this.defaultItem,...t};n[this.searchForKeyName]=e,i.push(n)}return this.setAndSavePreferenceSetting(i)}catch(t){const i="Failed to store user preference setting";return this.logAppError(n.nS9,i,`Key:${e}.Error:${t}`),!1}}isApiAvailableToUse(){return new Promise((e=>{const t="Error in isApiAvailableToUse";try{this.isGoodToUseNtpSettingsPrivate("getAllPrefs")?void 0===this.isPrefSettingKeyAvailable?window.chrome.ntpSettingsPrivate.getAllPrefs((i=>{if(this.isPrefSettingKeyAvailable=i&&i.findIndex((e=>e.key===this.prefSettingKey))>-1,!this.isPrefSettingKeyAvailable){let e="";try{i&&i.forEach((t=>e+=`${t.key}+`))}catch(e){this.logAppError(n.Aps,"Error: Can not log keylist from preference setting",e)}this.logAppError(n.me0,t,`missing preference key: ${this.prefSettingKey}, available keys: ${e}`)}e(this.isPrefSettingKeyAvailable)})):e(this.isPrefSettingKeyAvailable):(this.logAppError(n.MFQ,t,"getAllPrefs not present"),e(!1))}catch(t){this.logAppError(n.MFQ,"Error: Unexpected throw in isApiAvailableToUse",t),e(!1)}}))}logAppError(e,t,i){null===o.M0||void 0===o.M0||o.M0.sendAppErrorEvent({...e,message:t,pb:{...e.pb,customMessage:i}})}async getPreferenceSettingValueArray(e){try{if(this.settingValuesArray&&!e)return this.settingValuesArray;{const e=await this.getPreferenceValueFromBrowser();return this.settingValuesArray=e||[],this.settingValuesArray}}catch(e){const t=`Failed to read ${this.prefSettingKey} preference setting`;return this.logAppError(n.k8J,t,e),[]}}setAndSavePreferenceSetting(e){if(!(0,r.N)())return!1;try{if(this.isGoodToUseNtpSettingsPrivate("setPref"))return this.settingValuesArray=e,window.chrome.ntpSettingsPrivate.setPref(this.prefSettingKey,this.settingValuesArray),!0;{const e="window.chrome.ntpSettingsPrivate.setPref does not exist.";return this.logAppError(n.T5b,e,`Key:${this.prefSettingKey}`),!1}}catch(e){return!1}}isGoodToUseNtpSettingsPrivate(e){let t=this.isNtpPrivateApiAvailable(e),i=0;for(;i<this.chromiumApiRetryCount&&!t;)i++,setTimeout((()=>{t=this.isNtpPrivateApiAvailable(e),t&&o.M0.sendAppErrorEvent({...n.$9$,message:`Chromium API retry succeed after ${i} retry`})}),50);if(!t){const t=`functionName: ${e},\n canUseDOM: ${(0,r.N)()},\n windows: ${window},\n document: ${window&&window.document},\n createElement: ${window&&window.document&&window.document.createElement},\n chrome: ${window&&window.chrome},\n ntpSettingsPrivate: ${window&&window.chrome&&window.chrome.ntpSettingsPrivate},\n ntpSettingsPrivate funtions: ${window&&window.chrome&&window.chrome.ntpSettingsPrivate&&Object.getOwnPropertyNames(window.chrome.ntpSettingsPrivate).toString()}\n `;o.M0.sendAppErrorEvent({...n.Fe_,message:"Failed to get funtion from window.chrome.ntpSettingsPrivate.",pb:{...n.Fe_.pb,customMessage:t}})}return t}getPreferenceValueFromBrowser(){return new Promise(((e,t)=>{if(this.isGoodToUseNtpSettingsPrivate("getPref"))window.chrome.ntpSettingsPrivate.getPref(this.prefSettingKey,(function(t){t&&t.value?e(t.value):e(null)}));else{const e="window.chrome.ntpSettingsPrivate.getPref does not exist.";this.logAppError(n.pCD,e,""),t(e)}}))}}},22624:function(e,t,i){"use strict";i.d(t,{L:function(){return l}});var n=i(52185),o=i(81489),r=i(8887),s=i(5302);class a extends r.N{constructor(){super("ntp.record_user_choices","setting","value",{setting:"default",source:"default layout",timestamp:0,value:-1})}static getInstance(){return n.Gq.get("__RecordUserChoicesManager__",(()=>new a))}async deleteKeyValueFromPSL(e){try{let t=await this.getPreferenceSettingValueArray()||[];return t=t.filter((t=>t&&t[this.searchForKeyName]!==e)),this.setAndSavePreferenceSetting(t)}catch(t){const i="Failed to delete user preference setting";return this.logAppError(s.nS9,i,`Key:${e}.Error:${t}`),!1}}}const l=(0,o.h)(a)},16495:function(e,t,i){"use strict";i.d(t,{H:function(){return h},U:function(){return g}});var n=i(52185),o=i(81489),r=i(5302),s=i(8887),a=i(42833),l=i(44132),c=i(21215),d=i(52965);function p(e,t){return(e||[]).find((e=>(null==e?void 0:e.key)===t))||null}function u(e,t){const{key:i,value:n,deleteKey:o=!1}=t;let r=e||[];if(o)r=r.filter((e=>e&&(null==e?void 0:e.key)!==i));else{const e=r.findIndex((e=>(null==e?void 0:e.key)===i));if(e>-1)r[e]={...r[e],value:n};else{const e={key:i,value:n};r.push(e)}}return r}class h extends s.N{constructor(){super("ntp.user_nurturing","key","value",{key:"default",value:"none"}),this._latestItems=[],this._initializeCachedItemsPromise=new a.o}static getInstance(){return n.Gq.get("__UserNurturingManager__",(()=>new h))}async savePreferenceSetting(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{return await this._initializeCachedItems(),this._updateCachedItems({key:e,value:t,deleteKey:i}),await this._updatePersistedItems({key:e,value:t,deleteKey:i})}catch(t){const i="Failed to store user nurturing preference";return this.logAppError(r.nS9,i,`Key:${e}.Error:${t}`),!1}}async getPreferenceSetting(e,t){try{if(await this._initializeCachedItems(),t){const t=await this._getPersistedItemByKey(e);return this._updateCachedItems({key:e,value:null==t?void 0:t.value,deleteKey:!1}),t}return this._getCachedItemByKey(e)}catch(t){const i=`Failed to find user preference key: ${e}`;return this.logAppError(r.Aps,i,t),null}}async getClonedPreferenceSetting(e,t){const i=await this.getPreferenceSetting(e,t);return(0,d.Z)(i)}async _initializeCachedItems(){var e,t,i,n,o,s;if(this._initializeCachedItemsPromise.wasSet())return this._initializeCachedItemsPromise.getResultAsync();const a=Date.now();null!==(e=window)&&void 0!==e&&null!==(t=e.chrome)&&void 0!==t&&null!==(i=t.ntpSettingsPrivate)&&void 0!==i&&i.getPref&&l.M0.addOrUpdateTmplProperty("psl_loading_time","-1");try{this._items=await this.getPreferenceValueFromBrowser()||[],this._latestItems=(0,d.Z)(this._items)}catch(e){const t="Failed to initialize cached items for UserNurturingManager";this.logAppError(r.Aps,t,e)}null!==(n=window)&&void 0!==n&&null!==(o=n.chrome)&&void 0!==o&&null!==(s=o.ntpSettingsPrivate)&&void 0!==s&&s.getPref&&l.M0.addOrUpdateTmplProperty("psl_loading_time",(Date.now()-a).toString()),this._initializeCachedItemsPromise.set(),this._listenToPreferenceChange()}_getCachedItemByKey(e){return p(this._items,e)}async _getPersistedItemByKey(e){return p(this._latestItems,e)}_updateCachedItems(e){this._items=u(this._items,e)}async _updatePersistedItems(e){const t=this._latestItems;return this.setAndSavePreferenceSetting(u(t,(0,d.Z)(e)))}deleteKeyValueFromPSL(e){this.savePreferenceSetting(e,null,!0)}_listenToPreferenceChange(){(0,c.N)()&&window.chrome&&window.chrome.ntpSettingsPrivate&&window.chrome.ntpSettingsPrivate.onPrefsChanged.addListener((e=>{const t=(e||[]).find((e=>(null==e?void 0:e.key)===this.prefSettingKey));t&&(this._latestItems=(0,d.Z)(t.value||[]))}))}}const g=(0,o.h)(h)},95603:function(e,t,i){"use strict";i.d(t,{Nn:function(){return d},Xm:function(){return n},_9:function(){return c},nc:function(){return a},rr:function(){return s},sj:function(){return r}});const n={campaigns:"campaigns",feedLayout:"feed_layout",renderSingleColumn:"render_single_column",wpo:"wpo",wpoLytTmpl:"wpo_lyt_tmpl",topSites:"top_sites",recommendedSites:"recommended_sites",viewport:"viewport",wpo_nx:"wpo_nx",layoutPromotion:"layoutPromotion",layoutHistory:"layoutHistory"};var o,r,s;!function(e){e.Ntp="ntp",e.Wpo="wpo"}(o||(o={})),function(e){e.MultiColumn="multi",e.SingleColumn="single"}(r||(r={})),function(e){e.apiError="api_error"}(s||(s={}));const a={tscollapsed:"tscollapsed",layout_mode:"layout_mode",left_rail:"left_rail",quick_links_options:"quick_links_options",single_column:"single_column",recommended_sites:"recommended_sites",daily_discovery_in_search_box:"daily_discovery_in_search_box",news_below_searchbox:"news_below_searchbox",ntp_tips:"ntp_tips",search_history:"search_history",current_location_enabled:"current_location_enabled",enable_sponsored_content:"enable_sponsored_content",enable_split_screen:"enable_split_screen",hide_search_box:"hide_search_box",seen_interest_fre_count:"seen_interest_fre_count",visited_following_feed:"visited_following_feed",dismiss_scroll_down_button:"dismiss_scroll_down_button",bing_intl_upsell:"bing_intl_upsell",breaking_news_dismissed:"breaking_news_dismissed"};var l;!function(e){e.User="user",e.Wpo="wpo"}(l||(l={}));const c={backgroundImageTypePolicy:"ntp.background_type_blocked_by_policy",currentBackgroundImageType:"ntp.background_image_type",hideDefaultTopSites:"ntp.hide_default_top_sites",customBackgroundImageInfo:"ntp.local_background_image",layout:"ntp.layout_mode",quickLinks:"ntp.show_top_sites",quickLinksDisplaySetting:"ntp.quick_links_options",imageOfTheDay:"ntp.show_image_of_day",feeds:"ntp.news_feed_display",greeting:"ntp.show_greeting",showSettings:"ntp.show_settings",verticalTabsCollapsed:"edge.vertical_tabs.collapsed",verticalTabsOpened:"edge.vertical_tabs.opened",singleColumnEnabled:"ntp.single_column.enabled",userNurturingUpdated:"ntp.user_nurturing",hasUserSeenNewFre:"new_device_fre.has_user_seen_new_fre",defaultBrowserSettingEnabled:"browser.default_browser_setting_enabled",showAppLauncher:"ntp.enable_app_launcher",userChoices:"ntp.record_user_choices",selectedFeedPivot:"ntp.selected_feed_pivot"},d="_split";var p,u;!function(e){e.NotInChinaCoachMarkButton="notInChinaCoachMarkButton",e.FeedbackLink="feedbackLink"}(p||(p={})),function(e){e[e.focused=0]="focused",e[e.inspirational=1]="inspirational",e[e.informational=2]="informational",e[e.custom=3]="custom"}(u||(u={}))},90061:function(e,t,i){"use strict";i.d(t,{ZH:function(){return c},bE:function(){return p},iA:function(){return a},l_:function(){return d}});var n=i(242),o=i(42833),r=i(21215);const s="defer-hydration",a=window.location.search.includes("ssrhydrateperf"),l=(new Map,e=>t=>{if(!t.hasAttribute(e))return Promise.resolve();const i=new o.o;return new MutationObserver(((n,o)=>{t.hasAttribute(e)||(i.set(),o.disconnect())})).observe(t,{attributeFilter:[e]}),i.getResultAsync()}),c=l(s),d=l("needs-hydration"),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(0,r.N)())return{start:()=>{},markEnd:()=>{}};const i=`${e}.start`;return{start:()=>{var e;return null===(e=performance)||void 0===e?void 0:e.mark(i)},markEnd:function(){var o,r;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;const l=`${e}.${s}`;var c;(null===(o=performance)||void 0===o||o.mark(l),null===(r=performance)||void 0===r||r.measure(`${e}.${s}:duration`,i,l),a)&&((0,n.Ou)()[`${e}.${s}:duration`]=null===(c=performance)||void 0===c?void 0:c.getEntriesByName(`${e}.${s}:duration`)[0].duration)}}};new Set;var u;!function(e){e[e.Immediate=0]="Immediate",e[e.Never=1]="Never",e[e.IdleAfterTtvr=2]="IdleAfterTtvr",e[e.OnInteraction=3]="OnInteraction",e[e.OnHover=4]="OnHover",e[e.OnPageResize=5]="OnPageResize"}(u||(u={}))},5813:function(e,t,i){"use strict";i.d(t,{$s:function(){return h},$v:function(){return R},CO:function(){return O},GR:function(){return o},H0:function(){return u},I1:function(){return g},IA:function(){return M},J8:function(){return c},L3:function(){return l},LJ:function(){return $},Mo:function(){return s},P$:function(){return I},Pg:function(){return m},Qn:function(){return C},Qs:function(){return x},S1:function(){return H},SO:function(){return F},Td:function(){return v},UW:function(){return d},UY:function(){return S},YU:function(){return P},bx:function(){return w},di:function(){return E},eK:function(){return b},gr:function(){return A},hE:function(){return n},hM:function(){return T},hZ:function(){return p},hk:function(){return a},i9:function(){return N},kJ:function(){return k},kX:function(){return y},lP:function(){return L},ly:function(){return f},os:function(){return D},vy:function(){return U},xE:function(){return r}});const n={activityId:"activityId",apiKey:"apikey",audienceMode:"audienceMode",bypassTrigger:"bypass_trigger",cm:"cm",complexInfoPaneEnabled:"cipenabled",contentType:"contentType",delta:"delta",disableContent:"disablecontent",disableTypeSerialization:"DisableTypeSerialization",duotone:"duotone",infopaneCount:"infopaneCount",fdhead:"fdhead",feedLayoutRequestType:"t",filter:"$filter",includeFollowingFilters:"iff",ids:"ids",interestIds:"InterestIds",location:"location",market:"market",newsSkip:"newsSkip",newsTop:"newsTop",ocid:"ocid",pageConfiguration:"pgc",parentContentId:"parent-content-id",parentNamespace:"parent-ns",parentTitle:"parent-title",providerId:"ProviderId",queryQ:"q",query:"query",queryType:"queryType",qScope:"qscope",requestId:"rid",responseSchema:"responseschema",select:"$select",session:"session",signInCookieName:"scn",skip:"$skip",source:"source",timeOut:"timeOut",top:"$top",type:"type",user:"user",wrapOData:"wrapodata",wpoitems:"wpoitems",wpoPageId:"wpopageid",wpoSchema:"wposchema",caller:"caller",dhp:"dhp",webWorker:"webWorker",edgeNoAds:"edgenoads",edgeReduceAds:"edgereduceads",column:"column",anaheimPageLayout:"anaheimPageLayout",adRefreshVariant:"adRefreshVariant",gdpr:"gdpr",verticalName:"verticalName"},o="0QfOX3Vn51YCzitbLaRkTTBadtWpgTN8NZLW0C1SEM",r="Uj7u7bqBgMhDGBUVPSbcHUe0pU7X8TbVRviCO2fojo",s="service/news/feed/pages/",a="serviceak/news/feed/pages/",l="news/feed/pages/",c="ntpxfeed",d="wpoxfeed",p="news/feed/pages/",u="winxfeed",h="wpodhp",g="gamingfeed",f="ntpfollowfeed",v="filteredfollowingchannels",m="prong1followfeed",y="prong2followfeed",b="followingxfeed",w="ntp",S="weblayout",C="ntpxfeed",x="prong2xfeed",T="https://api.msn.com",k="https://sf-ppe.oneservice-test.msn.com",I="wpo-usebasedomain",P="wpo-useintdomain",$="https://ppe-api.msn.com",F="news/feed/pages/ntpxfeed",L="news/feed/pages/",E=17,R="xbox-browser",A="jY4a3fYtgzb7PIcW0Kj6amp5k6LwDefg6RSnkmxjto",O="prg-useakmaipath",M="prg-ssr-ext1sdns",U="msnkids",D="dy0rQcQaYj5cKZ2Cy0cdaRDJcC5maS5hPj9w2SbeRf",N="anaheim-ntp-following",H="vevII5dbHfpd1fHIMlPxbas6GZQEFOm4CozFHehOgW"},84964:function(e,t,i){"use strict";i.d(t,{l:function(){return $}});var n=i(33940),o=i(29367),r=i(57663),s=i(22471),a=i(28904),l=i(42590),c=i(33117),d=i(89799),p=i(242),u=i(33779),h=i(5302),g=i(29363),f=i(43225),v=i(93441),m=i(25513),y=i(81586),b=i(90061);class w extends Event{constructor(e){super(w.type,{bubbles:!0,composed:!0}),this.complete=e}static isPendingTask(e){var t;return e.type===w.type&&"function"==typeof(null===(t=e.complete)||void 0===t?void 0:t.then)}}w.type="pending-task";var S=i(78058),C=i(21215),x=i(21937),T=i(42833);let k=[];new Set,new T.o;var I=i(72685);const P="props-token";class $ extends a.H{constructor(){super(...arguments),this.ensureObservableBeforeConnect=!1,this.hydratable=!1,this.isSSRRendered=!1,this.needPendingTask=!1}connectedCallback(){this.initializeCore().then((()=>{var e;return this.ttvrEnd=null===(e=this.perfTimeline)||void 0===e?void 0:e.startMeasure("render").endMeasure}))}async initializeCore(){const e=this.getExperienceType(),t=this.perfTimeline=(0,c.Dd)(e,this.instanceId);if(this.initStart=t&&(()=>this.initEnd=t.startMeasure("init").endMeasure),this.fetch=(0,d.Ud)({perfTimeline:t}),(0,p.O8)("WCE.Count"),(0,C.N)())this.hydratable=this.hasAttribute("defer-hydration")||this.hasAttribute("needs-hydration"),this.isSSRRendered=this.hasAttribute("needs-hydration"),this.initializeAsync();else{const e=this.initializeOnServerSide();this.needPendingTask&&this.dispatchEvent(new w(e))}}async initializeOnServerSide(){var e;null===(e=this.initStart)||void 0===e||e.call(this),this.needPendingTask=!1;const t=this.getExperienceType();try{var i;const e=this.getConfigRef();if(!this.config){let t;if("string"!=typeof e)try{t=o.U.getConfigSync(e)}catch(e){}t||(this.needPendingTask=!0,t=await o.U.getConfig(e)),this.config=t.properties}if(this.strings=this.config.localizedStrings,!this.telemetryObject){const e=this.getTelemetryContract();this.telemetryObject=new S.D(e)}const t=this.experienceConnected();t&&(this.needPendingTask=!0,await t),super.connectedCallback(),this.shadowDomPopulated(),null===(i=this.initEnd)||void 0===i||i.call(this)}catch(e){var n,r;null===(n=this.initEnd)||void 0===n||n.call(this,{customSuffix:"error"}),(0,u.OO)(e,h.xuo,`Exception web component experience(${t}) initializeOnServerSide.`,`ssrLayout:${null===(r=window.ssrLayoutState)||void 0===r?void 0:r.selectedFeedDisplaySetting};edgeHeader:${JSON.stringify(window.edgeNTPHeader)}`)}}async initializeAsync(){var e;this.hydratable&&await(0,b.ZH)(this),null===(e=this.initStart)||void 0===e||e.call(this),this.reportStartTimeToMilestoneConnector(v.g.updateVisuallyReadyTiming);const t=this.getExperienceType();try{var i;const e=this.getConfigRef();if(!this.config){const t=await o.U.getConfig(e);this.config=t.properties}if(this.strings=this.config.localizedStrings,!this.telemetryObject){const e=this.getTelemetryContract();this.telemetryObject=new S.D(e)}const{stalenessInfo:n}=this.config;n&&n.isStaleCheckRequired&&(s={experienceType:t,thresholdMinutes:n.staleThreshold,criticalCallback:()=>this.prerenderRefreshCritical(),delayCallback:()=>this.prerenderRefresh()},k.push(s)),this.ensureObservableBeforeConnect&&this.$fastController.bindObservables();const r=this.experienceConnected();if(r){const e=this.hydratable&&b.iA?(0,b.bE)(`${this.getExperienceType()}:experienceConnected`):void 0;null==e||e.start(),await r,null==e||e.markEnd()}if(this.hydratable){const e=b.iA?(0,b.bE)(`${this.getExperienceType()}:beforeHydration`):void 0;null==e||e.start(),await this.beforeHydration(),null==e||e.markEnd()}super.connectedCallback(),this.shadowDomPopulated(),this.hydratable&&await this.afterHydration(),this.perfTimeline&&(0,c.d0)(this,this.perfTimeline,I.y),null===(i=this.initEnd)||void 0===i||i.call(this)}catch(e){var n,r;(0,u.OO)(e,h.xuo,`Exception web component experience initializeAsync. ExperienceType: ${t}`,`ssrLayout:${null===(n=window.ssrLayoutState)||void 0===n?void 0:n.selectedFeedDisplaySetting};edgeHeader:${JSON.stringify(window.edgeNTPHeader)}`),this.logCriticalException(),null===(r=this.initEnd)||void 0===r||r.call(this,{customSuffix:"error"})}var s}experienceConnected(){}beforeHydration(){}afterHydration(){}shadowDomPopulated(){}prerenderRefreshCritical(){return Promise.resolve(void 0)}prerenderRefresh(){}logCriticalException(){}getConfigRef(){return r.jG.IsGitConfigs?{instanceSrc:this.instanceSrc,experienceType:this.getExperienceType(),sharedNs:this.sharedNs}:this.instanceSrc}getTelemetryContract(){return{type:y.c9.Module,name:this.getExperienceType()}}getApproxTTVRValue(e){const t=(0,p.Ou)();if(this.isSSRRendered&&t[s.p.isSSRCompleted])return t[g.nz+(e||this.getExperienceType())]||t[g.nz+s.p.complete]}markVisuallyReady(e,t){var i,n;const o=this.getApproxTTVRValue();t??(t=void 0===o),e=o||e;const r=(0,g.o_)(this.getExperienceType(),!1,e,t);return this.reportEndTimeToMilestoneConnector(v.g.updateVisuallyReadyTiming,e),null===(i=this.ttvrEnd)||void 0===i||i.call(this,{endTime:e}),null===(n=this.visualReadinessCallback)||void 0===n||n.call(this),r}markVisuallyReadyRaf(e){(0,f.c)((()=>this.markVisuallyReady(e)))}reportStartTimeToMilestoneConnector(e){this.reportTimeToMilestoneConnector(e,performance.now())}reportEndTimeToMilestoneConnector(e,t){this.reportTimeToMilestoneConnector(e,void 0,t||performance.now())}reportTimeToMilestoneConnector(e,t,i){const n=(0,m.S0)();n&&e.getActionSender(n).send({experienceType:this.getExperienceType(),experienceInstance:this.instanceId,startTime:t,endTime:i})}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),e===P){const e=(0,x.Y)(i);Object.assign(this,e)}}}(0,n.gn)([(0,l.Lj)({attribute:"config-instance-src"})],$.prototype,"instanceSrc",void 0),(0,n.gn)([(0,l.Lj)({attribute:"config-shared-ns"})],$.prototype,"sharedNs",void 0),(0,n.gn)([(0,l.Lj)({attribute:"instance-id"})],$.prototype,"instanceId",void 0),(0,n.gn)([(0,l.Lj)({attribute:P})],$.prototype,"propsToken",void 0)},72685:function(e,t,i){"use strict";i.d(t,{a:function(){return s},y:function(){return r}});var n=i(31699),o=i(49218);function r(){return new Promise((e=>n.S.queueUpdate((()=>e()))))}function s(e){return o.dy`<script nonce="${()=>window.NONCE_ID}">${o.dy.partial(`window.markTTSR("${e}");`)}</script>`}},54791:function(e,t,i){"use strict";function n(e){return!(e&&e.length)}i.d(t,{x:function(){return n}})},45970:function(e,t,i){"use strict";i.d(t,{X:function(){return n}});class n{constructor(e){this.onSubscriptionCallbackError=e,this.eventLookup={}}publish(e,t){let i=this.eventLookup[e];if(void 0!==i){i=i.slice();let n=i.length;for(;n-- >0;)try{i[n](t)}catch(i){this.onSubscriptionCallbackError&&this.onSubscriptionCallbackError(i,e,n,t)}}}subscribe(e,t){void 0===this.eventLookup[e]&&(this.eventLookup[e]=[]);const i=this.eventLookup[e];return i.push(t),{dispose(){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}subscribeOnce(e,t){const i=this.subscribe(e,(function(e){i.dispose(),t(e)}));return i}}},26197:function(e,t,i){"use strict";i.d(t,{_:function(){return n}});const n={backgroundInnerHolder:"backgroundInnerHolder",backgroundOuterHolder:"backgroundOuterHolder",cardAction:"cardAction",complianceHyperlink:"complianceHyperlink",feedToggle:"feedToggle",financeGreeting:"financeGreeting",following:"following",myInterests:"myInterests",gaming:"gaming",gridViewFeed:"gridViewFeed",headerSpaceHolder:"headerSpaceHolder",locationGreeting:"locationGreeting",marketSelector:"marketSelector",myFeed:"myFeed",navBar:"navBar",notificationBell:"notificationBell",nurturingCoachMark:"nurturingCoachMark",office365:"office365",overlayArticleReader:"overlayArticleReader",personalizeButton:"personalizeButton",pillWC:"pillWC",recommendedSites:"recommendedSites",rewardsIcon:"rewardsIcon",rewardsButton:"rewardsButton",rightRailSectionKey:"rightRailSectionKey",scrollableContainer:"scrollableContainer",searchBox:"search-box-edgenext",searchBoxInput:"searchBoxInput",searchBoxVoiceButton:"searchBoxVoiceButton",searchHistory:"searchHistoryEdgeNext",settingsButton:"SettingsButton",settingsCloseButton:"settingsCloseButton",settingsInformationalButton:"settingsInformationalButton",shoppingNav:"shoppingNav",signInButton:"signInButton",singleColumnFeedRoot:"singleColumnFeedRoot",superCoachMark:"superCoachMark",topSites:"topSites",unifiedMobileFeed:"unifiedMobileFeed",weatherNav:"weatherNav",waffle:"waffle",watchNav:"watchNav",waterfallViewFeed:"waterfallViewFeed",welcomeGreeting:"welcomeGreeting",navigationPage:"navigationPage",videoPlayButton:"videoPlayButton",imageEditButton:"imageEditButton",headerGrid:"headerGrid",floatButtonGroupWC:"floatButtonGroupWC",weatherHeroExperience:"weatherHeroExperience"}},98604:function(e,t,i){"use strict";i.d(t,{FY:function(){return a},b_:function(){return l},h_:function(){return c}});var n=i(42833),o=i(52185);const r=()=>o.Gq.get("__global-element-map_elementMap__",(()=>new Map)),s=()=>o.Gq.get("__global-element-map_waitForElementMap__",(()=>new Map));function a(e,t){if(!t)return;r().set(e,t);const i=s().get(e);i&&i.set(t)}function l(e){return e?r().get(e):null}function c(e){if(!e)return Promise.reject(null);const t=l(e);if(l(e))return Promise.resolve(t);const i=s();if(i.has(e))return i.get(e).getResultAsync();const o=new n.o;return i.set(e,o),o.getResultAsync()}},42467:function(e,t,i){"use strict";var n,o;i.d(t,{PH:function(){return n},Rx:function(){return o},Xm:function(){return a},Ze:function(){return l},ah:function(){return r},yz:function(){return s}}),function(e){e.OneService="OneService",e.WindowsShell="WindowsShell"}(n||(n={})),function(e){e.Bgtask="bgTask",e.BgRefresh="bgRefresh",e.Api="api",e.App="appLoad",e.AppErrRefresh="appErrRefresh",e.RetryFetch="retryFetch",e.Scroll="scroll",e.ApiErrorRefresh="apiErrorRefresh",e.Init="init",e.BgInit="bgInit",e.CacheExpired="cacheExpired",e.SettingsChanged="settingsChanged",e.SessionExpired="sessionExpired",e.PrefChange="PrefChange",e.StaleRefresh="staleRefresh"}(o||(o={}));const r=/lowT:\d/i,s=/lowC:\d/i,a="rihp",l=["en-us","da-dk","de-at","de-ch","de-de","en-au","en-ca","en-gb","en-in","en-nz","es-es","es-mx","es-us","fr-ch","fr-fr","fr-ca","it-it","ja-jp","pt-br","nb-no","sv-se","ko-kr","pl-pl","nl-nl","nl-be","zh-cn","zh-tw","zh-hk","en-ph","pt-pt","id-id","tr-tr","th-th","ar-ae","es-cl","fi-fi","hu-hu","en-sg","vi-vn","en-my","en-ie","es-ar","ar-eg","en-za","en-xl"]},42780:function(e,t,i){"use strict";i.d(t,{X:function(){return b}});var n=i(7733),o=i(57663),r=i(5884),s=i(59878),a=i(28951),l=i(88048),c=i(32308),d=i(7766),p=i(5813),u=i(62907),h=i(5302),g=i(77062),f=i(44132),v=i(22680),m=i(17395),y=i(95378);class b{constructor(e){this.treatmentQueryStringParam="Treatment",this.wpoitemsStringParam=p.hE.wpoitems,this.cardContext=e}async fetch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await this.getRequestInit(),{ocid:d,flightData:u,treatment:m,apiVersion:b="v1",scenario:w,feedCluster:S,pivotId:C,templateId:x,nextPageUrl:T}=e||{},k=(0,g.Ee)(),I=e&&("shell"===e.contextSource||"shellv2"===e.contextSource),P=I&&e.isXfeed;let $=`${b}/news/feed/windows/${x}`;$=I?this.buildShellRequest(e,$):this.buildWinWidgetsRequest(e,$);const F=new URLSearchParams((0,v.zp)()).get(p.YU)?new URL($,p.LJ):(0,l.fU)($),L="Following"===C;if(T){const t=new n.h(new URL(T).search);k>0&&t.set(g.i$,k.toString()),o.jG.SendFeedCallActivityIdInHeader||!o.jG.ActivityId||I||t.set("activityId",o.jG.ActivityId),I&&!t.get("scn")&&t.set("scn",r.Ji),L&&e.feedId&&t.get("query")&&f.M0.sendAppErrorEvent({...h.cM_,message:"Windows Card Provider's following xfeed next page url has query QSP",pb:{...h.cM_.pb,customMessage:`{ "nextPageUrl": "${T}", "feedID": "${e.feedId}" }`}}),F.search=t.toString()}else{const e=[...await this.getCommonParams(d,u)];k>0&&e.push({key:g.i$,value:k.toString()}),e.forEach((e=>e.value&&F.searchParams.set(e.key,e.value))),m&&F.searchParams.set(this.treatmentQueryStringParam,m)}if(I){F.searchParams.set("caller","peregrine");const{column:t,pivotId:i}=e||{};"following"===i&&F.searchParams.set("wposchema","byregion"),t&&F.searchParams.set("column",t)}if((e&&"winWidgets"===e.contextSource||P)&&e.feedId){const t=L&&!e.feedId.startsWith("Y_")?p.hE.providerId:p.hE.interestIds;F.searchParams.set(t,e.feedId)}L&&(F.searchParams.set(p.hE.includeFollowingFilters,"true"),e.feedId&&(F.searchParams.delete("query"),s.Al.CurrentFlightSet.has("prg-pr2fol-time")&&(F.searchParams.set(p.hE.ocid,p.i9),F.searchParams.set(p.hE.apiKey,p.S1)))),S&&(F.searchParams.set("query","UserFre"),F.searchParams.set("entityids",S),F.searchParams.set("DisableTypeSerialization","true"),F.searchParams.set("wrapodata","false")),e&&e.count&&F.searchParams.set("$top",`${e.count}`);const E=F.searchParams.get(o.jG.OneServiceContentMarketQspKey);E&&F.searchParams.set("osLocale",E),o.jG.SendFeedCallActivityIdInHeader&&F.searchParams.delete("activityId");const R=a.c.getParamsWithItems(location.search);if(R){const t=R.find((e=>"idxExperienceTypeOverride"===e.key)),i=R.find((e=>"idxContentTypeOverride"===e.key)),n=R.find((e=>"idxTreatmentOverride"===e.key)),o=R.find((e=>"idxWpoKnobidsOverride"===e.key)),r=R.find((e=>"idxWpoEventRuleOverride"===e.key));if(t&&F.searchParams.set("Experience",t.value),i){const t=e.contentType?e.contentType:"article,video,slideshow",n=[...new Set(`${t},${i.value}`.split(","))];F.searchParams.set("contentType",n.join(","))}n&&F.searchParams.set(this.treatmentQueryStringParam,n.value),o&&F.searchParams.set(this.wpoitemsStringParam,`knobids:${o.value}`),r&&F.searchParams.set(this.wpoitemsStringParam,`byPassEventRule:${r.value}`)}w&&F.searchParams.set("scenario",w),F.searchParams.sort();try{const n=await(0,c.w)((async()=>await fetch(decodeURIComponent(F.href),t)),"WindowsCardProvider.fetch"),{status:s,statusText:a}=n||{},l="Following"===C,d="following"===C,p=l&&204===s&&!F.searchParams.has("skip");if(!(n&&n.ok||l||d))return void f.M0.sendAppErrorEvent({...h.mfB,message:n?"OneService returned error response":"OneService response was null",pb:{...h.mfB.pb,fetchNetworkResponse:{statusCode:s,statusText:a,activityId:o.jG.ActivityId,requestUrl:F.href,requestHeaders:JSON.stringify(t&&t.headers),xfeed:P?`feedID: ${e.feedId} is not valid with respect to locale and market`:"not XFeed"},responseHeaders:this.getResponseHeaders(n)}});if(204===n.status&&(I&&f.M0.sendAppErrorEvent({...h.U7j,message:"OneService returned empty content 204 response",pb:{...h.U7j.pb,fetchNetworkResponse:{statusCode:n.status,statusText:n.statusText,activityId:o.jG.ActivityId,requestUrl:F.href,requestHeaders:JSON.stringify(t&&t.headers)},responseHeaders:this.getResponseHeaders(n)}}),!p))return{cards:[],netStatus:204};let u,g,v;if(n.headers){if(g=n.headers.get("X-Statics-Fallback"),g){const e={...h.kiM.pb,activityId:o.jG.ActivityId,responseHeaders:this.getResponseHeaders(n),requestUrl:F.href};P&&(e.isXFeed=1),f.M0.sendAppErrorEvent({...h.kiM,pb:e,message:"Static fallback content received"})}const e=n.headers.get(r.rD.traceId);u=f.M0.addOrUpdateIdxId(e,!T)}const m=n&&(!n.ok||204===s||404===s),y=!n||m;if(v=l&&y?await i.e("libs_oneservice-card-provider_dist_default_FollowingGridViewProng2FRE_json").then(i.t.bind(i,81096,19)):d&&y?await i.e("libs_oneservice-card-provider_dist_default_FollowingDefaultProng1FRE_json").then(i.t.bind(i,21158,19)):await n.json(),S&&v){return{layoutTemplate:e&&e.count&&24===e.count?"ShellTwoColumn-14HalfCard-HalfTopstory":"ShellTwoColumn-Four1U",cards:v.subCards}}return"winWidgets"!==e.contextSource&&!P||!v.sections||e.useRawJson?{...v,traceIdIndex:u,isStatic:g}:v.sections[0]}catch(e){const i=(0,y.Z)(t,"headers.Authorization");f.M0.sendAppErrorEvent({...h.IVG,message:"Error while fetching OneService response",pb:{...h.IVG.pb,customMessage:`Error: ${e}`,fetchNetworkResponse:{activityId:o.jG.ActivityId,requestUrl:F.href,requestHeaders:JSON.stringify(i&&i.headers)}}})}}async getRequestInit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{method:"GET"};return e.credentials="include",e.headers=await d.$D.getOneServiceFeedCallHeaders(),e}async getCommonParams(e,t){return await(0,m.XJ)()===u.Hy.SignedIn?d.$D.getOneServiceParamsWithAuth(o.jG.UserId,e,!1,t):d.$D.getOneServiceParamsWithoutAuth(o.jG.UserId,e,!1,t)}getResponseHeaders(e){return e&&e.headers?JSON.stringify({"Akamai-Request-ID":e.headers.get("Akamai-Request-ID"),"Akamai-Server-IP":e.headers.get("Akamai-Server-IP"),"X-MSEdge-Ref":e.headers.get("X-MSEdge-Ref")}):null}buildShellRequest(e,t){const{pivotId:i,isXfeed:n}=e||{};let{nextPageUrl:o}=e||{};return n&&("following"===i?(t=`${p.hZ}${p.Pg}`,o&&o.includes(p.H0)&&(o="")):e.feedId&&(t=`${p.hZ}${p.H0}`)),t}buildWinWidgetsRequest(e,t){const{feedCluster:i,pivotId:n,isXfeed:o}=e||{};let{nextPageUrl:r}=e||{};if(o)if("Following"===n)if(e.feedId)t=`${p.hZ}${p.Qs}`,f.M0.addOrUpdateTmplProperty("filtered-feed","1"),r&&(r.includes(p.kX)||r.includes(p.Td)||!r.includes(e.feedId))&&(r="");else{var s;const i="filteredChannels"===e.feedName?p.Td:p.kX;t=`${p.hZ}${i}`,null!==(s=r)&&void 0!==s&&s.includes(p.Qs)&&(r="")}else e.feedId&&(t=i?"news/feed":`${p.hZ}${p.H0}`);return t}}},49494:function(e,t,i){"use strict";i.d(t,{yV:function(){return r}});var n=i(68640),o=i(15598);new Set;function r(e){const t={time:s(),data:e};(0,o.$o)().setObject(n.Z6,t)}function s(){return Math.round(performance.timeOrigin+performance.now())}},40053:function(e,t,i){"use strict";var n;i.d(t,{S:function(){return n},PublisherServiceClient:function(){return m}}),function(e){e.More="More",e.Mute="Mute",e.Read="Read"}(n||(n={}));var o=i(16715),r=i(57663),s=i(59878),a=i(88048),l=i(7766),c=i(32308),d=i(84882),p=i(82415),u=i(51480),h=i(665),g=i(77062),f=i(62907),v=i(17395);class m{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.fetchImpl=e,this.addPageInfoToOcid=t,this.followedPublishersEndpoint="v1/News/Users/Me/PreferredProviders",this.followedSourcesEndpoint="msn/sources",this.publishersServiceEndpoint="Msn/Providers",this.actionsServiceEndpoint="Graph/Actions",this.followActionSourceEndpoint="community/follows",this.ocid="feeds"}getOcid(){return this.ocid}async getUserMutedPublishers(){const e=await this.getUserActions(n.Mute);if(!e||!e.value)return null;if(!e.value.length)return[];const t=e.value.reduce(((e,t)=>(e[t.targetId]=t,e)),{}),i=await this.getPublisherDetails(Object.keys(t));if(!i||!i.value||!i.value.length)return null;return i.value.map((e=>{const i={createdDateTime:t[e.id].createdDateTime};return{...e,...i}}))}async getUserFollowedPublishers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;const t=await this.getRequestInit(),i=[...await this.getCommonParams(),{key:"$top",value:`${e}`}],n=(0,a.PH)(this.followedPublishersEndpoint);this.appendQs(i,n),(0,o.aH)()||(0,g.s6)(n);const r=await this.sendRequest(decodeURIComponent(n.href),t,"getFollowedPublishers");return null==r?void 0:r.value}async getUserFollowedSources(){var e,t,i,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;const s=await this.getRequestInit(),l=[...await this.getCommonParams(),{key:"$top",value:`${r}`},{key:"queryType",value:"MyFeed"}],c=(0,a.PH)(this.followedSourcesEndpoint);let d;this.appendQs(l,c),(0,o.aH)()||(0,g.s6)(c);try{d=await this.sendRequest(decodeURIComponent(c.href),s,"getFollowedSources")}catch(e){throw new Error(`{url: ${c.href}}`)}return(null===(e=d)||void 0===e||null===(t=e.value)||void 0===t?void 0:t.length)>0?null===(i=d)||void 0===i||null===(n=i.value[0])||void 0===n?void 0:n.subCards.map((e=>{var t;const i=e.intAttributes&&1==e.intAttributes.disableProfile;return{...e,profileId:i?null:e.profileId,displayName:e.name,logos:[{imageLink:{href:null===(t=e.image)||void 0===t?void 0:t.url}}]}})):[]}async publisherUserAction(e,t,i){if(!e||!t)return null;const n=await this.getRequestInit();n.method=i;let o=await this.getCommonParams();"POST"===i?n.body=JSON.stringify({actionType:t,targetId:e,targetType:"SourceProvider"}):"DELETE"===i&&(o=[...o,{key:"$filter",value:`actionType eq '${t}' and targetId eq '${e}'`}]);const r=(0,a.PH)(this.actionsServiceEndpoint);this.appendQs(o,r);const s=await this.sendRequest(decodeURIComponent(r.href),n,`deleteUserAction ${t}`,!0,!0);if(s.status>=400){const i=`OneService returned error response. Status: ${s.status} for actionType: ${t}, targetId: ${e}`;throw new Error(i)}return s}async updateSourceFollowState(e,t){if(!e)return null;const i=await this.getRequestInit();let n=await this.getCommonParams();n=[...n],t?(i.method="POST",i.body=JSON.stringify({targetId:e})):(i.method="DELETE",n=[...n,{key:"targetId",value:e}]);const o=(0,a.PH)(this.followActionSourceEndpoint);this.appendQs(n,o);const r=t?"follow":"unfollow";try{return await this.sendRequest(decodeURIComponent(o.href),i,`updateSourceFollowState ${r}`,!0,!0)}catch(t){throw new Error(`OneService returned error response. Community follow service for targetId: ${e}, action: ${r}`)}}async updatePublisherReadTime(e,t,i){if(!e)return null;const o=await this.getRequestInit(),r=await this.getCommonParams(),s=n.Read;o.method="POST",o.body=JSON.stringify({actionType:s,targetType:i,targetId:e,updatedDateTime:t});const l=(0,a.PH)(this.actionsServiceEndpoint);this.appendQs(r,l);try{return await this.sendRequest(decodeURIComponent(l.href),o,`updateSourceReadTime ${s}`,!0,!0)}catch(t){throw new Error(`OneService returned error response for actionType: ${s}, targetId: ${e}`)}}async getUserPublishersReadTimes(){try{const e=await this.generatePublisherStatusRequest(void 0,n.Read);return null==e?void 0:e.value}catch(e){throw new Error("OneService returned error response for fetching followed sources read times.")}}async getUserPublisherStatus(e,t){var i;return!(null===(i=(await this.generatePublisherStatusRequest(e,t)).value)||void 0===i||!i.length)}async generatePublisherStatusRequest(e,t){const i=await this.getRequestInit();i.method="GET";const n=e?`and targetId eq '${e}'`:"";let r=await this.getCommonParams();r=[...r,{key:"$filter",value:`actionType eq '${t}' ${n} `}];const s=(0,a.PH)(this.actionsServiceEndpoint);return this.appendQs(r,s),(0,o.aH)()||(0,g.s6)(s),await this.sendRequest(decodeURIComponent(s.href),i,`getUserPublisherStatus ${t}`)}async getUserActions(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const i=await this.getRequestInit(),n=[...await this.getCommonParams(),{key:"$filter",value:`actionType eq '${e}' and deleted eq false and targetType eq 'SourceProvider'`},{key:"$top",value:`${t}`}],r=(0,a.PH)(this.actionsServiceEndpoint);return this.appendQs(n,r),(0,o.aH)()||(0,g.s6)(r),await this.sendRequest(decodeURIComponent(r.href),i,`getUserActions ${e}`)}async getPublisherDetails(e){const t=await this.getRequestInit(),i=(0,a.PH)(this.publishersServiceEndpoint),n=[...l.$D.getOneServiceParamsWithoutAuth(null,this.ocid,this.addPageInfoToOcid),{key:"ids",value:e.join(",")}];return this.appendQs(n,i),await this.sendRequest(decodeURIComponent(i.href),t,"getPublisherDetails")}async getCommonParams(){var e;"winWidgets"===r.jG.AppType&&(this.ocid="sidebar"===(null===(e=s.Al.ClientSettings)||void 0===e?void 0:e.pagetype)?"shoreline":"winp2",this.addPageInfoToOcid=!1);if((0,o.aH)())return this.getSapphireQueryParams();this.forcedApiKey&&(this.addPageInfoToOcid=!1),(0,o._3)()&&(this.ocid="OnOSkypeChannels");const t=await this.isUserSignedIn()?l.$D.getOneServiceParamsWithAuth(r.jG.UserId||r.jG.ActivityId,this.ocid,this.addPageInfoToOcid):l.$D.getOneServiceParamsWithoutAuth(r.jG.UserId||r.jG.ActivityId,this.ocid,this.addPageInfoToOcid);if(this.forcedApiKey){t.find((e=>"apikey"==e.key)).value=this.forcedApiKey}return t}getSapphireQueryParams(){const e=l.$D.getOneServiceNonDynamicParamsWithoutAuth(this.ocid,this.addPageInfoToOcid),t=(0,d._4)();return t&&(e.push({key:r.jG.OneServiceContentMarketQspKey,value:t.market}),r.jG.ShouldUseFdheadQsp&&e.push({key:"fdhead",value:t.features}),e.push({key:"activityId",value:t.activityId}),t.latitude&&t.longitude&&e.push({key:"location",value:`${t.latitude}|${t.longitude}`})),e}async getRequestInit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e&&(e={method:"GET"}),e.credentials="include",e.headers=(0,p.wq)()?await(0,u.dG)():await l.$D.getOneServiceHeaders(),e}async isUserSignedIn(){const e=(0,s.nP)().UserIsSignedIn;if(void 0!==e)return e;return await(0,v.XJ)()===f.Hy.SignedIn}async sendRequest(e,t,i,n,r){return(0,o.aH)()?await this.sapphireRequest(decodeURIComponent(e),t):await this.networkRequest(decodeURIComponent(e),t,i,n,r)}async sapphireRequest(e,t){const i={url:e,headers:t.headers,body:t.body,refresh:!0};let n;switch(t.method){case"POST":n=await(0,h.Ef)(i);break;case"DELETE":n=await(0,h.o9)(i);break;default:n=await(0,h.FM)(i)}return JSON.parse(n||"{}")}async networkRequest(e,t,i,n,o){return(0,c.w)((async()=>{const i=await this.fetchImpl(e,t);if(!i.ok)throw Error(i.statusText);return n&&(0,g.T1)(),o?i:i.json()}),i)}appendQs(e,t){e.forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}))}setForcedApiKey(e){this.forcedApiKey=e}}},51523:function(e,t,i){"use strict";i.d(t,{k:function(){return S}});var n,o=i(52185),r=i(81489),s=i(99452),a=i(33940),l=i(21215),c=i(57663);!function(e){e.MatchMedia="MatchMedia",e.BaseLayerLuminance="BaseLayerLuminance",e.External="External",e.Defalut="MatchMedia"}(n||(n={}));const d="DefaultConfig",p=Object.freeze(new Map([["windows",{notifyThemeSwitch:!0,themeSwitchNotifier:"BaseLayerLuminance"}],["edgeChromium",{notifyThemeSwitch:!0,themeSwitchNotifier:"BaseLayerLuminance"}],["winWidgets",{notifyThemeSwitch:!0,themeSwitchNotifier:"External"}],["superApp",{notifyThemeSwitch:!1,themeSwitchNotifier:"External"}],["homePage",{notifyThemeSwitch:!0,themeSwitchNotifier:"MatchMedia"}],["channel",{notifyThemeSwitch:!0,themeSwitchNotifier:"External"}],[d,{notifyThemeSwitch:!0,themeSwitchNotifier:"MatchMedia"}]]));function u(){const e=c.jG.AppType,t=p.get(e)||p.get(d);return(null==t?void 0:t.notifyThemeSwitch)??!0}var h=i(78125),g=i(30857),f=i(80303);class v{constructor(){this.mediaQueryCallback=()=>{},this.appThemeState=null}eventListener(e){this.appThemeState&&this.appThemeState.setAppInDarkMode(e.currentTarget.matches)}initialize(e){var t;return!(!this.mediaQueryList&&e)||!(null===(t=window)||void 0===t||!t.matchMedia)&&(this.mediaQueryList=window.matchMedia("(prefers-color-scheme: dark)"),!!this.mediaQueryList&&(this.appThemeState=e,this.appThemeState&&this.appThemeState.setAppInDarkMode(this.mediaQueryList.matches),this.mediaQueryCallback=this.eventListener.bind(this),this.mediaQueryList.addEventListener("change",this.mediaQueryCallback),!0))}uninitialize(){return this.mediaQueryList&&(this.mediaQueryList.removeEventListener("change",this.mediaQueryCallback),this.mediaQueryCallback=()=>{},this.mediaQueryList=void 0,this.appThemeState=null),!0}}class m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.initialized=!1,this.source=e,this.appThemeState=null}handleChange(e,t){if(this.source&&t.target===this.source){const t=e.getValueFor(this.source),i=(0,f.s)(t.toColorString())<=h.h.DarkMode;this.appThemeState&&this.appThemeState.setAppInDarkMode(i)}}updateSource(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source=e}initialize(e){if(this.initialized)return!0;if(this.appThemeState=e,!this.source){const e=document.querySelector("fluent-design-system-provider[fill-color]");if(null==e)return!1;this.source=e}const t={target:this.source,token:g.I};return this.handleChange(g.I,t),g.I.subscribe(this),this.initialized=!0,this.initialized}uninitialize(){return this.initialized&&(g.I.unsubscribe(this),this.initialized=!1,this.appThemeState=null),!0}}class y{constructor(){this.appThemeInDarkMode=!1,this.themeSwitchSubscription=null;let e=null;if((0,l.N)())switch(function(){const e=c.jG.AppType,t=p.get(e)||p.get(d);return(null==t?void 0:t.themeSwitchNotifier)??"MatchMedia"}()){case"BaseLayerLuminance":e=new m;break;case"External":break;default:e=new v}else e=new v;e&&this.setThemeSubscription(e)}setThemeSubscription(e){if(this.themeSwitchSubscription&&this.themeSwitchSubscription.uninitialize(),this.themeSwitchSubscription=e,!this.themeSwitchSubscription)return;var t;this.themeSwitchSubscription.initialize(this)||(this.themeSwitchSubscription=new v,null===(t=this.themeSwitchSubscription)||void 0===t||t.initialize(this))}setAppInDarkMode(e){this.appThemeInDarkMode=e}appInDarkMode(){return this.appThemeInDarkMode}}(0,a.gn)([s.LO],y.prototype,"appThemeInDarkMode",void 0);const b=new WeakMap;class w{constructor(){this._appThemeMode=null}get appThemeMode(){return this._appThemeMode||(this._appThemeMode=new y),this._appThemeMode}static getInstance(){return o.Gq.get("__SuperComponentThemeHelper__",(()=>new w))}setThemeSwitchSubscription(e){this.appThemeMode.setThemeSubscription(e)}setAppInDarkMode(e){this.appThemeMode.setAppInDarkMode(e)}appInDarkMode(){return this.appThemeMode.appInDarkMode()}subscribeThemeChange(e){if(!e||!this.appThemeMode||b.get(e))return;if(e.handleThemeChange(S.appInDarkMode()),!u())return;const t={handleChange:()=>{e.handleThemeChange(S.appInDarkMode())}};b.set(e,t),s.y$.getNotifier(this.appThemeMode).subscribe(t,"appThemeInDarkMode")}unsubscribeThemeChange(e){if(!u()||!e||!this.appThemeMode)return;const t=b.get(e);t&&(s.y$.getNotifier(this.appThemeMode).unsubscribe(t,"appThemeInDarkMode"),b.delete(e))}}const S=(0,r.h)(w)},88685:function(e,t,i){"use strict";i.d(t,{h:function(){return s}});var n=i(44132),o=i(33779),r=i(5302);class s{static renderToast(e){this.renderToastCallback?this.renderToastCallback(e):n.M0.sendAppErrorEvent((0,o.Tr)(r.PMq,"Undefined toast render callback function"))}static setRenderToastCallback(e){this.renderToastCallback=e,this.readyResolveFn()}static expireToast(e){this.expireToastCallback?this.expireToastCallback(e):n.M0.sendAppErrorEvent((0,o.Tr)(r.hxo,"Undefined toast expire callback function"))}static setExpireToastCallback(e){this.expireToastCallback=e}static setCurrentToast(e,t){this.currentToastId!==e&&(this.currentToastId=e,this.renderToastCallback=t,this.currentToastIdChangeCallbacks.forEach((t=>t(e))),this.renderToast())}static addCurrentToastIdChangeCallback(e){e&&this.currentToastIdChangeCallbacks.push(e)}}s.ready=new Promise((e=>s.readyResolveFn=e)),s.currentToastIdChangeCallbacks=[]},11514:function(e,t,i){"use strict";var n;i.d(t,{p:function(){return n}}),function(e){e.Save="Save",e.Unsave="Unsave",e.Mute="Mute",e.Follow="Follow",e.FollowV2="FollowV2",e.Unfollow="Unfollow",e.UnfollowV2="UnfollowV2",e.InterestFailure="InterestFailure",e.ShowMore="ShowMore",e.ShowFewer="ShowFewer",e.Hide="Hide",e.DisableNotification="DisableNotification",e.EnableNotification="EnableNotification",e.RecommendedInterestsFailure="RecommendedInterestsFailure",e.Refresh="Refresh",e.Pin="Pin",e.Unpin="Unpin",e.HideTopic="HideTopic",e.UnhideTopic="UnhideTopic",e.HideSource="HideSource",e.UnhideSource="UnhideSource",e.WindowsInformation="WindowsInformation",e.Error="Error",e.Default="Default",e.ConnectionError="ConnectionError",e.MuteError="MuteError",e.Fre="Fre",e.TuneYourFeed="TuneYourFeed",e.Report="ReportContent"}(n||(n={}))},10814:function(e,t,i){"use strict";var n;i.d(t,{K:function(){return n}}),function(e){e[e.InProgress=0]="InProgress",e[e.Loaded=1]="Loaded",e[e.Failed=2]="Failed"}(n||(n={}))},70239:function(e,t,i){"use strict";var n;i.d(t,{t:function(){return n}}),function(e){e.Followed="followed",e.Unfollowed="unfollowed",e.Locked="locked",e.None="none"}(n||(n={}))},94208:function(e,t,i){"use strict";var n;i.d(t,{A:function(){return n}}),function(e){e.consumer="consumer",e.work="work"}(n||(n={}))},24589:function(e,t,i){"use strict";var n;i.d(t,{SH:function(){return c},$A:function(){return a},Jn:function(){return l}}),function(e){e.DesktopL1="weatherdesktopl1",e.DesktopL2="weatherdesktopl2",e.PWA="weatherpwa",e.EdgeFeatured="edgefeatured",e.WINAPP="weather-app-win",e.XIAOMI="xiaomi",e.XIAOMI_ANDROID_GO="xmweather-gominus1",e.XIAOMI_BROWSER="xmweather-browser",e.SKYPE="onoskype",e.WINDOWS_HEADER_PREFIX="win",e.EDGE_ARTICLE_PREFIX="msnar"}(n||(n={}));new Set(["msedgdhphdr","msedgntphdr","msedgntp","msedgdhp","entnewsntp"]);var o=i(57663),r=i(5884);function s(e){let t;if(e instanceof URL)t=e.searchParams;else if(e instanceof URLSearchParams)t=e;else if("string"==typeof e)try{t=new URL(e).searchParams}catch(e){t=void 0}return function(e,t,i){if(e&&t){const n={value:e.get(t)||void 0};if(!n.value&&i&&i.length>0)for(let t=0;t<i.length&&(n.value=e.get(i[t])||void 0,!n.value);++t);if(!n.value){const i=t.toLowerCase();e.forEach((function(e,t){!n.value&&t.toLowerCase()===i&&e&&(n.value=e)}))}return n.value}return}(t,"ocid")}function a(e,t,i){if(!e)return null;let n;try{n=e instanceof URL?new URL(e.href):new URL(e)}catch(e){return null}if(n&&(i||n.host.includes("msn.com")||n.host.includes(".msn.cn")))for(const[e,i]of Object.entries(t))e&&i&&n.searchParams.set(e,i);return n.href}function l(e){if("edgeChromium"===o.jG.AppType)return!1;const t=s(e),i=null==t?void 0:t.toLowerCase();return r.Oj.has(i)}i(61303);function c(e,t,i){return a(e,{cvid:t,ocid:i})}},83794:function(e,t,i){"use strict";i.d(t,{q3:function(){return u},pG:function(){return p},D3:function(){return c},vc:function(){return d},s3:function(){return y},mL:function(){return v},zz:function(){return g}});var n=i(58009),o=i(84708);var r=function(e){return"number"==typeof e&&e==(0,o.Z)(e)};let s;const a="//img-s-msn-com.akamaized.net/tenant/amp/entityid/",l="//img-s.msn.cn/tenant/amp/entityid/";var c,d;!function(e){e.JPG="jpg",e.PNG="png",e.WEBP="webp"}(c||(c={})),function(e){e[e.None=0]="None",e[e.Letterbox=1]="Letterbox",e[e.Scale=2]="Scale",e[e.Stretch=3]="Stretch",e[e.Crop=4]="Crop",e[e.FocalCrop=5]="FocalCrop",e[e.FacialCrop=6]="FacialCrop"}(d||(d={}));const p=90,u="www.bing.com/th",h=new RegExp(/bing\.(com|net)\/th/);function g(e,t){return v(((0,n.PQ)()?l:a)+e,t)}const f=Math.ceil(4*Math.random())||4;function v(e,t){if(e&&h.test(e))return y(e,t);const{focalRegion:i,backgroundColor:n}=t;let{width:o=0,height:a=0,format:l=c.JPG}=t,d="";if(i){const e=w(i.x1,i.x2),t=w(i.y1,i.y2);null!=e&&null!=t&&(d+=`&x=${e}&y=${t}`)}n&&(d+=`&b=${n}`);const p=null==t.mode?6:t.mode;if(6===p&&(d+="&u=t"),t.enableDpiScaling){if(!t.devicePixelRatio)throw new Error("A valid devicePixelRatio value must be provided when DPI scaling is enabled");const e=function(e){if(b()&&s)return s;if(e<1)return null;let t=e;r(4*t)||(t=Math.ceil(10*t)/10);t>3&&(t=3);b()&&(s=t);return t}(t.devicePixelRatio);e&&(o=Math.round(o*e),a=Math.round(a*e))}return`${e}?w=${o}&h=${a}&q=${t.quality||60}&m=${p}&f=${l}${d}`}function m(e,t){(0,n.PQ)()&&(e.hostname=`ts${f}.cn.mm.bing.net`);const{width:i=0,height:o=0}=t,r=t.quality||p,s=t.crop||0===t.crop?t.crop:1;if(e.searchParams.set("w",`${i}`),e.searchParams.set("h",`${o}`),e.searchParams.set("qlt",`${r}`),e.searchParams.set("c",`${s}`),e.searchParams.set("rs","1"),t.enableDpiScaling){e.searchParams.set("dpr",`${t.devicePixelRatio}`);const i=t.padding||0;e.searchParams.set("p",`${i}`)}return e}function y(e,t){try{return m(new URL(e),t).href}catch(i){const n=m(new URL(`https://${e}`),t);return`//${n.host}${n.pathname}${n.search}`}}function b(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function w(e,t){if(null!=e&&null!=t)return Math.floor((e+t)/2)}},27545:function(e,t,i){"use strict";i.d(t,{H:function(){return s},a:function(){return n}});var n,o=i(80293);!function(e){e[e.IsSignedIn=1]="IsSignedIn",e[e.CookieConsentStatus=2]="CookieConsentStatus",e[e.OnetrustActiveCookieGroups=3]="OnetrustActiveCookieGroups",e[e.IsDarkMode=4]="IsDarkMode",e[e.ColumnArrangement=5]="ColumnArrangement",e[e.CurrentRoute=6]="CurrentRoute",e[e.TopicData=7]="TopicData",e[e.IsDocumentVisible=8]="IsDocumentVisible",e[e.IsSingleColumn=9]="IsSingleColumn"}(n||(n={}));class r extends o.v{subscribe(e,t){this.has(e)||(e===n.IsDarkMode&&this.initBrowserThemeListener(),e===n.IsDocumentVisible&&this.initBrowserVisibilityListener()),super.subscribe(e,t)}initBrowserThemeListener(){const e=matchMedia("(prefers-color-scheme:dark)");this.set(n.IsDarkMode,e.matches),e.onchange=e=>{this.set(n.IsDarkMode,e.matches)}}initBrowserVisibilityListener(){this.set(n.IsDocumentVisible,"visible"===document.visibilityState),document.addEventListener("visibilitychange",(()=>{this.set(n.IsDocumentVisible,"visible"===document.visibilityState)}))}}const s=new r("AppState")},22914:function(e,t,i){"use strict";i.d(t,{T:function(){return n}});const n=Object.freeze(function(){var e,t;const i=JSON.parse((null===(t=null===(e=document.head)||void 0===e?void 0:e.dataset)||void 0===t?void 0:t.clientSettings)||"{}"),n={activityId:i.aid||"",appType:i.apptype,categoryKey:i.categoryKey,pageType:i.pagetype,verticalKey:i.verticalKey||i.vk,ocid:i.ocid};try{if(i.locale)n.market=`${i.locale.language}-${i.locale.market}`;else{const e=location.pathname.split("/");e&&e[1]&&(n.market=e[1].toLowerCase())}}catch(e){}return n}())},66651:function(e,t,i){"use strict";i.d(t,{Iq:function(){return s},MO:function(){return o},gL:function(){return r}});var n=i(80293);const o=new n.v("WidgetLoadTracker");const r=new n.v("WidgetAppState");var s;!function(e){e[e.IsDarkMode=1]="IsDarkMode",e[e.IsDashboardVisible=2]="IsDashboardVisible",e[e.ActionMenuStrings=3]="ActionMenuStrings",e[e.IsDynamicFeed=4]="IsDynamicFeed",e[e.SessionId=5]="SessionId",e[e.NonPeregrineWidgetTelemetryObject=6]="NonPeregrineWidgetTelemetryObject",e[e.FeedRegionWidgets=7]="FeedRegionWidgets",e[e.RecommendedWidgets=8]="RecommendedWidgets",e[e.DefaultPreviewType=9]="DefaultPreviewType",e[e.IsReauthRequired=10]="IsReauthRequired",e[e.IsWindowShown=11]="IsWindowShown",e[e.FeedRefreshPromise=12]="FeedRefreshPromise",e[e.Suspended=13]="Suspended",e[e.ClientLayoutVersion=14]="ClientLayoutVersion",e[e.IsLSCachedFeedUsed=15]="IsLSCachedFeedUsed",e[e.IsExpandedViewEnabled=16]="IsExpandedViewEnabled",e[e.DelayTtvrPromise=17]="DelayTtvrPromise",e[e.TaskbarLaunchState=18]="TaskbarLaunchState",e[e.IsPreferenceMigrationComplete=19]="IsPreferenceMigrationComplete",e[e.WidgetPinnedPreferences=20]="WidgetPinnedPreferences",e[e.IsFeedsShown=21]="IsFeedsShown",e[e.BoardsNavigationState=22]="BoardsNavigationState"}(s||(s={}))},60804:function(e,t,i){"use strict";function n(e,t){const{audienceMode:i="",locale:n={},pageType:o=""}=t||{},r=n.content??n,{language:s,market:a}=r;return`wpo_data_ ${i}_${s}_${a}_${o}_${e}`}i.d(t,{_:function(){return n}})},15675:function(e,t,i){"use strict";var n;i.d(t,{_h:function(){return n}}),function(e){e.eventGleam="eventGleam",e.topSites="topsites",e.layoutPromotion="layoutPromotion",e.topSitesPromotion="topsitesPromotion",e.topsitesCollapse="topsitesCollapse",e.recommendedsitesCollapse="recommendedsitesCollapse",e.bellCoachMark="bellCoachMark",e.backupRegionStatus="backupRegionStatus",e.searchBoxCollapse="searchBoxCollapse",e.followedTopics="followedTopics",e.feedContextualFeedback="feedContextualFeedback",e.animationControl="animationControl",e.pinProngCoachMark="pinProngCoachMark",e.shorelineTrigger="shorelineTrigger",e.topNavPivotsPromotion="pivotNav"}(n||(n={}))},28052:function(e,t,i){"use strict";var n;i.d(t,{y:function(){return n}}),function(e){e[e.Router=0]="Router",e[e.ExternalLink=2]="ExternalLink",e[e.PrimeExternalLink=3]="PrimeExternalLink"}(n||(n={}))},65518:function(e,t,i){"use strict";i.d(t,{Nd:function(){return f}});var n=i(22914),o=i(27545),r=i(28052),s=i(33779),a=i(5302),l=i(81586),c=i(5884),d=i(57663),p=i(78058),u=i(24589);const h=["ocid","item","pcsonly","fdhead","pc"],g=["personalize","my-saves","experience-settings","history","notification"];const f=new class{constructor(){this.contextualNavMap=new Map,this.hamburgerMenuMap=new Map,this.market=n.T.market,this.refIds=[],this.currentUrl=new URL(window.location.href.toLowerCase()),this.currentSearchParams=new URLSearchParams(window.location.search.toLowerCase())}init(e){!this.options&&e&&(this.options=e,this.config=e.config,this.options.localizedStrings=this.options.localizedStrings||{},"/"===window.location.pathname&&(window.location.pathname=`/${this.market}${e.basePath||""}`),this.currentUrl.searchParams.delete("spapage"),this.currentSearchParams.forEach(((e,t)=>{-1===h.indexOf(t)&&this.currentUrl.searchParams.delete(t)})),this.setRoutes(this.config),this.currentRoute&&(o.H.set(o.a.CurrentRoute,this.currentRoute),this.currentRoute.renderInfo.renderType===r.y.Router&&window.history.replaceState(this.currentRoute,"",this.currentRoute.destinationUrl)))}subscribe(e){(e||"function"==typeof e)&&o.H.subscribe(o.a.CurrentRoute,e)}getCurrentRoute(){return o.H.get(o.a.CurrentRoute)}navigate(e,t){const i=o.H.get(o.a.CurrentRoute);if(i&&i.id===e)return;const n=this.getRouteById(e);if(!n)return;const r=new URL(n.destinationUrl);r.hash&&(r.hash="",n.destinationUrl=decodeURIComponent(r.toString()));const s=Object.assign(Object.assign({},n),{dynamicContext:t});history.pushState(s,n.display,n.destinationUrl),o.H.set(o.a.CurrentRoute,s)}getRouteById(e){return this.contextualNavMap.get(e)||this.hamburgerMenuMap.get(e)}addRouteToContextualNavMap(e,t){this.contextualNavMap.set(e,t)}preserveQueryParams(e){const t=e.searchParams;this.currentUrl.search&&this.currentUrl.searchParams.forEach(((i,n)=>{n=n.toLowerCase(),-1===t.getAll(n).indexOf(i)&&e.searchParams.append(n,i)})),!e.searchParams.get("ocid")&&this.options.ocid&&e.searchParams.set("ocid",this.options.ocid),!e.searchParams.get("pc")&&this.options.pc&&e.searchParams.set("pc",this.options.pc)}getQueryParamValue(e){return this.currentSearchParams.get(e)}getUrlInfo(e){const{renderType:t,path:i,externalUrl:n}=e.renderInfo;if(t===r.y.Router){if(e.id===this.config.homeNavigationItem.id)return this.getHomePageUrl();const t=`${0===i.indexOf("personalize")?"":"/interest"}/${i}`;return{url:`${window.location.origin}/${this.market}/feed${t}${this.currentUrl.search}${window.location.hash}`,path:`/${this.market}/feed${t}`}}let o;try{o=new URL(n)}catch(e){(0,s.OO)(e,a.Yg3,"Invalid URL being used",n)}return-1===o.hostname.indexOf(".msn.com")&&-1===o.hostname.indexOf(".msn.cn")||(o.hostname!==window.location.hostname&&(o=new URL(`${o.pathname}${o.search}`,window.location.origin)),this.preserveQueryParams(o)),{url:decodeURIComponent(o.toString()),path:o.pathname,searchParams:o.searchParams}}setRoutes(e){if(!e)return;const{contextualNavItems:t=[],hamburgerMenuItems:i=[],homeNavigationItem:n,interestsNavigationItem:o,followingNavigationItem:r}=e;n&&i.length&&t.length&&(this.buildNavMap(this.contextualNavMap,n),r&&this.buildNavMap(this.contextualNavMap,r),this.mapChildItems(this.hamburgerMenuMap,i),this.mapChildItems(this.contextualNavMap,t),this.buildNavMap(this.contextualNavMap,o),this.refIds.length&&this.refIds.forEach((e=>{const t=`${e}-ref`;this.contextualNavMap.set(t,Object.assign(Object.assign({},this.getRouteById(e)),{id:t}))})))}processRoute(e,t){const{id:i,display:n,displayKey:o,telemetryInfo:r,interestsWCConfigRefType:s}=e,a=o?this.options.localizedStrings[o]:n,d=this.getUrlInfo(e),u=decodeURIComponent(d.url),h=(null==r?void 0:r.navItemName)?r.navItemName:a,f=s&&g.includes(i)?(0,c.Eo)(s):void 0;f&&e.renderInfo&&(e.renderInfo.experienceConfigRef=f);const v=Object.assign(Object.assign({},e),{display:a,destinationUrl:u,parentId:t,telemetryMetadata:new p.D({name:h,action:l.Aw.Click,behavior:l.wu.Navigate,content:{headline:a},destinationUrl:u,overrideDestinationUrl:u,feed:{id:i,name:a,type:"category filter"}}).getMetadata()});return this.currentRoute&&this.currentRoute.id!==i||this.detectCurrentRoute(v,d.path,d.searchParams),v}detectCurrentRoute(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;t=t.toLowerCase();const n=this.currentUrl.pathname;if(e.selectForSubPaths&&n.startsWith(t))this.currentRoute=e;else if(n===t||n===`${t}/`){let t=!1;if(i&&i.toString()&&i.forEach(((e,i)=>{i=i.toLowerCase(),-1===this.currentSearchParams.getAll(i).indexOf(e.toLowerCase())&&(t=!0)})),t)return;this.currentRoute=e}}buildNavMap(e,t){if(!t)return;const{id:i,children:n=[],navRefId:o}=t;o?this.refIds.push(o):(e.set(i,this.processRoute(t)),this.mapChildItems(e,n,t.id))}mapChildItems(e){let t=arguments.length>2?arguments[2]:void 0;(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((i=>{if(i.navRefId)return void this.refIds.push(i.navRefId);e.set(i.id,this.processRoute(i,t));const{children:n}=i;n&&n.length&&this.mapChildItems(e,n,i.id)}))}getHomePageUrl(){return(0,u.Jn)(this.currentSearchParams)||d.jG.isMobile?{url:`https://www.msn.${window.location.hostname.endsWith(".cn")?"cn":"com"}/${this.market}${this.currentUrl.search}`,path:this.market}:{url:`${window.location.origin}/${this.market}/feed${this.currentUrl.search}`,path:`/${this.market}/feed`}}}},19628:function(e,t){"use strict";var i=function(){function e(){}return e.IsNullOrWhiteSpace=function(e){try{return null==e||"undefined"==e||e.toString().replace(/\s/g,"").length<1}catch(e){return console.log(e),!1}},e.Join=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];try{var o=i[0];if(Array.isArray(o)||o instanceof Array){for(var r=e.Empty,s=0;s<o.length;s++){var a=o[s];s<o.length-1?r+=a+t:r+=a}return r}if("object"==typeof o){var l=e.Empty,c=o;return Object.keys(o).forEach((function(e){l+=c[e]+t})),l=l.slice(0,l.length-t.length)}var d=i;return e.join.apply(e,[t].concat(d))}catch(t){return console.log(t),e.Empty}},e.Format=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];try{return t.match(e.regexNumber)?e.format(e.regexNumber,t,i):t.match(e.regexObject)?e.format(e.regexObject,t,i,!0):e.Empty}catch(t){return console.log(t),e.Empty}},e.format=function(t,i,n,o){return void 0===o&&(o=!1),i.replace(t,(function(t,i){var r,s=t.split(":");return s.length>1&&(i=s[0].replace("{",""),t=s[1].replace("}","")),null==(r=o?n[0][i]:n[i])||null==r||t.match(/{\d+}/)||void 0!==(r=e.parsePattern(t,r))&&null!=r?r:e.Empty}))},e.parsePattern=function(t,i){switch(t){case"L":return i.toLowerCase();case"U":return i.toUpperCase();case"d":if("string"==typeof i)return e.getDisplayDateFromString(i);if(i instanceof Date)return e.Format("{0:00}.{1:00}.{2:0000}",i.getDate(),i.getMonth(),i.getFullYear());break;case"s":if("string"==typeof i)return e.getSortableDateFromString(i);if(i instanceof Date)return e.Format("{0:0000}-{1:00}-{2:00}",i.getFullYear(),i.getMonth(),i.getDate());break;case"n":"string"!=typeof i&&(i=i.toString());var n=i.replace(/,/g,".");if(isNaN(parseFloat(n))||n.length<=3)break;var o=n.split(/[^0-9]+/g),r=o;o.length>1&&(r=[e.join.apply(e,[""].concat(o.splice(0,o.length-1))),o[o.length-1]]);var s=r[0],a=s.length%3,l=a>0?s.substring(0,a):e.Empty,c=s.substring(a).match(/.{3}/g);return(l=l+"."+e.Join(".",c))+(r.length>1?","+r[1]:"")}return"number"!=typeof i&&isNaN(i)||isNaN(+t)||e.IsNullOrWhiteSpace(i)?i:e.formatNumber(i,t)},e.getDisplayDateFromString=function(e){var t;if((t=e.split("-")).length<=1)return e;var i=t[t.length-1],n=t[t.length-2],o=t[t.length-3];return(i=(i=i.split("T")[0]).split(" ")[0])+"."+n+"."+o},e.getSortableDateFromString=function(t){var i=t.replace(",","").split(".");if(i.length<=1)return t;var n=i[i.length-1].split(" "),o=e.Empty;n.length>1&&(o=n[n.length-1]);var r=i[i.length-1].split(" ")[0]+"-"+i[i.length-2]+"-"+i[i.length-3];return!e.IsNullOrWhiteSpace(o)&&o.length>1?r+="T"+o:r+="T00:00:00",r},e.formatNumber=function(e,t){var i=t.length,n=e.toString();if(i<=n.length)return n;var o=i-n.length;return new Array(o+=1).join("0")+n},e.join=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];for(var o=e.Empty,r=0;r<i.length;r++)if(!("string"==typeof i[r]&&e.IsNullOrWhiteSpace(i[r])||"number"!=typeof i[r]&&"string"!=typeof i[r])){o+=""+i[r];for(var s=r+1;s<i.length;s++)if(!e.IsNullOrWhiteSpace(i[s])){o+=t,r=s-1;break}}return o},e.regexNumber=/{(\d+(:\w*)?)}/g,e.regexObject=/{(\w+(:\w*)?)}/g,e.Empty="",e}();t.Ld=i;var n=function(){function e(e){void 0===e&&(e=i.Empty),this.Values=[],this.Values=new Array(e)}return e.prototype.ToString=function(){return this.Values.join("")},e.prototype.Append=function(e){this.Values.push(e)},e.prototype.AppendFormat=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.Values.push(i.Format.apply(i,[e].concat(t)))},e.prototype.Clear=function(){this.Values=[]},e}()},45991:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 1.75a.75.75 0 00-1.5 0V5H1.75a.75.75 0 000 1.5H5v3.25a.75.75 0 001.5 0V6.5h3.25a.75.75 0 000-1.5H6.5V1.75z"></path></svg>'},66747:function(e){e.exports='<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 2.5a.5.5 0 00-1 0V7H2.5a.5.5 0 000 1H7v4.5a.5.5 0 001 0V8h4.5a.5.5 0 000-1H8V2.5z"></path></svg>'},53095:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M5.7 3.28A1 1 0 004 4v4.02a1 1 0 001.7.7l2.04-2a1 1 0 000-1.42l-2.04-2z"></path></svg>'},3379:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M9.76 3.2c.3.29.32.76.04 1.06l-4.25 4.5a.75.75 0 01-1.08.02L2.22 6.53a.75.75 0 011.06-1.06l1.7 1.7L8.7 3.24a.75.75 0 011.06-.04z"></path></svg>'},52296:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.03 13.9L3.56 10a.75.75 0 00-1.12 1l4 4.5c.29.32.79.34 1.09.03l10.5-10.5a.75.75 0 00-1.06-1.06l-9.94 9.94z"></path></svg>'},13022:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a8 8 0 110 16 8 8 0 010-16zm3.36 5.65a.5.5 0 00-.64-.06l-.07.06L9 11.3 7.35 9.65l-.07-.06a.5.5 0 00-.7.7l.07.07 2 2 .07.06c.17.11.4.11.56 0l.07-.06 4-4 .07-.08a.5.5 0 00-.06-.63z"></path></svg>'},72546:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a8 8 0 110 16 8 8 0 010-16zm0 1a7 7 0 100 14 7 7 0 000-14zm3.36 4.65c.17.17.2.44.06.63l-.06.07-4 4a.5.5 0 01-.64.07l-.07-.06-2-2a.5.5 0 01.63-.77l.07.06L9 11.3l3.65-3.65c.2-.2.51-.2.7 0z"></path></svg>'},9555:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M2.15 4.65c.2-.2.5-.2.7 0L6 7.79l3.15-3.14a.5.5 0 11.7.7l-3.5 3.5a.5.5 0 01-.7 0l-3.5-3.5a.5.5 0 010-.7z"></path></svg>'},42251:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 01-.7-.7L12.8 10 7.65 4.85a.5.5 0 010-.7z"></path></svg>'},16061:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M2.15 7.35c.2.2.5.2.7 0L6 4.21l3.15 3.14a.5.5 0 10.7-.7l-3.5-3.5a.5.5 0 00-.7 0l-3.5 3.5a.5.5 0 000 .7z"></path></svg>'},41067:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4.09 4.22l.06-.07a.5.5 0 01.63-.06l.07.06L10 9.29l5.15-5.14a.5.5 0 01.63-.06l.07.06c.18.17.2.44.06.63l-.06.07L10.71 10l5.14 5.15c.18.17.2.44.06.63l-.06.07a.5.5 0 01-.63.06l-.07-.06L10 10.71l-5.15 5.14a.5.5 0 01-.63.06l-.07-.06a.5.5 0 01-.06-.63l.06-.07L9.29 10 4.15 4.85a.5.5 0 01-.06-.63l.06-.07-.06.07z"></path></svg>'},93530:function(e){e.exports='<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 .5A4.5 4.5 0 0110.5 5c0 1.86-1.42 3.81-4.2 5.9a.5.5 0 01-.6 0C2.92 8.81 1.5 6.86 1.5 5A4.5 4.5 0 016 .5zm0 3a1.5 1.5 0 100 3 1.5 1.5 0 000-3z"></path></svg>'},2850:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5c0-.28.22-.5.5-.5h15a.5.5 0 010 1h-15a.5.5 0 01-.5-.5zm0 5c0-.28.22-.5.5-.5h15a.5.5 0 010 1h-15a.5.5 0 01-.5-.5zm.5 4.5a.5.5 0 000 1h15a.5.5 0 000-1h-15z"></path></svg>'},7508:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6 4a2 2 0 00-2 2v8c0 1.1.9 2 2 2h8a2 2 0 002-2v-2.5a.5.5 0 011 0V14a3 3 0 01-3 3H6a3 3 0 01-3-3V6a3 3 0 013-3h2.5a.5.5 0 010 1H6zm5-.5c0-.28.22-.5.5-.5h5c.28 0 .5.22.5.5v5a.5.5 0 01-1 0V4.7l-4.15 4.15a.5.5 0 01-.7-.7L15.29 4H11.5a.5.5 0 01-.5-.5z"></path></svg>'},56933:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-1 0c0-1.75-.64-3.36-1.7-4.58l-9.88 9.87A7 7 0 0017 10zM4.7 14.58l9.88-9.87a7 7 0 00-9.87 9.87z"></path></svg>'},4310:function(e){e.exports='<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M9.3 10.02a4.5 4.5 0 11.7-.7l3.85 3.83a.5.5 0 01-.7.7L9.3 10.02zM10 6.5a3.5 3.5 0 10-7 0 3.5 3.5 0 007 0z"></path></svg>'},30118:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.1 2.9a1 1 0 011.8 0l1.93 3.91 4.31.63a1 1 0 01.56 1.7l-.55.54a5.5 5.5 0 00-7.96 6.26l-3.05 1.6a1 1 0 01-1.45-1.05l.74-4.3L2.3 9.14a1 1 0 01.56-1.7l4.31-.63L9.1 2.9zM19 14.5a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zm-4-2a.5.5 0 00-1 0V14h-1.5a.5.5 0 100 1H14v1.5a.5.5 0 101 0V15h1.5a.5.5 0 100-1H15v-1.5z"></path></svg>'},87055:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.1 2.9a1 1 0 011.8 0l1.93 3.91 4.31.63a1 1 0 01.56 1.7l-.55.54a5.46 5.46 0 00-1-.43l.85-.82-4.32-.63a1 1 0 01-.75-.55L10 3.35l-1.93 3.9a1 1 0 01-.75.55L3 8.43l3.12 3.04a1 1 0 01.3.89l-.75 4.3 3.35-1.76c.02.36.08.7.17 1.04l-3.05 1.6a1 1 0 01-1.45-1.05l.74-4.3L2.3 9.14a1 1 0 01.56-1.7l4.31-.63L9.1 2.9zM19 14.5a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zm-4-2a.5.5 0 00-1 0V14h-1.5a.5.5 0 100 1H14v1.5a.5.5 0 101 0V15h1.5a.5.5 0 100-1H15v-1.5z"></path></svg>'},26810:function(e,t,i){"use strict";i.d(t,{Z:function(){return o},j:function(){return n}});const n=Object.freeze({prefix:"msft",shadowRootMode:"open",registry:customElements}),o=Object.freeze({prefix:"msn",shadowRootMode:"open",registry:customElements})},10711:function(e,t,i){"use strict";i.d(t,{U:function(){return o}});var n=i(31699);const o=i(31393).K.create({guards:{aspects:{[n.O.property]:{innerHTML:(e,t,i,n)=>function(e,t,i){for(var o=arguments.length,r=new Array(o>3?o-3:0),s=3;s<o;s++)r[s-3]=arguments[s];n(e,t,i,...r)}}}}})},64546:function(e,t,i){"use strict";i.d(t,{D3:function(){return N}});var n=i(26810),o=i(33940),r=i(31289),s=i(33818),a=i(42590),l=i(99452),c=i(23526),d=i(28904);class p extends d.H{}class u extends((0,c.Um)(p)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class h extends u{constructor(){super(...arguments),this.clearButtonCallback=()=>{},this.clearButtonFocusCallback=()=>{},this.clearButtonBlurCallback=()=>{}}readOnlyChanged(){this.proxy instanceof HTMLElement&&(this.proxy.readOnly=this.readOnly)}autocompleteChanged(){this.proxy instanceof HTMLElement&&(this.proxy.autocomplete=this.autocomplete)}autofocusChanged(){this.proxy instanceof HTMLElement&&(this.proxy.autofocus=this.autofocus)}placeholderChanged(){this.proxy instanceof HTMLElement&&(this.proxy.placeholder=this.placeholder)}maxlengthChanged(){this.proxy instanceof HTMLElement&&(this.proxy.maxLength=this.maxlength)}minlengthChanged(){this.proxy instanceof HTMLElement&&(this.proxy.minLength=this.minlength)}sizeChanged(){this.proxy instanceof HTMLElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLElement&&(this.proxy.spellcheck=this.spellcheck)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}valueChanged(){this.$fastController.isConnected&&this.setFormValue(this.value),this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.$emit("change")}submitSearch(){var e;this.$emit("submit"),null===(e=this.form)||void 0===e||e.submit()}connectedCallback(){super.connectedCallback(),this.autofocus&&this.focus(),this.setFormValue(this.value,this.value)}handleTextInput(){this.control&&null!==this.control.value&&(this.value=this.control.value)}onFocus(){this.enableClearButton&&(this.showClearButton=!0)}onBlurs(){this.enableClearButton&&(this.showClearButton=!1)}clearBtnOnFocus(){this.clearButtonFocusCallback()}clearBtnOnBlurs(){this.clearButtonBlurCallback()}clearValue(){this.control&&(this.control.value="",this.clearButtonCallback())}}(0,o.gn)([(0,a.Lj)({attribute:"readonly",mode:"boolean"})],h.prototype,"readOnly",void 0),(0,o.gn)([a.Lj],h.prototype,"autocomplete",void 0),(0,o.gn)([(0,a.Lj)({mode:"boolean"})],h.prototype,"autofocus",void 0),(0,o.gn)([a.Lj],h.prototype,"placeholder",void 0),(0,o.gn)([(0,a.Lj)({converter:a.Id})],h.prototype,"maxlength",void 0),(0,o.gn)([(0,a.Lj)({converter:a.Id})],h.prototype,"minlength",void 0),(0,o.gn)([(0,a.Lj)({converter:a.Id})],h.prototype,"size",void 0),(0,o.gn)([(0,a.Lj)({mode:"boolean"})],h.prototype,"spellcheck",void 0),(0,o.gn)([(0,a.Lj)({mode:"boolean"})],h.prototype,"isOnImage",void 0),(0,o.gn)([(0,a.Lj)({attribute:"clear-title"})],h.prototype,"clearTitle",void 0),(0,o.gn)([(0,a.Lj)({attribute:"clear-label"})],h.prototype,"clearLabel",void 0),(0,o.gn)([(0,a.Lj)({mode:"boolean"})],h.prototype,"enableClearButton",void 0),(0,o.gn)([l.LO],h.prototype,"showClearButton",void 0),(0,o.gn)([l.LO],h.prototype,"clearButtonCallback",void 0),(0,o.gn)([l.LO],h.prototype,"clearButtonFocusCallback",void 0),(0,o.gn)([l.LO],h.prototype,"clearButtonBlurCallback",void 0),(0,o.gn)([(0,a.Lj)({attribute:"button-label"})],h.prototype,"buttonLabel",void 0),(0,o.gn)([l.LO],h.prototype,"buttonTelemetryTag",void 0),(0,o.gn)([l.LO],h.prototype,"inputTelemetryTag",void 0),(0,o.gn)([l.LO],h.prototype,"defaultSlottedNodes",void 0),(0,r.e)(h,s.hW);var g=i(49218),f=i(41472),v=i(93703),m=i(20697);var y=i(27186),b=i(67739),w=i(24484),S=i(29717),C=i(55135),x=i(53131),T=i(27460),k=i(62734),I=i(74449),P=i(40009),$=i(42689),F=i(38665),L=i(26738),E=i(22674),R=i(78923),A=i(22798),O=i(46179);const M=R.i` fluent-button{border-radius:0 var(--search-box-radius) var(--search-box-radius) 0}.searchoptions{right:70px}`,U=R.i` fluent-button{border-radius:var(--search-box-radius) 0 0 var(--search-box-radius)}.searchoptions{left:70px}`,D=R.i`
${(0,y.j)("inline-flex")} :host{--search-box-radius:calc(${C.UW} * 2px);
font-family: ${x.S};
outline: none;
user-select: none;
--elevation: 4;
border-radius: var(--search-box-radius);
transition: all 0.2s ease-in-out;
position: relative;
background: ${T.s};
${k.XC}}.root{box-sizing:border-box;position:relative;display:flex;flex-direction:row;color:${I.Q};border-radius:var(--search-box-radius) 0 0 var(--search-box-radius)}.control{-webkit-appearance:none;background:transparent;border:0;margin-top:auto;margin-bottom:auto;border:none;padding:calc(${P._5} * 2px + 2px) 12px;
color: ${$.C};
${""} font-size:15px;font-weight:400;letter-spacing:inherit;line-height:24px;width:100%;word-spacing:inherit;z-index:1}.searchoptions{position:absolute;z-index:900}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-results-button,input[type="search"]::-webkit-search-results-decoration{display:none}.control:hover,.control:${b.b},.control:disabled,.control:active{outline:none}.before-content,.after-content{${""} width: 16px;
height: 16px;
margin: auto;
fill: ${$.C}}.end-slot{display:flex;justify-content:center;align-items:center}fluent-button{height:auto;position:relative}fluent-button.stealth{background:transparent}fluent-button.stealth:hover{background:${F.Qp}}fluent-button::part(control){padding-right:24px !important;padding-left:24px !important}:host(:hover:not([disabled])){--elevation:6;${k.XC}}:host([isonimage]) .end-slot slot[name="end"] > svg{fill:${L.go}}:host([isonimage]) fluent-button.stealth:hover{background:transparent}:host([disabled]) .label,:host([readOnly]) .label,:host([readOnly]) .control,:host([disabled]) .control{cursor:${w.H}}:host([disabled]){opacity:var(--disabled-opacity)}:host([disabled]) fluent-button{pointer-events:none}`.withBehaviors(new E.O(M,U),(0,O.U)(R.i` :host([isonimage]) .end-slot slot[name="end"] > svg{fill:${$.C};
}
`),(0,S.vF)(R.i` :host{forced-color-adjust:none;background:${A.H.Field};
box-shadow: ${A.H.FieldText} 0px 0px 0px 1px}:host(:hover:not([disabled])){box-shadow:${A.H.Highlight} 0px 0px 0px 1px}:host([isonimage]) .end-slot slot[name="end"] > svg{fill:${A.H.ButtonText}}:host([isonimage]) fluent-button.stealth:hover svg{fill:${A.H.HighlightText}}:host([disabled]){box-shadow:${A.H.GrayText} 0px 0px 0px 1px;opacity:1}:host([disabled]) .label,input::placeholder{color:${A.H.GrayText}}:host([disabled]) fluent-button::part(control){background:${A.H.ButtonFace};
color: ${A.H.GrayText};fill:currentColor}.control{color:${A.H.FieldText};
fill: currentColor;
}
`)),N=h.compose({name:`${n.j.prefix}-search-box`,template:(H={endContent:g.dy`
<svg
width="20"
height="20"
viewBox="3 3 14 14"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.5 3a5.5 5.5 0 014.23 9.02l4.12 4.13a.5.5 0 01-.63.76l-.07-.06-4.13-4.12A5.5 5.5 0 118.5 3zm0 1a4.5 4.5 0 100 9 4.5 4.5 0 000-9z"
/>
</svg>
`,clearContent:g.dy`<svg width="18" height="18" viewBox="0 0 12 12"><path d="M6.85 6 12 11.15l-.85.85L6 6.85.85 12 0 11.15 5.15 6 0 .85.85 0 6 5.15 11.15 0l.85.85L6.85 6Z"></path></svg>`},g.dy`<template tabindex="${e=>e.disabled?null:0}" class=" ${e=>e.readOnly?"readonly":""} ${e=>e.isOnImage?"onimage":""} " @focus=${e=>e.onFocus()} @blur=${e=>e.onBlurs()}><div class="root" part="root">${m.h}<input class="control" part="control" type="search" id="${e=>e.id}" title="${e=>e.title}" name="${e=>e.name}" @input=${e=>e.handleTextInput()} aria-label="${e=>e.title}" placeholder=${e=>e.placeholder} autocomplete=${e=>e.autocomplete} ?required=${e=>e.required} ?disabled=${e=>e.disabled} ?readonly=${e=>e.readOnly} maxlength="${e=>e.maxlength}" minlength="${e=>e.minlength}" ?spellcheck="${e=>e.spellcheck}" :value="${e=>e.value}" ${(0,f.i)("control")} data-t="${e=>e.inputTelemetryTag}" /></div><div class="searchoptions"><slot name="search-options"></slot></div>${(0,v.g)((e=>e.showClearButton),g.dy`<fluent-button title="${e=>e.clearTitle}" aria-label="${e=>e.clearLabel}" part="button" appearance="${e=>e.isOnImage?"stealth":"accent"}" @focus=${e=>e.clearBtnOnFocus()} @blur=${e=>e.clearBtnOnBlurs()} @click="${e=>e.clearValue()}" @keypress=${(e,t)=>e.clearValue()}><span part="end" class="end-slot" ${(0,f.i)("endContainer")}><slot name="end" ${(0,f.i)("end")} @slotchange=${e=>e.handleEndContentChange()}>${H.clearContent||""}</slot></span></fluent-button>`)} ${(0,v.g)((e=>!e.showClearButton),g.dy`<fluent-button part="button" title=${e=>e.buttonLabel} aria-label=${e=>e.buttonLabel} tabIndex=${e=>e.disabled?"-1":"0"} appearance="${e=>e.isOnImage?"stealth":"accent"}" @click="${e=>e.submitSearch()}" @keypress="${e=>e.submitSearch()}" data-t="${e=>e.buttonTelemetryTag}"><span part="end" class="end-slot" ${(0,f.i)("endContainer")}><slot name="end" ${(0,f.i)("end")} @slotchange=${e=>e.handleEndContentChange()}>${H.endContent||""}</slot></span></fluent-button>`)}</template>`),styles:D,shadowOptions:{delegatesFocus:!0}});var H},46179:function(e,t,i){"use strict";i.d(t,{U:function(){return n}});const n=i(29717).KJ.with(window.matchMedia("(prefers-color-scheme: dark)"))},80303:function(e,t,i){"use strict";i.d(t,{Y:function(){return c},s:function(){return l}});var n=i(30857),o=i(78125),r=i(11162),s=i(60279);const a=(0,i(9791).Z)((e=>{let t=(0,r.in)(e);if(null!==t)return t;if(t=(0,r.hg)(e),null!==t)return t;throw new Error(`${e} cannot be converted to a ColorRGBA64. Color strings must be one of the following formats: "#RGB", "#RRGGBB", or "rgb(r, g, b)"`)}));function l(e){return(0,s.hM)(a(e))}class c{constructor(e,t){this.cache=new WeakMap,this.light=e,this.dark=t}connectedCallback(e){this.attach(e.source)}disconnectedCallback(e){const t=this.cache.get(e.source);t&&n.I.unsubscribe(t)}attach(e){const t=this.cache.get(e)||new d(this.light,this.dark,e),i=n.I.getValueFor(e);n.I.subscribe(t),t.attach(i),this.cache.set(e,t)}}class d{constructor(e,t,i){this.light=e,this.dark=t,this.source=i,this.attached=null}handleChange(e,t){try{this.attach("default"===t.target?e.default:e.getValueFor(this.source))}catch{}}attach(e){if(window.matchMedia("(forced-colors: active)").matches)return;const t=l(e.toColorString())<=o.h.DarkMode?"dark":"light";this.attached!==this[t]&&(null!==this.attached&&this.source.$fastController.removeStyles(this.attached),this.attached=this[t],null!==this.attached&&this.source.$fastController.addStyles(this.attached))}}},20697:function(e,t,i){"use strict";i.d(t,{h:function(){return r},z:function(){return o}});var n=i(49218);const o=n.dy`
<span part="end" class="end">
<slot name="end"></slot>
</span>
`,r=n.dy`
<span part="start" class="start">
<slot name="start"></slot>
</span>
`},79896:function(e,t,i){"use strict";i.d(t,{D:function(){return U}});var n=i(63070),o=i(33940),r=i(42590),s=i(99452),a=i(33714),l=i(33818),c=i(31289),d=i(28904),p=i(23526);class u extends d.H{}class h extends((0,p.Um)(u)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const g="submit",f="reset";class v extends h{constructor(){super(...arguments),this.handleSubmission=()=>{if(!this.form)return;const e=this.proxy.isConnected;e||this.attachProxy(),"function"==typeof this.form.requestSubmit?this.form.requestSubmit(this.proxy):this.proxy.click(),e||this.detachProxy()},this.handleFormReset=()=>{this.form?.reset()},this.handleUnsupportedDelegatesFocus=()=>{window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&this.$fastController.definition.shadowOptions?.delegatesFocus&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,t){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),t===g&&this.addEventListener("click",this.handleSubmission),e===g&&this.removeEventListener("click",this.handleSubmission),t===f&&this.addEventListener("click",this.handleFormReset),e===f&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus()}}(0,o.gn)([(0,r.Lj)({mode:"boolean"}),(0,o.w6)("design:type",Boolean)],v.prototype,"autofocus",void 0),(0,o.gn)([(0,r.Lj)({attribute:"form"}),(0,o.w6)("design:type",String)],v.prototype,"formId",void 0),(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],v.prototype,"formaction",void 0),(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],v.prototype,"formenctype",void 0),(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],v.prototype,"formmethod",void 0),(0,o.gn)([(0,r.Lj)({mode:"boolean"}),(0,o.w6)("design:type",Boolean)],v.prototype,"formnovalidate",void 0),(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],v.prototype,"formtarget",void 0),(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],v.prototype,"type",void 0),(0,o.gn)([s.LO,(0,o.w6)("design:type",Array)],v.prototype,"defaultSlottedContent",void 0);class m{}(0,o.gn)([(0,r.Lj)({attribute:"aria-expanded"}),(0,o.w6)("design:type",Object)],m.prototype,"ariaExpanded",void 0),(0,o.gn)([(0,r.Lj)({attribute:"aria-pressed"}),(0,o.w6)("design:type",Object)],m.prototype,"ariaPressed",void 0),(0,c.e)(m,a.v),(0,c.e)(v,l.hW,m);class y extends v{constructor(){super(...arguments),this.iconOnly=!1}appearanceChanged(e,t){e!==t&&(this.classList.add(t),this.classList.remove(e))}connectedCallback(){super.connectedCallback(),this.appearance||(this.appearance="neutral")}defaultSlottedContentChanged(){const e=this.defaultSlottedContent.filter((e=>e.nodeType===Node.ELEMENT_NODE));1===e.length&&e[0]instanceof SVGElement?this.control.classList.add("icon-only"):this.control.classList.remove("icon-only")}}(0,o.gn)([r.Lj,(0,o.w6)("design:type",String)],y.prototype,"appearance",void 0),(0,o.gn)([(0,r.Lj)({attribute:"icon-only",mode:"boolean"}),(0,o.w6)("design:type",Boolean)],y.prototype,"iconOnly",void 0);var b=i(78923),w=i(24484),S=i(29717),C=i(22798),x=i(45597),T=i(82636),k=i(10970),I=i(35680),P=i(958),$=i(26738),F=i(28632),L=i(38665);const E=b.i`
:host([disabled]),
:host([disabled]:hover),
:host([disabled]:active) {
opacity: ${k.V};
background-color: ${I.wF};
cursor: ${w.H};
}
${x.G6}
`.withBehaviors((0,S.vF)(b.i`
:host([disabled]),
:host([disabled]:hover),
:host([disabled]:active),
:host([disabled]) .control,
:host([disabled]) .control:hover,
:host([appearance="neutral"][disabled]:hover) .control {
forced-color-adjust: none;
background-color: ${C.H.ButtonFace};
border-color: ${C.H.GrayText};
color: ${C.H.GrayText};
opacity: 1;
}
`),(0,T.H)("accent",b.i`
:host([appearance="accent"][disabled]),
:host([appearance="accent"][disabled]:hover),
:host([appearance="accent"][disabled]:active) {
background: ${P.Av};
}
${x.jQ}
`.withBehaviors((0,S.vF)(b.i`
:host([appearance="accent"][disabled]) .control,
:host([appearance="accent"][disabled]) .control:hover {
background: ${C.H.ButtonFace};
border-color: ${C.H.GrayText};
color: ${C.H.GrayText};
}
`))),(0,T.H)("lightweight",b.i`
:host([appearance="lightweight"][disabled]:hover),
:host([appearance="lightweight"][disabled]:active) {
background-color: transparent;
color: ${$.go};
}
:host([appearance="lightweight"][disabled]) .content::before,
:host([appearance="lightweight"][disabled]:hover) .content::before,
:host([appearance="lightweight"][disabled]:active) .content::before {
background: transparent;
}
${x.vt}
`.withBehaviors((0,S.vF)(b.i`
:host([appearance="lightweight"][disabled]) .control {
forced-color-adjust: none;
color: ${C.H.GrayText};
}
:host([appearance="lightweight"][disabled])
.control:hover
.content::before {
background: none;
}
`))),(0,T.H)("outline",b.i`
:host([appearance="outline"][disabled]:hover),
:host([appearance="outline"][disabled]:active) {
background: transparent;
border-color: ${F.ak};
}
${x.O8}
`.withBehaviors((0,S.vF)(b.i`
:host([appearance="outline"][disabled]) .control {
border-color: ${C.H.GrayText};
}
`))),(0,T.H)("stealth",b.i`
:host([appearance="stealth"][disabled]),
:host([appearance="stealth"][disabled]:hover),
:host([appearance="stealth"][disabled]:active) {
background: ${L.jq};
}
${x.cg}
`.withBehaviors((0,S.vF)(b.i`
:host([appearance="stealth"][disabled]),
:host([appearance="stealth"][disabled]:hover) {
background: ${C.H.ButtonFace};
}
:host([appearance="stealth"][disabled]) .control {
background: ${C.H.ButtonFace};
border-color: transparent;
color: ${C.H.GrayText};
}
`))));var R=i(49218),A=i(41472),O=i(47548);const M=function(e={}){return R.dy`
<button
class="control"
part="control"
?autofocus="${e=>e.autofocus}"
?disabled="${e=>e.disabled}"
form="${e=>e.formId}"
formaction="${e=>e.formaction}"
formenctype="${e=>e.formenctype}"
formmethod="${e=>e.formmethod}"
?formnovalidate="${e=>e.formnovalidate}"
formtarget="${e=>e.formtarget}"
name="${e=>e.name}"
type="${e=>e.type}"
value="${e=>e.value}"
aria-atomic="${e=>e.ariaAtomic}"
aria-busy="${e=>e.ariaBusy}"
aria-controls="${e=>e.ariaControls}"
aria-current="${e=>e.ariaCurrent}"
aria-describedby="${e=>e.ariaDescribedby}"
aria-details="${e=>e.ariaDetails}"
aria-disabled="${e=>e.ariaDisabled}"
aria-errormessage="${e=>e.ariaErrormessage}"
aria-expanded="${e=>e.ariaExpanded}"
aria-flowto="${e=>e.ariaFlowto}"
aria-haspopup="${e=>e.ariaHaspopup}"
aria-hidden="${e=>e.ariaHidden}"
aria-invalid="${e=>e.ariaInvalid}"
aria-keyshortcuts="${e=>e.ariaKeyshortcuts}"
aria-label="${e=>e.ariaLabel}"
aria-labelledby="${e=>e.ariaLabelledby}"
aria-live="${e=>e.ariaLive}"
aria-owns="${e=>e.ariaOwns}"
aria-pressed="${e=>e.ariaPressed}"
aria-relevant="${e=>e.ariaRelevant}"
aria-roledescription="${e=>e.ariaRoledescription}"
${(0,A.i)("control")}
>
${(0,l.m9)(e)}
<span class="content" part="content">
<slot ${(0,O.Q)("defaultSlottedContent")}></slot>
</span>
${(0,l.LC)(e)}
</button>
`}(),U=y.compose({name:`${n.H.prefix}-button`,template:M,styles:E,shadowOptions:{delegatesFocus:!0}})},27153:function(e,t,i){"use strict";i.d(t,{a:function(){return r},y:function(){return o}});var n=i(64087);function o(e,t){return e.colorContrast(t,3.5)}function r(e,t,i){return e.colorContrast(i,3.5,e.closestIndexOf(e.source),-1*(0,n.a)(t))}},55024:function(e,t,i){"use strict";i.d(t,{b:function(){return r}});var n=i(65799),o=i(7771);class r extends n.n{connectedCallback(){super.connectedCallback(),"mobile"!==this.view&&this.$fastController.addStyles(o.P)}}},7771:function(e,t,i){"use strict";i.d(t,{P:function(){return l},W:function(){return c}});var n=i(78923),o=i(27186),r=i(22674);const s=n.i`
.scroll-prev {
right: auto;
left: 0;
}
.scroll.scroll-next::before,
.scroll-next .scroll-action {
left: auto;
right: 0;
}
.scroll.scroll-next::before {
background: linear-gradient(to right, transparent, var(--scroll-fade-next));
}
.scroll-next .scroll-action {
transform: translate(50%, -50%);
}
`,a=n.i`
.scroll.scroll-next {
right: auto;
left: 0;
}
.scroll.scroll-next::before {
background: linear-gradient(to right, var(--scroll-fade-next), transparent);
left: auto;
right: 0;
}
.scroll.scroll-prev::before {
background: linear-gradient(to right, transparent, var(--scroll-fade-previous));
}
.scroll-prev .scroll-action {
left: auto;
right: 0;
transform: translate(50%, -50%);
}
`,l=n.i`
.scroll-area {
position: relative;
}
div.scroll-view {
overflow-x: hidden;
}
.scroll {
bottom: 0;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
user-select: none;
width: 100px;
}
.scroll.disabled {
display: none;
}
.scroll::before,
.scroll-action {
left: 0;
position: absolute;
}
.scroll::before {
background: linear-gradient(to right, var(--scroll-fade-previous), transparent);
content: "";
display: block;
height: 100%;
width: 100%;
}
.scroll-action {
pointer-events: auto;
right: auto;
top: 50%;
transform: translate(-50%, -50%);
}
::slotted(fluent-flipper) {
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
.scroll-area:hover ::slotted(fluent-flipper) {
opacity: 1;
}
`.withBehaviors(new r.O(s,a)),c=n.i`
${(0,o.j)("block")} :host {
--scroll-align: center;
--scroll-item-spacing: 4px;
contain: layout;
position: relative;
}
.scroll-view {
overflow-x: auto;
scrollbar-width: none;
}
::-webkit-scrollbar {
display: none;
}
.content-container {
align-items: var(--scroll-align);
display: inline-flex;
flex-wrap: nowrap;
position: relative;
}
.content-container ::slotted(*) {
margin-right: var(--scroll-item-spacing);
}
.content-container ::slotted(*:last-child) {
margin-right: 0;
}
`},45597:function(e,t,i){"use strict";i.d(t,{G6:function(){return x},O8:function(){return P},Xu:function(){return k},cg:function(){return $},jQ:function(){return T},vt:function(){return I}});var n=i(78923),o=i(27186),r=i(67739),s=i(29717),a=i(22798),l=i(2658),c=i(53131),d=i(27782),p=i(35680),u=i(42689),h=i(55135),g=i(40009),f=i(26512),v=i(17993),m=i(958),y=i(23132),b=i(26741),w=i(26738),S=i(28632),C=i(38665);const x=n.i`
${(0,o.j)("inline-flex")} :host {
font-family: ${c.S};
outline: none;
font-size: ${d.c};
line-height: ${d.R};
height: calc(${l.i} * 1px);
min-width: calc(${l.i} * 1px);
background-color: ${p.wF};
color: ${u.C};
border-radius: calc(${h.UW} * 1px);
fill: currentcolor;
cursor: pointer;
}
.control {
background: transparent;
height: inherit;
flex-grow: 1;
box-sizing: border-box;
display: inline-flex;
justify-content: center;
align-items: center;
padding: 0 calc((10 + (${g._5} * 2 * ${g.hV})) * 1px);
white-space: nowrap;
outline: none;
text-decoration: none;
border: calc(${f.H} * 1px) solid transparent;
color: inherit;
border-radius: inherit;
fill: inherit;
cursor: inherit;
font-family: inherit;
}
.control,
::slotted([slot="end"]),
::slotted([slot="start"]) {
font: inherit;
}
:host([icon-only]) .control,
.control.icon-only {
padding: 0;
line-height: 0;
}
:host(:hover) {
background-color: ${p.Xi};
}
:host(:active) {
background-color: ${p.Gy};
}
${""}
.control:${r.b} {
border: calc(${f.H} * 1px) solid ${v.yG};
box-shadow: 0 0 0 calc((${f.vx} - ${f.H}) * 1px)
${v.yG};
}
.control::-moz-focus-inner {
border: 0;
}
.content {
pointer-events: none;
}
::slotted([slot="start"]),
::slotted([slot="end"]) {
display: flex;
pointer-events: none;
}
::slotted(svg) {
${""} width: 16px;
height: 16px;
pointer-events: none;
}
::slotted([slot="start"]) {
margin-inline-end: 11px;
}
::slotted([slot="end"]) {
margin-inline-start: 11px;
}
`.withBehaviors((0,s.vF)(n.i`
:host,
:host([appearance="neutral"]) .control {
background-color: ${a.H.ButtonFace};
border-color: ${a.H.ButtonText};
color: ${a.H.ButtonText};
fill: currentcolor;
}
:host(:not([disabled][href]):hover),
:host([appearance="neutral"]:not([disabled]):hover) .control {
forced-color-adjust: none;
background-color: ${a.H.Highlight};
color: ${a.H.HighlightText};
}
.control:${r.b},
:host([appearance="outline"]) .control:${r.b},
:host([appearance="neutral"]:${r.b}) .control {
forced-color-adjust: none;
background-color: ${a.H.Highlight};
border-color: ${a.H.ButtonText};
box-shadow: 0 0 0 calc((${f.vx} - ${f.H}) * 1px) ${a.H.ButtonText};
color: ${a.H.HighlightText};
}
.control:not([disabled]):hover,
:host([appearance="outline"]) .control:hover {
border-color: ${a.H.ButtonText};
}
:host([href]) .control {
border-color: ${a.H.LinkText};
color: ${a.H.LinkText};
}
:host([href]) .control:hover,
:host(.neutral[href]) .control:hover,
:host(.outline[href]) .control:hover,
:host([href]) .control:${r.b}{
forced-color-adjust: none;
background: ${a.H.ButtonFace};
border-color: ${a.H.LinkText};
box-shadow: 0 0 0 1px ${a.H.LinkText} inset;
color: ${a.H.LinkText};
fill: currentcolor;
}
`)),T=n.i`
:host([appearance="accent"]) {
background: ${m.Av};
color: ${y.w4};
}
:host([appearance="accent"]:hover) {
background: ${m.OC};
color: ${y.lJ};
}
:host([appearance="accent"]:active) .control:active {
background: ${m.UE};
color: ${y.Pp};
}
:host([appearance="accent"]) .control:${r.b} {
box-shadow: 0 0 0 calc(${f.vx} * 1px) inset ${b.a2},
0 0 0 calc((${f.vx} - ${f.H}) * 1px) ${v.yG};
}
`.withBehaviors((0,s.vF)(n.i`
:host([appearance="accent"]) .control {
forced-color-adjust: none;
background: ${a.H.Highlight};
color: ${a.H.HighlightText};
}
:host([appearance="accent"]) .control:hover,
:host([appearance="accent"]:active) .control:active {
background: ${a.H.HighlightText};
border-color: ${a.H.Highlight};
color: ${a.H.Highlight};
}
:host([appearance="accent"]) .control:${r.b} {
border-color: ${a.H.ButtonText};
box-shadow: 0 0 0 2px ${a.H.HighlightText} inset;
}
:host([appearance="accent"][href]) .control {
background: ${a.H.LinkText};
color: ${a.H.HighlightText};
}
:host([appearance="accent"][href]) .control:hover {
background: ${a.H.ButtonFace};
border-color: ${a.H.LinkText};
box-shadow: none;
color: ${a.H.LinkText};
fill: currentcolor;
}
:host([appearance="accent"][href]) .control:${r.b} {
border-color: ${a.H.LinkText};
box-shadow: 0 0 0 2px ${a.H.HighlightText} inset;
}
`)),k=n.i`
:host([appearance="hypertext"]) {
height: auto;
font-size: inherit;
line-height: inherit;
background: transparent;
min-width: 0;
}
:host([appearance="hypertext"]) .control {
display: inline;
padding: 0;
border: none;
box-shadow: none;
border-radius: 0;
line-height: 1;
}
:host a.control:not(:link) {
background-color: transparent;
cursor: default;
}
:host([appearance="hypertext"]) .control:link,
:host([appearance="hypertext"]) .control:visited {
background: transparent;
color: ${w.go};
border-bottom: calc(${f.H} * 1px) solid ${w.go};
}
:host([appearance="hypertext"]) .control:hover {
border-bottom-color: ${w.D9};
}
:host([appearance="hypertext"]) .control:active {
border-bottom-color: ${w.VN};
}
:host([appearance="hypertext"]) .control:${r.b} {
border-bottom: calc(${f.vx} * 1px) solid ${v.yG};
margin-bottom: calc(calc(${f.H} - ${f.vx}) * 1px);
}
`.withBehaviors((0,s.vF)(n.i`
:host([appearance="hypertext"]) .control:${r.b} {
color: ${a.H.LinkText};
border-bottom-color: ${a.H.LinkText};
}
`)),I=n.i`
:host([appearance="lightweight"]) {
background: transparent;
color: ${w.go};
}
:host([appearance="lightweight"]) .control {
padding: 0;
height: initial;
border: none;
box-shadow: none;
border-radius: 0;
}
:host([appearance="lightweight"]:hover) {
color: ${w.D9};
}
:host([appearance="lightweight"]:active) {
color: ${w.VN};
}
:host([appearance="lightweight"]) .content {
position: relative;
}
:host([appearance="lightweight"]) .content::before {
content: "";
display: block;
height: calc(${f.H} * 1px);
position: absolute;
top: calc(1em + 3px);
width: 100%;
}
:host([appearance="lightweight"]:hover) .content::before {
background: ${w.D9};
}
:host([appearance="lightweight"]:active) .content::before {
background: ${w.VN};
}
:host([appearance="lightweight"]) .control:${r.b} .content::before {
background: ${u.C};
height: calc(${f.vx} * 1px);
}
`.withBehaviors((0,s.vF)(n.i`
:host([appearance="lightweight"]) {
color: ${a.H.ButtonText};
}
:host([appearance="lightweight"]) .control:hover,
:host([appearance="lightweight"]) .control:${r.b} {
forced-color-adjust: none;
background: ${a.H.ButtonFace};
color: ${a.H.Highlight};
}
:host([appearance="lightweight"]) .control:hover .content::before,
:host([appearance="lightweight"]) .control:${r.b} .content::before {
background: ${a.H.Highlight};
}
:host([appearance="lightweight"][href]) .control:hover,
:host([appearance="lightweight"][href]) .control:${r.b} {
background: ${a.H.ButtonFace};
box-shadow: none;
color: ${a.H.LinkText};
}
:host([appearance="lightweight"][href]) .control:hover .content::before,
:host([appearance="lightweight"][href]) .control:${r.b} .content::before {
background: ${a.H.LinkText};
}
`)),P=n.i`
:host([appearance="outline"]) {
background: transparent;
border-color: ${S.ak};
}
:host([appearance="outline"]:hover) {
border-color: ${S.QP};
}
:host([appearance="outline"]:active) {
border-color: ${S.c1};
}
:host([appearance="outline"]) .control {
border-color: inherit;
}
:host([appearance="outline"]) .control:${r.b} {
box-shadow: 0 0 0 calc((${f.vx} - ${f.H}) * 1px)
${v.yG};
border-color: ${v.yG};
}
`.withBehaviors((0,s.vF)(n.i`
:host([appearance="outline"]) {
border-color: ${a.H.ButtonText};
}
:host([appearance="outline"][href]) {
border-color: ${a.H.LinkText};
}
`)),$=n.i`
:host([appearance="stealth"]) {
background: ${C.jq};
}
:host([appearance="stealth"]:hover) {
background: ${C.Qp};
}
:host([appearance="stealth"]:active) {
background: ${C.sG};
}
`.withBehaviors((0,s.vF)(n.i`
:host([appearance="stealth"]),
:host([appearance="stealth"]) .control {
forced-color-adjust: none;
background: ${a.H.ButtonFace};
border-color: transparent;
color: ${a.H.ButtonText};
fill: currentcolor;
}
:host([appearance="stealth"]:hover) .control {
background: ${a.H.Highlight};
border-color: ${a.H.Highlight};
color: ${a.H.HighlightText};
fill: currentcolor;
}
:host([appearance="stealth"]:${r.b}) .control {
background: ${a.H.Highlight};
box-shadow: 0 0 0 1px ${a.H.Highlight};
color: ${a.H.HighlightText};
fill: currentcolor;
}
:host([appearance="stealth"][href]) .control {
color: ${a.H.LinkText};
}
:host([appearance="stealth"]:hover[href]) .control,
:host([appearance="stealth"]:${r.b}[href]) .control {
background: ${a.H.LinkText};
border-color: ${a.H.LinkText};
color: ${a.H.HighlightText};
fill: currentcolor;
}
:host([appearance="stealth"]:${r.b}[href]) .control {
box-shadow: 0 0 0 1px ${a.H.LinkText};
}
`))},17416:function(e,t,i){"use strict";i.d(t,{D:function(){return M}});var n=i(58481),o=i(63070),r=i(78923),s=i(27186),a=i(67739),l=i(24484),c=i(29717),d=i(22798),p=i(2658),u=i(22674),h=i(26512),g=i(40009),f=i(42689),v=i(38665),m=i(53131),y=i(17993),b=i(55135),w=i(27782),S=i(10970),C=i(35680),x=i(26738),T=i(52704);const k=T.L.create("tree-item-expand-collapse-hover",(e=>{const t=e(v.DF);return t.evaluate(e,t.evaluate(e).hover).hover})),I=T.L.create("tree-item-expand-collapse-selected-hover",(e=>{const t=e(C.At);return e(v.DF).evaluate(e,t.evaluate(e).rest).hover})),P=r.i`
.expand-collapse-glyph {
transform: rotate(0deg);
}
:host([nested]) .expand-collapse-button {
left: var(--expand-collapse-button-nested-width, calc(${p.i} * -1px));
}
:host([selected])::after {
left: calc(${h.vx} * 1px);
}
:host([expanded]) > .positioning-region .expand-collapse-glyph {
transform: rotate(45deg);
}
`,$=r.i`
.expand-collapse-glyph {
transform: rotate(180deg);
}
:host([nested]) .expand-collapse-button {
right: var(--expand-collapse-button-nested-width, calc(${p.i} * -1px));
}
:host([selected])::after {
right: calc(${h.vx} * 1px);
}
:host([expanded]) > .positioning-region .expand-collapse-glyph {
transform: rotate(135deg);
}
`,F=r.j`((${g.nf} / 2) * ${g._5}) + ((${g._5} * ${g.hV}) / 2)`,L=r.i`
${(0,s.j)("block")} :host {
contain: content;
position: relative;
outline: none;
color: ${f.C};
background: ${v.jq};
cursor: pointer;
font-family: ${m.S};
--expand-collapse-button-size: calc(${p.i} * 1px);
--tree-item-nested-width: 0;
}
:host(:focus) > .positioning-region {
outline: none;
}
:host(:focus) .content-region {
outline: none;
}
.positioning-region {
display: flex;
position: relative;
box-sizing: border-box;
border: calc(${h.H} * 1px) solid transparent;
height: calc((${p.i} + 1) * 1px);
}
:host(:${a.b}) .positioning-region {
border: calc(${h.H} * 1px) solid ${y.yG};
border-radius: calc(${b.UW} * 1px);
color: ${f.C};
}
.positioning-region::before {
content: "";
display: block;
width: var(--tree-item-nested-width);
flex-shrink: 0;
}