@maestro_io/maestro-web-sdk 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/1.maestro-web-sdk.esm.js +1 -1
  2. package/dist/1.maestro-web-sdk.esm.js.map +1 -1
  3. package/dist/10.maestro-web-sdk.esm.js +1 -1
  4. package/dist/10.maestro-web-sdk.esm.js.map +1 -1
  5. package/dist/11.maestro-web-sdk.esm.js +1 -1
  6. package/dist/11.maestro-web-sdk.esm.js.map +1 -1
  7. package/dist/12.maestro-web-sdk.esm.js +1 -1
  8. package/dist/12.maestro-web-sdk.esm.js.map +1 -1
  9. package/dist/13.maestro-web-sdk.esm.js +1 -1
  10. package/dist/13.maestro-web-sdk.esm.js.map +1 -1
  11. package/dist/14.maestro-web-sdk.esm.js +1 -1
  12. package/dist/14.maestro-web-sdk.esm.js.map +1 -1
  13. package/dist/15.maestro-web-sdk.esm.js +1 -1
  14. package/dist/15.maestro-web-sdk.esm.js.map +1 -1
  15. package/dist/16.maestro-web-sdk.esm.js +1 -1
  16. package/dist/16.maestro-web-sdk.esm.js.map +1 -1
  17. package/dist/17.maestro-web-sdk.esm.js +1 -1
  18. package/dist/17.maestro-web-sdk.esm.js.map +1 -1
  19. package/dist/18.maestro-web-sdk.esm.js +1 -1
  20. package/dist/18.maestro-web-sdk.esm.js.map +1 -1
  21. package/dist/19.maestro-web-sdk.esm.js +1 -1
  22. package/dist/19.maestro-web-sdk.esm.js.map +1 -1
  23. package/dist/2.maestro-web-sdk.esm.js +1 -1
  24. package/dist/20.maestro-web-sdk.esm.js +1 -1
  25. package/dist/20.maestro-web-sdk.esm.js.map +1 -1
  26. package/dist/21.maestro-web-sdk.esm.js +1 -1
  27. package/dist/21.maestro-web-sdk.esm.js.map +1 -1
  28. package/dist/22.maestro-web-sdk.esm.js +1 -1
  29. package/dist/22.maestro-web-sdk.esm.js.map +1 -1
  30. package/dist/23.maestro-web-sdk.esm.js +1 -1
  31. package/dist/23.maestro-web-sdk.esm.js.map +1 -1
  32. package/dist/24.maestro-web-sdk.esm.js +1 -1
  33. package/dist/24.maestro-web-sdk.esm.js.map +1 -1
  34. package/dist/25.maestro-web-sdk.esm.js +1 -1
  35. package/dist/25.maestro-web-sdk.esm.js.map +1 -1
  36. package/dist/26.maestro-web-sdk.esm.js +1 -1
  37. package/dist/26.maestro-web-sdk.esm.js.map +1 -1
  38. package/dist/27.maestro-web-sdk.esm.js +1 -1
  39. package/dist/27.maestro-web-sdk.esm.js.map +1 -1
  40. package/dist/28.maestro-web-sdk.esm.js +1 -1
  41. package/dist/28.maestro-web-sdk.esm.js.map +1 -1
  42. package/dist/29.maestro-web-sdk.esm.js +1 -1
  43. package/dist/29.maestro-web-sdk.esm.js.map +1 -1
  44. package/dist/3.maestro-web-sdk.esm.js +1 -1
  45. package/dist/3.maestro-web-sdk.esm.js.map +1 -1
  46. package/dist/30.maestro-web-sdk.esm.js +1 -1
  47. package/dist/30.maestro-web-sdk.esm.js.map +1 -1
  48. package/dist/31.maestro-web-sdk.esm.js +1 -1
  49. package/dist/31.maestro-web-sdk.esm.js.map +1 -1
  50. package/dist/32.maestro-web-sdk.esm.js +1 -1
  51. package/dist/32.maestro-web-sdk.esm.js.map +1 -1
  52. package/dist/33.maestro-web-sdk.esm.js +1 -1
  53. package/dist/33.maestro-web-sdk.esm.js.map +1 -1
  54. package/dist/34.maestro-web-sdk.esm.js +1 -1
  55. package/dist/34.maestro-web-sdk.esm.js.map +1 -1
  56. package/dist/35.maestro-web-sdk.esm.js +1 -1
  57. package/dist/35.maestro-web-sdk.esm.js.map +1 -1
  58. package/dist/36.maestro-web-sdk.esm.js +1 -1
  59. package/dist/36.maestro-web-sdk.esm.js.map +1 -1
  60. package/dist/37.maestro-web-sdk.esm.js +1 -1
  61. package/dist/37.maestro-web-sdk.esm.js.map +1 -1
  62. package/dist/38.maestro-web-sdk.esm.js +1 -1
  63. package/dist/38.maestro-web-sdk.esm.js.map +1 -1
  64. package/dist/39.maestro-web-sdk.esm.js +2 -0
  65. package/dist/39.maestro-web-sdk.esm.js.map +1 -0
  66. package/dist/4.maestro-web-sdk.esm.js +1 -1
  67. package/dist/4.maestro-web-sdk.esm.js.map +1 -1
  68. package/dist/40.maestro-web-sdk.esm.js +2 -0
  69. package/dist/40.maestro-web-sdk.esm.js.map +1 -0
  70. package/dist/5.maestro-web-sdk.esm.js +1 -1
  71. package/dist/5.maestro-web-sdk.esm.js.map +1 -1
  72. package/dist/6.maestro-web-sdk.esm.js +1 -1
  73. package/dist/6.maestro-web-sdk.esm.js.map +1 -1
  74. package/dist/7.maestro-web-sdk.esm.js +1 -1
  75. package/dist/7.maestro-web-sdk.esm.js.map +1 -1
  76. package/dist/8.maestro-web-sdk.esm.js +1 -1
  77. package/dist/8.maestro-web-sdk.esm.js.map +1 -1
  78. package/dist/9.maestro-web-sdk.esm.js +1 -1
  79. package/dist/9.maestro-web-sdk.esm.js.map +1 -1
  80. package/dist/index.d.ts +4 -1
  81. package/dist/maestro-web-sdk.esm.js +3 -3
  82. package/dist/maestro-web-sdk.esm.js.map +1 -1
  83. package/dist/maestro-web-sdk.umd.js +3 -3
  84. package/dist/maestro-web-sdk.umd.js.map +1 -1
  85. package/dist/package.json +1 -1
  86. package/dist/src/components/atoms/SvgIcon/AddIcon.d.ts +3 -0
  87. package/dist/src/components/atoms/SvgIcon/AddIcon.js +6 -0
  88. package/dist/src/components/atoms/SvgIcon/Icon.js +2 -0
  89. package/dist/src/components/core/PanelManager/PanelManager.js +5 -3
  90. package/dist/src/components/molecules/NetworkDialog/NetworkDialog.d.ts +11 -0
  91. package/dist/src/components/molecules/NetworkDialog/NetworkDialog.js +34 -0
  92. package/dist/src/components/molecules/NetworkDialog/index.d.ts +2 -0
  93. package/dist/src/components/molecules/NetworkDialog/index.js +2 -0
  94. package/dist/src/components/molecules/NetworkError/NetworkError.d.ts +104 -0
  95. package/dist/src/components/molecules/NetworkError/NetworkError.js +26 -0
  96. package/dist/src/components/molecules/NetworkError/index.d.ts +2 -0
  97. package/dist/src/components/molecules/NetworkError/index.js +2 -0
  98. package/dist/src/components/molecules/PanelNavButton/PanelNavButton.d.ts +1 -0
  99. package/dist/src/components/molecules/PanelNavButton/PanelNavButton.js +16 -7
  100. package/dist/src/components/organisms/PanelNavigation/PanelNavigation.d.ts +1 -0
  101. package/dist/src/components/organisms/PanelNavigation/PanelNavigation.js +11 -7
  102. package/dist/src/development/MaestroEventDelegate.js +1 -0
  103. package/dist/src/helpers/site.d.ts +1 -0
  104. package/dist/src/helpers/site.js +6 -0
  105. package/dist/src/helpers/siteConfig.d.ts +1 -0
  106. package/dist/src/helpers/siteConfig.js +5 -0
  107. package/dist/src/models/IPanel.d.ts +1 -1
  108. package/dist/src/models/IPanel.js +1 -1
  109. package/dist/src/modules/espn/bets/view/BetsView.js +1 -1
  110. package/dist/src/modules/espn/components/TabLoadError/TabLoadError.d.ts +96 -0
  111. package/dist/src/modules/espn/components/TabLoadError/TabLoadError.js +14 -0
  112. package/dist/src/modules/espn/components/TabLoadError/index.d.ts +2 -0
  113. package/dist/src/modules/espn/components/TabLoadError/index.js +2 -0
  114. package/dist/src/modules/espn/fantasy/components/TournamentOverflowQR/TournamentOverflowQR.d.ts +5 -5
  115. package/dist/src/modules/espn/fantasy/components/TournamentOverflowQR/TournamentOverflowQR.js +7 -73
  116. package/dist/src/modules/espn/fantasy/services/FantasyService.js +1 -1
  117. package/dist/src/modules/espn/fantasy/view/FantasyItemView.js +1 -1
  118. package/dist/src/modules/espn/fantasy/view/FantasyView.js +1 -1
  119. package/dist/src/modules/espn/key-plays/view/KeyPlayErrorStateView.js +1 -1
  120. package/dist/src/modules/espn/shop/view/ShopView.js +1 -1
  121. package/dist/src/modules/espn/stats/view/StatsView.js +1 -1
  122. package/dist/src/modules/fox/components/TabLoadError/TabLoadError.d.ts +96 -0
  123. package/dist/src/modules/fox/components/TabLoadError/TabLoadError.js +19 -0
  124. package/dist/src/modules/fox/components/TabLoadError/index.d.ts +2 -0
  125. package/dist/src/modules/fox/components/TabLoadError/index.js +2 -0
  126. package/dist/src/modules/fox/multi-view/interfaces/IMultiViewViewModel.d.ts +3 -0
  127. package/dist/src/modules/fox/multi-view/interfaces/IMultiViewViewModel.js +1 -0
  128. package/dist/src/modules/fox/multi-view/services/MultiViewService.d.ts +99 -0
  129. package/dist/src/modules/fox/multi-view/services/MultiViewService.js +94 -0
  130. package/dist/src/modules/fox/multi-view/types.d.ts +29 -43
  131. package/dist/src/modules/fox/multi-view/types.js +79 -82
  132. package/dist/src/modules/fox/multi-view/view/CuratedMultiview/CuratedMultiviews.d.ts +8 -0
  133. package/dist/src/modules/fox/multi-view/view/CuratedMultiview/CuratedMultiviews.js +91 -0
  134. package/dist/src/modules/fox/multi-view/view/CuratedMultiview/index.d.ts +2 -0
  135. package/dist/src/modules/fox/multi-view/view/CuratedMultiview/index.js +2 -0
  136. package/dist/src/modules/fox/multi-view/view/FoxMultiView.d.ts +1 -0
  137. package/dist/src/modules/fox/multi-view/view/FoxMultiView.js +62 -2
  138. package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/CustomMultiviewStreamsCard.d.ts +122 -0
  139. package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/CustomMultiviewStreamsCard.js +51 -0
  140. package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/index.d.ts +2 -0
  141. package/dist/src/modules/fox/multi-view/view/components/CustomMultiviewStreamsCard/index.js +2 -0
  142. package/dist/src/modules/fox/multi-view/view/components/LayoutSelector/LayoutSelector.d.ts +1 -1
  143. package/dist/src/modules/fox/multi-view/view/components/LayoutSelector/LayoutSelector.js +11 -14
  144. package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/CuratedMultiviewCard.d.ts +101 -0
  145. package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/CuratedMultiviewCard.js +21 -0
  146. package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/index.d.ts +2 -0
  147. package/dist/src/modules/fox/multi-view/view/components/curated-multiview-card/index.js +2 -0
  148. package/dist/src/modules/fox/multi-view/view-model/MultiViewViewModel.d.ts +63 -0
  149. package/dist/src/modules/fox/multi-view/view-model/MultiViewViewModel.js +328 -0
  150. package/dist/src/modules/fox/multi-view/view-model/index.d.ts +1 -0
  151. package/dist/src/modules/fox/multi-view/view-model/index.js +1 -0
  152. package/dist/src/services/NetworkManager/NetworkManager.js +1 -1
  153. package/dist/src/services/NetworkManager/errors.d.ts +3 -1
  154. package/dist/src/services/NetworkManager/errors.js +15 -1
  155. package/dist/src/services/StaticService/StaticService.js +1 -0
  156. package/dist/src/view-models/MaestroEventViewModel.d.ts +2 -0
  157. package/dist/src/view-models/MaestroEventViewModel.js +17 -1
  158. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{102:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return i}));const s=e=>e.toLowerCase().trim().replace(/[\s\W-]+/g,"-").replace(/^-+|-+$/g,"");function i(e){let t=0;for(let a=0;a<e.length;a++){t=(t<<5)-t+e.charCodeAt(a),t&=t}return t}},120:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));const s=e=>"product"===e.type},238:function(e,t,a){"use strict";a.r(t),a.d(t,"ShopViewModel",(function(){return k}));var s=a(3),i=a(34);function r(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var s=a.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var o=class{constructor(e){r(this,"networkManager",void 0),r(this,"eventId",void 0),this.eventId=e,this.networkManager=new i.b({externalBaseURL:"https://site.api.espn.com"})}pollShopData(e,t,a){return this.networkManager.pollExternalApiRequestWithHeaders({endpoint:`/apis/site/v2/events/${this.eventId}/shop`,interval:e,method:i.a.GET,params:{},headers:{},onData:t,onError:a})}},n=a(33),l=a(120);const c={shop:[{sections:[{title:"Chiefs Shop",items:[{type:"product",name:"Men's Kansas City Chiefs Patrick Mahomes Nike Red Game Player Jersey",image:{href:"https://fanatics.frgimages.com/kansas-city-chiefs/mens-kansas-city-chiefs-patrick-mahomes-nike-red-game-player-jersey_pi3453000_ff_3453170-8a4fb50f27b4aacd8c3b_full.jpg"},price:{displayRetail:"$119.99"},detail:{title:"Chiefs Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/chiefs-mahomes-jersey",link:{href:"https://fanatics.com/chiefs-mahomes-jersey",text:"Scan to shop"}}},{type:"product",name:"Kansas City Chiefs New Era 2024 AFC Conference Champions Locker Room 9FORTY Adjustable Hat - Red",image:{href:"https://fanatics.frgimages.com/kansas-city-chiefs/kansas-city-chiefs-new-era-2024-afc-conference-champions-locker-room-9forty-adjustable-hat-red_pi5595000_ff_5595784_full.jpg"},price:{displayRetail:"$34.99",displaySale:"$24.99"},detail:{title:"Chiefs Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/chiefs-hat",link:{href:"https://fanatics.com/chiefs-hat",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all Chiefs merch",image:{href:"https://a.espncdn.com/i/teamlogos/nfl/500/kc.png"},detail:{title:"Chiefs Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/chiefs",link:{href:"https://fanatics.com/chiefs",text:"Scan to browse all"}}}]},{title:"49ers Shop",items:[{type:"product",name:"Men's San Francisco 49ers Brock Purdy Nike Scarlet Game Player Jersey",image:{href:"https://fanatics.frgimages.com/san-francisco-49ers/mens-san-francisco-49ers-brock-purdy-nike-scarlet-game-player-jersey_pi5068000_ff_5068449_full.jpg"},price:{displayRetail:"$119.99"},detail:{title:"49ers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/49ers-purdy-jersey",link:{href:"https://fanatics.com/49ers-purdy-jersey",text:"Scan to shop"}}},{type:"product",name:"Men's San Francisco 49ers George Kittle Nike Scarlet Game Player Jersey",image:{href:"https://fanatics.frgimages.com/san-francisco-49ers/mens-san-francisco-49ers-george-kittle-nike-scarlet-game-player-jersey_pi4234000_ff_4234524_full.jpg"},price:{displayRetail:"$119.99",displayClearance:"$79.99"},detail:{title:"49ers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/49ers-kittle-jersey",link:{href:"https://fanatics.com/49ers-kittle-jersey",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all 49ers merch",image:{href:"https://a.espncdn.com/i/teamlogos/nfl/500/sf.png"},detail:{title:"49ers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/49ers",link:{href:"https://fanatics.com/49ers",text:"Scan to browse all"}}}]},{title:"NFL Shop",items:[{type:"product",name:"NFL Nike Official Authentic Game Football",image:{href:"https://fanatics.frgimages.com/nfl/nfl-nike-official-authentic-game-football_pi4759000_ff_4759291_full.jpg"},price:{displayRetail:"$99.99"},detail:{title:"NFL Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/nfl-football",link:{href:"https://fanatics.com/nfl-football",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all NFL merch",image:{href:"https://a.espncdn.com/i/teamlogos/leagues/500/nfl.png"},detail:{title:"NFL Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/nfl",link:{href:"https://fanatics.com/nfl",text:"Scan to browse all"}}}]}]}]},p={shop:[{sections:[{title:"Lakers Shop",items:[{type:"product",name:"Men's Los Angeles Lakers LeBron James Nike Purple Swingman Jersey - Icon Edition",image:{href:"https://fanatics.frgimages.com/los-angeles-lakers/mens-los-angeles-lakers-lebron-james-nike-purple-swingman-jersey-icon-edition_pi4548000_ff_4548764_full.jpg"},price:{displayRetail:"$129.99"},detail:{title:"Lakers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/lakers-lebron-jersey",link:{href:"https://fanatics.com/lakers-lebron-jersey",text:"Scan to shop"}}},{type:"product",name:"Men's Los Angeles Lakers Anthony Davis Nike Gold Swingman Jersey - City Edition",image:{href:"https://fanatics.frgimages.com/los-angeles-lakers/mens-los-angeles-lakers-anthony-davis-nike-gold-swingman-jersey-city-edition_pi5129000_ff_5129446_full.jpg"},price:{displayRetail:"$129.99"},detail:{title:"Lakers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/lakers-davis-jersey",link:{href:"https://fanatics.com/lakers-davis-jersey",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all Lakers merch",image:{href:"https://a.espncdn.com/i/teamlogos/nba/500/lal.png"},detail:{title:"Lakers Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/lakers",link:{href:"https://fanatics.com/lakers",text:"Scan to browse all"}}}]}]}]},h={shop:[{sections:[{title:"Texas Football Shop",items:[{type:"product",name:"Texas Longhorns Champion University Tee - Burnt Orange",image:{href:"https://fanatics.frgimages.com/texas-longhorns/texas-longhorns-champion-university-tee-burnt-orange_pi4892000_ff_4892615_full.jpg"},price:{displayRetail:"$34.99"},detail:{title:"Texas Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/texas-tee",link:{href:"https://fanatics.com/texas-tee",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all Texas merch",image:{href:"https://a.espncdn.com/i/teamlogos/ncaa/500/251.png"},detail:{title:"Texas Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/texas",link:{href:"https://fanatics.com/texas",text:"Scan to browse all"}}}]},{title:"Texas A&M Shop",items:[{type:"product",name:"Texas A&M Aggies New Era Maroon 9FORTY Adjustable Hat",image:{href:"https://fanatics.frgimages.com/texas-am-aggies/texas-am-aggies-new-era-maroon-9forty-adjustable-hat_pi4156000_ff_4156429_full.jpg"},price:{displayRetail:"$29.99"},detail:{title:"Texas A&M Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/texas-am-hat",link:{href:"https://fanatics.com/texas-am-hat",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all Texas A&M merch",image:{href:"https://a.espncdn.com/i/teamlogos/ncaa/500/245.png"},detail:{title:"Texas A&M Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/texas-am",link:{href:"https://fanatics.com/texas-am",text:"Scan to browse all"}}}]}]}]},f={shop:[{sections:[],defaultItem:{detail:{disclaimer:"Visit shop.espn.com to explore more products and exclusive offers.",title:"Shop the ESPN Store",backgroundImage:"https://placedog.net/568x704"}}}]},d={shop:[{sections:[{title:"Team Shop",items:[{type:"product",name:"Premium Team Jersey - Official Merchandise",image:{href:"https://via.placeholder.com/400x400/0066cc/ffffff?text=Team+Jersey"},price:{displayRetail:"$89.99"},detail:{title:"Team Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/team-jersey",link:{href:"https://fanatics.com/team-jersey",text:"Scan to shop"}}},{type:"browse",name:"Want More?",caption:"Browse all team merch",image:{href:"https://via.placeholder.com/400x400/0066cc/ffffff?text=Team+Logo"},detail:{title:"Team Shop",qrCode:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://fanatics.com/team",link:{href:"https://fanatics.com/team",text:"Scan to browse all"}}}]}]}]};var m=a(4),u=a(102);function v(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var s=a.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class g{constructor(e){v(this,"polling",{interval:3e4,task:null,lastResponseHash:null}),v(this,"shopService",void 0),this.shopService=e}refresh(e){this.stop(),this.start(e)}stop(){this.polling.task&&(this.polling.task.stop(),this.polling.task=null)}removeLastResponseHash(){this.polling.lastResponseHash=null}start(e){try{this.polling.task=this.shopService.pollShopData(this.polling.interval,t=>{this.updateInterval(t.headers,e),this.processPolledData(t.data,e)},e=>this.handlePollingError(e))}catch(e){Object(m.a)(e,{context:"ShopViewModel.pollShop"}),console.error("[SHOP] Error setting up shop polling:",e)}}updateInterval(e,t){const a=this.getResponseHeaderPollingIntervalValue(e);a&&a!==this.polling.interval&&(console.log(`[SHOP] Updating shop polling interval from ${this.polling.interval}ms to ${a}ms`),this.polling.interval=a,this.refresh(t))}getResponseHeaderPollingIntervalValue(e){const t=e["polling-interval"];if(!t)return null;const a=parseInt(t,10);return isNaN(a)||a<=0?(console.warn(`[SHOP] Invalid polling interval header received: ${t}.`),null):1e3*a}processPolledData(e,t){const a=Object(u.b)(JSON.stringify(e));this.polling.lastResponseHash!==a?(this.polling.lastResponseHash=a,t(e)):console.log("[SHOP] Shop Response hash is the same as last successful response - skipping update")}handlePollingError(e){console.error("[SHOP] Shop polling error:",e),Object(m.a)(e,{context:"ShopViewModel.pollShop",extra:{pollingInterval:this.polling.interval}})}}var y=a(8);function S(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var s=a.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class k extends n.a{constructor(e,t,a={}){super(),S(this,"sections",new s.a([])),S(this,"isDataLoading",new s.a(!0)),S(this,"errorState",new s.a("none")),S(this,"hasEverSuccessfullyLoaded",new s.a(!1)),S(this,"promoData",new s.a(null)),S(this,"shopService",void 0),S(this,"analyticsService",void 0),S(this,"shopPolling",void 0),S(this,"useMockData",!1),S(this,"mockDataType","nfl"),S(this,"initialized",!1),this.shopService=new o(e),this.analyticsService=t,this.shopPolling=new g(this.shopService),this.useMockData=a.useMockData||!1,this.mockDataType=a.mockDataType||"nfl"}init(){this.trackPanelView(),this.fetchNewData(),this.initialized=!0}cleanup(){this.shopPolling.stop(),this.initialized=!1}async trackPanelView(){try{var e;const t=(null===(e=y.default.getMaestroEventViewModel().statsViewModel)||void 0===e?void 0:e.currentGameState.value)||"unknown";await this.analyticsService.panelView("espnShop",{game_state:[t]})}catch(e){Object(m.a)(e,{context:"ShopViewModel.trackPanelView"}),console.error("[SHOP] Error tracking panel view:",e)}}parsePriceToNumber(e){const t=e.replace(/[^0-9.,]/g,""),a=t.lastIndexOf(","),s=t.lastIndexOf(".");let i;return i=a>s?t.replace(/\./g,"").replace(",","."):s>a?t.replace(/,/g,""):-1!==a?t.replace(",","."):t,Number(i)||0}async trackItemClick(e,t,a){try{var s,i,r,o;let f=0,d=null;const m=(null===(s=y.default.getMaestroEventViewModel().statsViewModel)||void 0===s?void 0:s.currentGameState.value)||"unknown";if(t&&Object(l.a)(t)){var n,c,p,h;const e=null===(n=t.price)||void 0===n?void 0:n.displayRetail,a=(null===(c=t.price)||void 0===c?void 0:c.displayClearance)||(null===(p=t.price)||void 0===p?void 0:p.displaySale)||(null===(h=t.price)||void 0===h?void 0:h.displayRetail);if(a&&e){const t=this.parsePriceToNumber(e),s=this.parsePriceToNumber(a);f=t>0?Math.round(100*(1-s/t)):0,d=a}}await this.analyticsService.panelClick({type:"espnShop",name:"shop_item_clicked",metadata:{card:[e],game_state:[m],product:(null==a||null===(i=a.product)||void 0===i?void 0:i.id)||null,entity_type:[(null==a||null===(r=a.product)||void 0===r?void 0:r.type)||"unknown"],entity_name:[(null==a||null===(o=a.product)||void 0===o?void 0:o.shortDisplayName)||"unknown"],price:d,sale:[f+"%"]}})}catch(e){Object(m.a)(e,{context:"ShopViewModel.trackItemClick",item:t,section:a}),console.error("[SHOP] Error tracking shop item click:",e)}}refreshPolling(){try{if(this.useMockData)return;this.shopPolling.refresh(this.processShopData.bind(this))}catch(e){this.setTabLoadFailure()}}processShopData(e){try{var t;const a=null===(t=e.shop)||void 0===t?void 0:t[0],s=(null==a?void 0:a.sections)||[];if((null==s||!s.length)&&null!=a&&a.defaultItem)return this.errorState.value="emptyShop",this.sections.value=[],void(this.promoData.value=a.defaultItem);this.sections.value=s,this.errorState.value="none",this.hasEverSuccessfullyLoaded.value=!0,this.isDataLoading.value&&(this.isDataLoading.value=!1)}catch(e){Object(m.a)(e,{context:"ShopViewModel.processShopData"}),console.error("[SHOP] Error processing shop data:",e),this.setTabLoadFailure()}}setTabLoadFailure(){this.hasEverSuccessfullyLoaded.value||(this.errorState.value="tabLoadFailure",this.sections.value=[]),this.isDataLoading.value&&(this.isDataLoading.value=!1)}fetchNewData(){this.isDataLoading.value=!0;try{if(this.useMockData)return this.sections.value=[],void this.fetchMockData();this.refreshPolling()}catch(e){Object(m.a)(e,{context:"ShopViewModel.fetchNewData"}),console.error("[SHOP] Error fetching shop data:",e),this.setTabLoadFailure()}}fetchMockData(){let e;switch(this.mockDataType){case"nba":e=p;break;case"ncf":e=h;break;case"empty":e=f;break;case"single":e=d;break;case"nfl":default:e=c}this.processShopData(e),this.hasEverSuccessfullyLoaded.value=!0,this.isDataLoading.value=!1}clearTabLoadFailure(){this.errorState.value="none",this.shopPolling.removeLastResponseHash(),setTimeout(()=>{this.refreshPolling()},100)}}t.default=k}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{104:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return s}));const i=e=>e.toLowerCase().trim().replace(/[\s\W-]+/g,"-").replace(/^-+|-+$/g,"");function s(e){let t=0;for(let a=0;a<e.length;a++){t=(t<<5)-t+e.charCodeAt(a),t&=t}return t}},120:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));const i=(e,t,a)=>{try{const i=new URL(e);return i.searchParams.set("w",t.toString()),i.searchParams.set("h",a.toString()),i.toString()}catch(t){return console.warn("Malformed URL:",e,t),e}}},243:function(e,t,a){"use strict";a.r(t),a.d(t,"StatsViewModel",(function(){return f}));var i=a(3),s=a(34);const o={entities:{teams:{9:{id:"9",uid:"s:40~l:59~t:9",slug:"new-york-liberty",location:"New York",name:"Liberty",abbreviation:"NY",displayName:"New York Liberty",shortDisplayName:"Liberty",color:"86cebc",alternateColor:"000000",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/ny.png",statistics:[{$key:"fieldGoalPct",value:45.8,displayValue:"45.8",displayName:"Field Goal %"},{$key:"threePointFieldGoalPct",value:34.7,displayValue:"34.7",displayName:"Three Point %"}],homeAway:"away",record:"11-4",displayOrder:1},11:{id:"11",uid:"s:40~l:59~t:11",slug:"phoenix-mercury",location:"Phoenix",name:"Mercury",abbreviation:"PHX",displayName:"Phoenix Mercury",shortDisplayName:"Mercury",color:"3c286e",alternateColor:"e56020",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/phx.png",statistics:[{$key:"fieldGoalPct",value:43.1,displayValue:"43.1",displayName:"Field Goal %"},{$key:"threePointFieldGoalPct",value:34.8,displayValue:"34.8",displayName:"Three Point %"}],homeAway:"home",record:"12-4",displayOrder:2},14:{id:"14",uid:"s:40~l:59~t:14",abbreviation:"SEA",displayName:"Seattle Storm",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/sea.png"},17:{id:"17",uid:"s:40~l:59~t:17",abbreviation:"LV",displayName:"Las Vegas Aces",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/lv.png"},18:{id:"18",uid:"s:40~l:59~t:18",abbreviation:"CONN",displayName:"Connecticut Sun",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/conn.png"},19:{id:"19",uid:"s:40~l:59~t:19",abbreviation:"CHI",displayName:"Chicago Sky",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/chi.png"},20:{id:"20",uid:"s:40~l:59~t:20",abbreviation:"ATL",displayName:"Atlanta Dream",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/atl.png"},129689:{id:"129689",uid:"s:40~l:59~t:129689",abbreviation:"GS",displayName:"Golden State Valkyries",logo:"https://a.espncdn.com/i/teamlogos/wnba/500/gs.png"},130:{id:"121245",uid:"s:20~l:28~t:12",abbreviation:"KC",displayName:"Kansas City Chiefs",shortDisplayName:"Kansas City",color:"e31837",alternateColor:"ffcb05",logo:"https://a.espncdn.com/i/teamlogos/nfl/500/kc.png",homeAway:"home"},164:{id:"11232",uid:"s:20~l:28~t:12",abbreviation:"KC",displayName:"Kansas City Chiefs",shortDisplayName:"Kansas City",color:"e31837",alternateColor:"ffcb05",logo:"https://a.espncdn.com/i/teamlogos/nfl/500/kc.png",homeAway:"away"}},athletes:{2529137:{id:"2529137",uid:"s:40~l:59~a:2529137",guid:"c3d35267-fedd-d8d2-8c24-64ee7aa144ac",displayName:"Natasha Cloud",shortName:"N. Cloud",jersey:"9",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529137.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529137/natasha-cloud",text:"Player Card"}],position:{abbreviation:"G"}},4700818:{id:"2529137",uid:"s:40~l:59~a:2529137",guid:"c3d35267-fedd-d8d2-8c24-64ee7aa144ac",displayName:"Natasha Cloud",shortName:"N. Cloud",jersey:"9",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529137.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529137/natasha-cloud",text:"Player Card"}],position:{abbreviation:"G"}},4837356:{id:"2529137156425",uid:"s:40~l:59~a:2529137",guid:"c3d35267-fedd-d8d2-8c24-64ee7aa144ac",displayName:"Natasha Cloud",shortName:"N. Cloud",jersey:"9",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529137.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529137/natasha-cloud",text:"Player Card"}],position:{abbreviation:"G"}},5037871:{id:"252913653447",uid:"s:40~l:59~a:2529137",guid:"c3d35267-fedd-d8d2-8c24-64ee7aa144ac",displayName:"Natasha Cloud",shortName:"N. Cloud",jersey:"9",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529137.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529137/natasha-cloud",text:"Player Card"}],position:{abbreviation:"G"}},4873138:{id:"25275349137",uid:"s:40~l:59~a:2529137",guid:"c3d35267-fedd-d8d2-8c24-64ee7aa144ac",displayName:"Natasha Cloud",shortName:"N. Cloud",jersey:"9",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529137.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529137/natasha-cloud",text:"Player Card"}],position:{abbreviation:"G"}},2529140:{id:"2529147630",uid:"s:40~l:59~a:2529140",guid:"908608e9-31d4-62f2-dfe2-9fee9024e7e2",displayName:"Alyssa Thomas",shortName:"A. Thomas",jersey:"25",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2529140.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2529140/alyssa-thomas",text:"Player Card"}],position:{abbreviation:"F"}},2998928:{id:"29989212758",uid:"s:40~l:59~a:2998928",guid:"4d83d500-2f40-c89e-4f85-62927c5abbeb",displayName:"Breanna Stewart",shortName:"B. Stewart",jersey:"30",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2998928.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2998928/breanna-stewart",text:"Player Card"}],position:{abbreviation:"F"}},2999101:{id:"2999112756501",uid:"s:40~l:59~a:2999101",guid:"d5154a93-4a46-71af-8b55-f69328b84b54",displayName:"Jonquel Jones",shortName:"J. Jones",jersey:"35",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/2999101.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/2999101/jonquel-jones",text:"Player Card"}],position:{abbreviation:"C"}},4281929:{id:"428191234729",uid:"s:40~l:59~a:4281929",guid:"d4c403bb-a2c8-ed6b-aeaa-c290d8afea9b",displayName:"Satou Sabally",shortName:"S. Sabally",jersey:"0",headshot:"https://stitcher.espn.com/ctv/sports/basketball/leagues/wnba/athletes/4281929.jpg?w=184&h=144",links:[{rel:["playercard","desktop","athlete"],href:"https://www.espnqa.com/wnba/player/_/id/4281929/satou-sabally",text:"Player Card"}],position:{abbreviation:"F"}}}},leaders:[{displayName:"Points",name:"pointsPerGame",home:{team:{$key:"11"},athlete:{$key:"4281929",statistics:[{displayValue:"19.1",abbreviation:"PTS"},{displayValue:"39.3",abbreviation:"FG%"},{displayValue:"81.9",abbreviation:"FT%"}]}},away:{team:{$key:"9"},athlete:{$key:"2998928",statistics:[{displayValue:"20.7",abbreviation:"PTS"},{displayValue:"52.0",abbreviation:"FG%"},{displayValue:"81.6",abbreviation:"FT%"}]}}},{displayName:"Assists",name:"assistsPerGame",home:{team:{$key:"11"},athlete:{$key:"2529140",statistics:[{displayValue:"9.3",abbreviation:"AST"},{displayValue:"3.2",abbreviation:"TO"},{displayValue:"30.3",abbreviation:"MIN"}]}},away:{team:{$key:"9"},athlete:{$key:"2529137",statistics:[{displayValue:"6.5",abbreviation:"AST"},{displayValue:"2.1",abbreviation:"TO"},{displayValue:"28.3",abbreviation:"MIN"}]}}},{displayName:"Rebounds",name:"reboundsPerGame",home:{team:{$key:"11"},athlete:{$key:"4281929",statistics:[{displayValue:"8.0",abbreviation:"REB"},{displayValue:"6.5",abbreviation:"DR"},{displayValue:"1.5",abbreviation:"OR"}]}},away:{team:{$key:"9"},athlete:{$key:"2999101",statistics:[{displayValue:"9.6",abbreviation:"REB"},{displayValue:"7.7",abbreviation:"DR"},{displayValue:"1.9",abbreviation:"OR"}]}}}],header:{teams:[{$key:"11",linescores:[{displayValue:"28"},{displayValue:"33"},{displayValue:"27"},{displayValue:"18"},{displayValue:"106"}]},{$key:"9",linescores:[{displayValue:"19"},{displayValue:"24"},{displayValue:"27"},{displayValue:"21"},{displayValue:"91"}]}],linescoresHeader:["1","2","3","4","T"]},predictor:{header:"Matchup Predictor",imageUrl:"https://platform.espnqa.com/lrd/matchuppredictor/401736212",homeTeam:{team:{$key:"11"},gameProjection:"31.8"},awayTeam:{team:{$key:"9"},gameProjection:"68.2"}},winProbability:{imageUrl:"https://platform.espnqa.com/lrd/winprobability/401736212/401736212576",homeTeam:{team:{$key:"11"},winPercentage:"100"},awayTeam:{team:{$key:"9"},winPercentage:"0"}},previousGames:[{displayOrder:2,team:{$key:"11"},events:[{team:{$key:"17",homeAway:"home"},score:"76-70",gameResult:"W"},{team:{$key:"18",homeAway:"home"},score:"83-75",gameResult:"W"},{team:{$key:"9",homeAway:"home"},score:"89-81",gameResult:"W"},{team:{$key:"19",homeAway:"home"},score:"107-86",gameResult:"W"},{team:{$key:"9",homeAway:"away"},score:"106-91",gameResult:"W"}]},{displayOrder:1,team:{$key:"9"},events:[{team:{$key:"20",homeAway:"away"},score:"86-81",gameResult:"W"},{team:{$key:"11",homeAway:"away"},score:"89-81",gameResult:"L"},{team:{$key:"14",homeAway:"home"},score:"89-79",gameResult:"L"},{team:{$key:"129689",homeAway:"home"},score:"81-78",gameResult:"W"},{team:{$key:"11",homeAway:"home"},score:"106-91",gameResult:"L"}]}],gameState:"in",promotion:{title:"Serving Sports Fans. Anytime.",description:"Open the ESPN app on a mobile device to checkout more stats!",logo:"https://www.espn.com/redesign/assets/img/ictv/logo_qr/1x/logo_qr_espn.png",qrCode:"https://stitcher.espn.com/qr-code/.png?url=sportscenter%3A%2F%2Fx-callback-url%2FshowGame%3FsportName%3Dbasketball%26leagueAbbrev%3Dwnba%26gameId%3D401736212&width=200&height=200",backgroundImage:"https://www.espn.com/redesign/assets/img/ictv/bkg_qr_espn.jpg"},activeAthletes:{displayText:"Active Athletes",teams:[{team:{$key:"130"},athletes:[{$key:"4700818",statLine:"16.6 PTS, 5.2 REB"},{$key:"4837356",statLine:"4.1 AST, 2.2 TO"}]},{team:{$key:"164"},athletes:[{$key:"5037871",statLine:"19.4 PTS, 4.0 AST"},{$key:"4873138",statLine:"7.2 REB, 2.1 OR"}]}]},drives:[{id:"drive-1",team:{$key:"9"},description:"4 PLAYS, 41 YARDS, 2:15",plays:[{id:"play-1",clock:{displayValue:"8:21"},period:{number:1},type:{text:"Shotgun"},text:"I.Pacheco left tackle to PHI 20 for 24 yards (M.Epps).",start:{downDistanceText:"2nd & 5 at PHI 44"}},{id:"play-2",clock:{displayValue:"9:33"},period:{number:1},type:{text:"Shotgun"},text:"P.Mahomes pass short middle to T.Kelce to KC 48 for 20 yards (T.Edwards).",start:{downDistanceText:"1st & 10 @ KC 25"}},{id:"play-3",clock:{displayValue:"10:09"},period:{number:1},type:{text:"Shotgun"},text:"I.Pacheco up the middle to KC 28 for 3 yards (J.Hargrave).",start:{downDistanceText:"1st & 10 @ KC 25"}},{id:"play-4",clock:{displayValue:"11:15"},period:{number:1},type:{text:"Shotgun"},text:"P.Mahomes pass complete short right to T.Kelce to KC 35 for 10 yards (J.Bradberry).",start:{downDistanceText:"2nd & 10 at KC 25"}}]}],meta:{gp_topic:"gp-basketball-wnba-401736212",picker_topic:"picker-basketball-wnba",gameState:"in"}},l=e=>e&&"object"==typeof e&&"$key"in e&&"value"in e&&"displayValue"in e&&"displayName"in e,r=e=>Array.isArray(e)&&e.every(e=>(e=>e&&"object"==typeof e&&"stats"in e&&Array.isArray(e.stats))(e));var n=a(35),d=a(8),c=a(4);function u(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var i=a.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var m=class{constructor(e){u(this,"networkManager",void 0),u(this,"overrideUrl",null),this.networkManager=new n.b({externalBaseURL:e.getStatsAPIBaseURL()})}async getStatsByUrl(e){return this.networkManager.externalApiRequest({endpoint:this.getSyncEndpoint(e),method:n.a.GET,params:{},headers:{}})}pollStatsByUrl(e,t,a,i){return this.networkManager.pollExternalApiRequest({endpoint:this.getSyncEndpoint(e),interval:t,method:n.a.GET,params:{},headers:{},onData:a,onError:i})}getSyncEndpoint(e){if(this.overrideUrl)return console.log("[StatsService] Using overrideUrl:",this.overrideUrl),this.overrideUrl;const{leagueId:t,mainId:a}=this.getIdsFromPageConfig();return`/${t}/${a}/en/us/${this.formatTimeCodeForAPI(e)}`}getIdsFromPageConfig(){const e=d.default.getPageConfig();if(!e)throw new Error("Page config is null or undefined");const t=e.page.metadata,a=null==t?void 0:t.external_field_1,i=null==t?void 0:t.external_field_5;if(!a||!i){const e=Object.keys(t||{}).join(", ");throw new Error("Missing eventId or leagueId in page config metadata. Cannot build sync URL. Required fields: external_field_1 (eventId), external_field_5 (leagueId). Available fields: "+e)}const{leagueId:s,fauxcastId:o}=this.parseLeagueData(i),l=o||a;if(!l.trim()||!s.trim())throw new Error("MainId or leagueId is empty string in page config metadata");return{eventId:a,leagueId:s,mainId:l}}parseLeagueData(e){try{const t=JSON.parse(e);if(!t.leagueId)throw new Error("leagueId not found in parsed JSON");return{leagueId:t.leagueId,fauxcastId:t.fauxcastId}}catch(t){const a=new Error("Failed to parse leagueId from external_field_5. Raw value: "+e);throw Object(c.a)(a,{rawValue:e,parseError:t}),a}}formatTimeCodeForAPI(e){if(!e||0===e)return"latest";if("number"!=typeof e||isNaN(e)||!isFinite(e))return console.warn('Invalid timecode provided, using "latest":',e),"latest";try{const t=new Date(e);if(isNaN(t.getTime()))return console.warn('Invalid date from timecode, using "latest":',e),"latest";const a=Date.now();if(a-e<0)return"latest";return t.toISOString().replace(/\.\d{3}Z$/,"Z")}catch(t){return Object(c.a)(t,{timeCode:e}),console.warn('Error formatting timecode, using "latest":',e,t),"latest"}}};const h=e=>{var t,a;if(!e)return{plays:"0",yards:"0",time:""};const i=e.split(", ");return{plays:(null===(t=i[0])||void 0===t?void 0:t.split(" ")[0])||"0",yards:(null===(a=i[1])||void 0===a?void 0:a.split(" ")[0])||"0",time:i[2]||""}},p=e=>{var t;if(null==e||null===(t=e.period)||void 0===t||!t.number)return"";const a=(e=>{const t=e%100;if(t>=11&&t<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(e.period.number);return`(${e.clock.displayValue} - ${e.period.number}${a}) (${e.type.text}) ${e.text}`};var y=a(120),v=a(104);function g(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var i=a.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const b={activeAthletes:"activeAthletes",driveSummary:"drives",gameLeaders:"leaders",headerTeam:"header",matchPredictor:"predictor",playerSeasonStats:"playerStats",promotion:"promotion",recentGames:"previousGames",scoringSummary:"scoringSummary",teamStats:"entities",winProbability:"winProbability",careerMatchup:"careerMatchup",penalties:"penaltySummary"};class f extends s.a{constructor(e,t,a,s={}){super(),g(this,"isDataLoading",new i.a(!0)),g(this,"hasEverSuccessfullyLoaded",new i.a(!1)),g(this,"eventId",void 0),g(this,"statsItems",new i.a([])),g(this,"errorState",new i.a("none")),g(this,"currentGameState",new i.a("")),g(this,"statsService",void 0),g(this,"analyticsService",void 0),g(this,"useMockData",!1),g(this,"lastResponseHash",null),g(this,"currentPlayerTimeCode",null),g(this,"timecodePollingTask",null),g(this,"smartPollingTimeout",null),g(this,"timecodePollingState",{isActive:!1,currentUrl:null,lastUpdateTime:0}),g(this,"onEngage",e=>{this.analyticsService.panelClick({type:"espnStats",name:"stats_item_clicked",metadata:{card:[b[e]],game_state:[this.currentGameState.value]}})}),this.eventId=e,this.useMockData=s.useMockData||!1,this.statsService=new m(t),this.analyticsService=a}setDataToPanel(e){if("overrideUrl"in e){const t=e.overrideUrl;"string"==typeof t&&t.length>0&&(console.log("[StatsViewModel] Setting overrideUrl:",t),this.statsService.overrideUrl=t)}}async init(){if(this.useMockData)await this.fetchMockData();else{const e=this.getCurrentTimeCode();this.onUpdatePlayerTimeCode(e),this.analyticsService.panelView("espnStats")}}getCurrentTimeCode(){try{const e=d.default.getMaestroEventViewModel();if(e&&"function"==typeof e.getPlayerTimeCode)return e.getPlayerTimeCode()}catch(e){Object(c.a)(e,{context:"StatsViewModel.getCurrentTimeCode"}),console.warn("Could not get current timecode from MaestroEventViewModel:",e)}return null}cleanup(){this.stopTimecodePolling(),this.clearSmartPollingTimeout(),this.resetTimecodePollingState()}onUpdatePlayerTimeCode(e){if(this.currentPlayerTimeCode=e,!this.useMockData)try{this.performSmartPolling(e)}catch(e){Object(c.a)(e,{context:"StatsViewModel.onUpdatePlayerTimeCode"}),console.error("Error handling player timecode update:",e),this.handleTimecodeError("Error handling player timecode update",e)}}clearTabLoadFailure(){this.errorState.value="none";const e=this.getCurrentTimeCode();this.onUpdatePlayerTimeCode(e)}async performSmartPolling(e){this.clearSmartPollingTimeout(),this.stopTimecodePolling();try{const t=await this.statsService.getStatsByUrl(e);if(!t)throw new Error("API returned undefined or null response");this.processPolledData(t),this.smartPollingTimeout=window.setTimeout(()=>{this.startTimecodePolling(e),this.smartPollingTimeout=null},1e3)}catch(t){Object(c.a)(t,{context:"StatsViewModel.performSmartPolling"}),console.error("Error during smart polling immediate call:",t),this.handleTimecodeError("Error during smart polling immediate call",t),this.stopTimecodePolling(),this.startTimecodePolling(e)}}handleTimecodeError(e,t){var a;const i={context:e,errorType:(null==t||null===(a=t.constructor)||void 0===a?void 0:a.name)||"Unknown",errorMessage:t instanceof Error?t.message:String(t),timestamp:(new Date).toISOString(),currentTimecode:this.currentPlayerTimeCode,hasExistingData:this.statsItems.value.length>0,lastResponseHash:this.lastResponseHash,url:this.timecodePollingState.currentUrl};console.error(e+":",i),this.hasEverSuccessfullyLoaded.value||(this.errorState.value="tabLoadFailure")}clearSmartPollingTimeout(){this.smartPollingTimeout&&(clearTimeout(this.smartPollingTimeout),this.smartPollingTimeout=null)}resetTimecodePollingState(){this.timecodePollingState={isActive:!1,currentUrl:null,lastUpdateTime:0}}startTimecodePolling(e){this.stopTimecodePolling();try{this.timecodePollingTask=this.statsService.pollStatsByUrl(e,1e4,e=>{this.processPolledData(e)},e=>{console.error("Timecode polling error:",e),this.handleTimecodeError("Timecode polling error",e)}),this.timecodePollingState.isActive=!0}catch(e){Object(c.a)(e,{context:"StatsViewModel.startTimecodePolling"}),console.error("Error setting up timecode-based Stats polling:",e),this.handleTimecodeError("Error setting up timecode-based Stats polling",e)}}stopTimecodePolling(){this.timecodePollingTask&&(this.timecodePollingTask.stop(),this.timecodePollingTask=null),this.timecodePollingState.isActive=!1}async fetchMockData(){this.processData(o),this.hasEverSuccessfullyLoaded.value=!0,this.isDataLoading.value=!1}processPolledData(e){const t=JSON.stringify(e),a=Object(v.b)(t);this.hasEverSuccessfullyLoaded.value&&a===this.lastResponseHash||(this.lastResponseHash=a,this.hasEverSuccessfullyLoaded.value=!0,this.errorState.value="none",this.processData(e),"post"===e.gameState&&this.stopTimecodePolling())}processData(e){const t=[],a=this.parseHeaderTeams(e);a&&t.push(a);const i=this.parseMatchPredictor(e);i&&t.push(i);const s=this.parseCareerMatchup(e);s&&t.push(s);const o=this.parsePlayerSeasonStats(e);o&&t.push(o);const l=this.parseScoringSummary(e);l&&t.push(l);const r=this.parseWinProbability(e);r&&t.push(r);const n=this.parseTeamSeasonStatistics(e)||this.parseTeamsStatistics(e);n&&t.push(n);const d=this.parseDriveSummary(e);d.length>0&&t.push(...d);const c=this.parsePenalties(e);c&&t.push(c);const u=this.parseActiveAthletes(e);u&&t.push(u);const m=this.parseGameLeaders(e);m&&t.push(m);const h=this.parseRecentGames(e);h&&t.push(h);const p=this.parsePromotion(e);p&&t.push(p),this.statsItems.value=t,this.currentGameState.value=e.gameState}parseDriveSummary(e){var t;const a=null===(t=e.entities)||void 0===t?void 0:t.teams,i=e.drives;if(!a||!i||0===i.length)return[];const s=[];for(const e of i){var o;if(null==e||null===(o=e.team)||void 0===o||!o.$key)continue;const t=[...e.plays||[]].reverse(),i=t[t.length-1]||null;let l="";i&&(l=p(i));const{plays:r,time:n,yards:d}=h(e.description||""),c=a[e.team.$key];c&&s.push({id:e.id,lastPlayMarquee:l,plays:t,playsQuantity:r,team:c,time:n,type:"driveSummary",yards:d})}return s}parseTeamsStatistics(e){var t;const a=null===(t=e.entities)||void 0===t?void 0:t.teams;if(!a)return null;const i=Object.values(a).find(e=>"away"===e.homeAway),s=Object.values(a).find(e=>"home"===e.homeAway);if(!i||!s)return null;if(!i.statistics||!s.statistics)return null;const o=[];for(let e=0;e<i.statistics.length;e++){const t=i.statistics[e],a=s.statistics[e];l(t)&&l(a)&&o.push({awayTeamDisplayValue:(null==t?void 0:t.displayValue)||"0",displayName:t.displayName||"",homeTeamDisplayValue:(null==a?void 0:a.displayValue)||"0",awayTeamValue:(null==t?void 0:t.value)||0,homeTeamValue:(null==a?void 0:a.value)||0})}return o.length?{type:"teamStats",title:"Team Stats",awayTeam:{logo:i.logo,displayName:i.displayName||"",color:i.color||"",abbreviation:i.abbreviation||""},homeTeam:{logo:s.logo,displayName:s.displayName||"",color:s.color||"",abbreviation:s.abbreviation||""},statistics:o}:null}parseTeamSeasonStatistics(e){var t,a,i,s,o;const l=(null===(t=e.entities)||void 0===t?void 0:t.teams)||{};if(!(Object.keys(l).length&&e.statTeams&&e.statTeams.title&&null!==(a=e.statTeams.sections)&&void 0!==a&&a.length&&null!==(i=e.statTeams.teams)&&void 0!==i&&i.length))return null;const n=null===(s=e.statTeams.teams[0])||void 0===s?void 0:s.$key,d=null===(o=e.statTeams.teams[1])||void 0===o?void 0:o.$key;if(!n||!d)return null;const c=l[n],u=l[d];if(!u||!c)return null;const m={};return e.statTeams.sections.forEach(e=>{if(e.$key&&e.title){const i=[];if(r(u.statistics)&&r(c.statistics)){var t,a;const s=u.statistics.find(t=>t.$key===e.$key),o=c.statistics.find(t=>t.$key===e.$key);if(s&&o&&null!==(t=o.stats)&&void 0!==t&&t.length&&null!==(a=s.stats)&&void 0!==a&&a.length){for(let e=0;e<o.stats.length;e++){const t=o.stats[e],a=s.stats[e];i.push({awayTeamDisplayValue:(null==t?void 0:t.displayValue)||"0",displayName:t.displayName||"",homeTeamDisplayValue:(null==a?void 0:a.displayValue)||"0",awayTeamValue:null!=t&&t.displayValue?Number(t.displayValue):0,homeTeamValue:null!=a&&a.displayValue?Number(a.displayValue):0})}m[e.$key]={title:e.title,entries:i}}}}}),{type:"teamStats",title:e.statTeams.title,awayTeam:{abbreviation:c.abbreviation,displayName:c.displayName||"",color:c.color||"",logo:c.logo},homeTeam:{abbreviation:u.abbreviation,displayName:u.displayName||"",color:u.color||"",logo:u.logo},tabbedStatistics:m}}parseMatchPredictor(e){var t;const a=null===(t=e.entities)||void 0===t?void 0:t.teams,i=e.predictor;if(!(a&&i&&i.homeTeam&&i.awayTeam))return null;const s=a[i.homeTeam.team.$key],o=a[i.awayTeam.team.$key];if(!s||!o)return null;const l=parseFloat(i.homeTeam.gameProjection),r=parseFloat(i.awayTeam.gameProjection);return{type:"matchPredictor",header:i.header,imageUrl:i.imageUrl,awayTeam:{percentage:r,abbreviation:o.abbreviation,logo:o.logo,displayName:o.displayName||""},homeTeam:{percentage:l,abbreviation:s.abbreviation,logo:s.logo,displayName:s.displayName||""}}}parsePromotion(e){const t=e.promotion;return t?{type:"promotion",title:t.title||"",description:t.description||"",logo:t.logo||"",qrCode:t.qrCode||"",backgroundImage:t.backgroundImage||""}:null}parseCareerMatchup(e){var t;const a=e.careerMatchup,i=null===(t=e.entities)||void 0===t?void 0:t.athletes;if(!a||!a.sections)return null;const s=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e.displayName;if("string"==typeof t)return t}return""},o=a.sections.filter(e=>!!e).map(e=>({items:(e.items||[]).filter(e=>!!e).map(e=>{var t;const a=null===(t=e.athlete)||void 0===t?void 0:t.$key,o=i&&a?i[a]:void 0,l=s(e.status),r="On Deck"===l;return{status:l,type:s(e.type)||"",displayName:s(e.displayName)||"",athlete:o,isHighlighted:r}}),statistics:(e.statistics||[]).filter(e=>!!e).map(e=>({abbreviation:e.abbreviation||"",displayValue:e.displayValue||""}))}));return{type:"careerMatchup",title:a.title||"",sections:o}}parseHeaderTeams(e){return this.parseHeaderTeamsFromTeamHeader(e)||this.parseHeaderTeamsFromHeader(e)}parseHeaderTeamsFromHeader(e){var t,a;const i=(null===(t=e.header)||void 0===t?void 0:t.teams)||[];return 0===i.length?null:this.buildHeaderTeamsItem({response:e,headerTeams:i,linescoresHeader:(null===(a=e.header)||void 0===a?void 0:a.linescoresHeader)||[],linescoresRowHeader:void 0,isLiveFromHeaderSource:!1})}parseHeaderTeamsFromTeamHeader(e){var t,a,i,s,o,l,r,n;const d=(null===(t=e.header)||void 0===t?void 0:t.teams)||[],c=(null===(a=e.teamHeader)||void 0===a?void 0:a.teams)||[];if(0===c.length)return null;const u=c.some(e=>Array.isArray(e.linescores)&&e.linescores.length>0),m=((null===(i=e.teamHeader)||void 0===i||null===(s=i.linescoresHeader)||void 0===s?void 0:s.length)||0)>0;if(!u&&!m&&d.length>0)return null;const h="teamLogo"===(null===(o=e.teamHeader)||void 0===o||null===(l=o.style)||void 0===l||null===(r=l.linescores)||void 0===r?void 0:r.rowHeader)?"teamLogo":void 0;return this.buildHeaderTeamsItem({response:e,headerTeams:c,linescoresHeader:(null===(n=e.teamHeader)||void 0===n?void 0:n.linescoresHeader)||[],linescoresRowHeader:h,isLiveFromHeaderSource:u||m})}buildHeaderTeamsItem(e){var t;const{response:a,headerTeams:i,linescoresHeader:s,linescoresRowHeader:o,isLiveFromHeaderSource:r}=e,n=null===(t=a.entities)||void 0===t?void 0:t.teams;if(!n||0===i.length)return null;const d=i.find(e=>{const t=n[e.$key];return t&&"home"===t.homeAway}),c=i.find(e=>{const t=n[e.$key];return t&&"away"===t.homeAway}),u=i[0],m=i[1],h=d||m,p=c||u;if(!h||!p)return null;const y=n[h.$key],v=n[p.$key];if(!y||!v)return null;const g=[],b=new Set,f=v.statistics||[],w=y.statistics||[],k=f.filter(l),T=w.filter(l);[...k,...T].forEach(e=>{b.add(e.$key)}),b.forEach(e=>{const t=k.find(t=>t.$key===e),a=T.find(t=>t.$key===e);t&&a&&g.push({displayName:(null==t?void 0:t.displayName)||(null==a?void 0:a.displayName)||"",awayTeamValue:(null==t?void 0:t.value)||0,homeTeamValue:(null==a?void 0:a.value)||0,awayTeamDisplayValue:(null==t?void 0:t.displayValue)||"0",homeTeamDisplayValue:(null==a?void 0:a.displayValue)||"0"})});const S=e=>e.linescores&&e.linescores.length>0?e.linescores.map(e=>e.displayValue):"string"==typeof e.score&&e.score.length>0?[e.score]:[],P=e=>{if(Array.isArray(e.details)&&e.details.filter(Boolean).length>0)return e.details.filter(Boolean)},N=P(p),$=P(h);let A=s,V=S(p),C=S(h);if(A.length>0&&(V.length>0||C.length>0)&&"teamLogo"===o){const e=A.slice(-3);if((e.includes("R")||e.includes("H")||e.includes("E"))&&A.length>12){const e=3,t=A.length-e,a=9;if(t>a){const e=t-a;A=A.slice(e),V=V.slice(e),C=C.slice(e)}}}return{type:"headerTeam",linescoresHeader:A,linescoresRowHeader:o,isLive:"in"===a.gameState||"post"===a.gameState||r,statistics:g,awayTeam:{abbreviation:v.abbreviation,color:v.color,id:v.id,linescores:V,logo:v.logo,name:v.name,record:v.record,...N?{details:N}:{}},homeTeam:{abbreviation:y.abbreviation,color:y.color,id:y.id,linescores:C,logo:y.logo,name:y.name,record:y.record,...$?{details:$}:{}}}}parseRecentGames(e){var t,a,i;const s=null===(t=e.entities)||void 0===t?void 0:t.teams,o=e.previousGames;if(!s||!o||0===o.length)return null;const l=o.find(e=>1===(null==e?void 0:e.displayOrder)),r=o.find(e=>2===(null==e?void 0:e.displayOrder));if(!l||!r)return null;if(!l.events||!r.events)return null;if(null===(a=l.team)||void 0===a||!a.$key||null===(i=r.team)||void 0===i||!i.$key)return null;const n=s[l.team.$key],d=s[r.team.$key];if(!n||!d)return null;return{type:"recentGames",awayTeam:{events:[...l.events].reverse().filter(e=>{var t;return null==e||null===(t=e.team)||void 0===t?void 0:t.$key}).map(e=>{const t=s[e.team.$key];return{gameResult:e.gameResult,homeAway:e.team.homeAway,score:e.score,teamLogo:null==t?void 0:t.logo}}),logo:n.logo,name:n.shortDisplayName},homeTeam:{events:[...r.events].reverse().filter(e=>{var t;return null==e||null===(t=e.team)||void 0===t?void 0:t.$key}).map(e=>{const t=s[e.team.$key];return{gameResult:e.gameResult,homeAway:e.team.homeAway,score:e.score,teamLogo:null==t?void 0:t.logo}}),logo:d.logo,name:d.shortDisplayName}}}parseWinProbability(e){var t;const a=e.winProbability;if(!a||!a.homeTeam||!a.awayTeam)return null;const i=null===(t=e.entities)||void 0===t?void 0:t.teams;if(!i)return null;const s=i[a.homeTeam.team.$key],o=i[a.awayTeam.team.$key];return s&&o?{type:"winProbability",chartImageUrl:a.imageUrl,awayTeam:{id:o.id,abbreviation:o.abbreviation,logo:o.logo,winPercentage:a.awayTeam.winPercentage},homeTeam:{id:s.id,abbreviation:s.abbreviation,logo:s.logo,winPercentage:a.homeTeam.winPercentage}}:null}parseGameLeaders(e){var t,a;if(null===(t=e.entities)||void 0===t||!t.athletes||null===(a=e.entities)||void 0===a||!a.teams)return null;const i=e.leaders,s="pre"===e.gameState;if(!i||0===i.length)return null;const o=[];for(const t of i){var l,r,n,d,c,u;if(!t.away||!t.home)continue;if(null===(l=t.away)||void 0===l||null===(r=l.athlete)||void 0===r||!r.$key||null===(n=t.home)||void 0===n||null===(d=n.athlete)||void 0===d||!d.$key)continue;const a=e.entities.athletes[t.away.athlete.$key],i=e.entities.athletes[t.home.athlete.$key];if(!a||!i)continue;const s=t.away.athlete.statistics||[],m=t.home.athlete.statistics||[],h={displayName:t.displayName,awayAthlete:{id:a.id,displayName:a.displayName,headshot:a.headshot?Object(y.a)(a.headshot,256,144):"",position:(null===(c=a.position)||void 0===c?void 0:c.abbreviation)||"-",shortName:a.shortName,jersey:a.jersey,statistics:s},homeAthlete:{id:i.id,displayName:i.displayName,headshot:i.headshot?Object(y.a)(i.headshot,256,144):"",position:(null===(u=i.position)||void 0===u?void 0:u.abbreviation)||"-",shortName:i.shortName,jersey:i.jersey,statistics:m}};o.push(h)}return o.length?{type:"gameLeaders",items:o,displayText:s?"Season Leaders":"Game Leaders"}:null}parseActiveAthletes(e){var t;const a=e.activeAthletes,{awayTeam:i,homeTeam:s}=this.getActiveAthletesTeamInfo(e),o=[];if(null===(t=e.entities)||void 0===t||!t.athletes||!a||-1===i.index||-1===s.index)return null;for(let t=0;t<a.teams[i.index].athletes.length;t++){var l,r;const n=a.teams[i.index].athletes[t],d=a.teams[s.index].athletes[t];if(null==n||!n.$key||null==d||!d.$key)continue;const c=e.entities.athletes[n.$key],u=e.entities.athletes[d.$key];if(!c||!u)continue;const m=[],h=[],p=n.statLine||"",v=d.statLine||"";p.trim().split(",").forEach((e,t)=>{const[a,i]=e.trim().split(" "),s=v.trim().split(",")[t];if(!s)return;const[o,l]=s.trim().split(" ");m.push({displayValue:a||"0",abbreviation:i||"-",value:parseFloat(a)||0}),h.push({displayValue:o||"0",abbreviation:l||"-",value:parseFloat(o)||0})}),o.push({awayAthlete:{id:c.id,displayName:c.displayName,headshot:c.headshot?Object(y.a)(c.headshot,256,144):"",position:(null===(l=c.position)||void 0===l?void 0:l.abbreviation)||"-",shortName:c.shortName,jersey:c.jersey,statistics:m,minifiedStatistics:n.statLine},homeAthlete:{id:u.id,displayName:u.displayName,headshot:u.headshot?Object(y.a)(u.headshot,256,144):"",position:(null===(r=u.position)||void 0===r?void 0:r.abbreviation)||"-",shortName:u.shortName,jersey:u.jersey,statistics:h,minifiedStatistics:d.statLine}})}return o.length?{type:"activeAthletes",awayTeam:i,homeTeam:s,athletes:o,displayText:a.displayText}:null}getActiveAthletesTeamInfo(e){var t,a;const i=(null===(t=e.activeAthletes)||void 0===t?void 0:t.teams)||[];let s={index:-1,id:"",logo:"",name:"-"},o={index:-1,id:"",logo:"",name:"-"};const l=null===(a=e.entities)||void 0===a?void 0:a.teams;if(!l)return{awayTeam:s,homeTeam:o};for(let e=0;e<i.length;e++){const t=l[i[e].team.$key];t&&("away"===t.homeAway?s={index:e,id:t.id,logo:t.logo,name:t.name||"-"}:"home"===t.homeAway&&(o={index:e,id:t.id,logo:t.logo,name:t.name||"-"}))}return{awayTeam:s,homeTeam:o}}parseScoringSummary(e){var t,a;const i=e.scoringSummary;if(!i||!i.sections)return null;const s=null===(t=e.entities)||void 0===t?void 0:t.teams,o=null===(a=e.entities)||void 0===a?void 0:a.athletes;if((e=>e&&"object"==typeof e&&"title"in e&&"sections"in e&&e.sections&&Array.isArray(e.sections)&&e.sections.some(e=>e&&"items"in e&&Array.isArray(e.items)&&e.items.some(e=>e&&("text"in e||"shortText"in e||"header"in e))))(i)){const e=[];for(const t of i.sections){var l;if(!t.title||null===(l=t.items)||void 0===l||!l.length)continue;const a=[];for(const e of t.items){var r,n,d;if(null==e||null===(r=e.team)||void 0===r||!r.$key||null==e||null===(n=e.athlete)||void 0===n||!n.$key)continue;const t=null==s?void 0:s[e.team.$key],i=null==o?void 0:o[e.athlete.$key],l="#"+((null==i?void 0:i.jersey)||""),c=(null==i?void 0:i.shortName)||"";if(!t||!i)continue;const u=[];l&&u.push({featured:!1,title:l}),c&&u.push({featured:!0,title:c}),a.push({teamLogo:(null==t?void 0:t.logo)||"",teamName:null==t?void 0:t.abbreviation,headshot:null!=i&&i.headshot?Object(y.a)(i.headshot,200,144):void 0,athleteShortName:(null==i?void 0:i.shortName)||"",athleteJersey:(null==i?void 0:i.jersey)||"",athletePosition:(null==i||null===(d=i.position)||void 0===d?void 0:d.abbreviation)||"",text:(null==e?void 0:e.text)||"",shortText:u,header:((null==e?void 0:e.header)||[]).map((e,t)=>{var a,i;return{featured:null!==(a=e.featured)&&void 0!==a&&a,title:`${null!==(i=e.title)&&void 0!==i?i:""}${0===t?",":""}`}})})}a.length>0&&e.push({title:t.title,items:a})}return 0===e.length?null:{type:"scoringSummary",tag:"mlb",title:i.title||"Scoring Summary",sections:e}}if((e=>e&&"object"==typeof e&&"title"in e&&"sections"in e&&e.sections&&Array.isArray(e.sections)&&e.sections.every(e=>e&&"title"in e&&"items"in e&&Array.isArray(e.items)&&e.items.every(e=>e&&"clock"in e&&"title"in e&&"team"in e&&"athlete"in e)))(i)){const e=i,t=[];for(const a of e.sections||[]){const e=[];for(const t of a.items||[]){var c,u,m,h;if(null==t||null===(c=t.team)||void 0===c||!c.$key||null==t||null===(u=t.athlete)||void 0===u||!u.$key||null==t||!t.title)continue;const a=t.team&&t.team.$key?null==s?void 0:s[t.team.$key]:void 0,i=(null===(m=t.athlete)||void 0===m?void 0:m.$key)||"",l=null==o?void 0:o[i],r=t.title||"",[n,...d]=r.split(" ");let p="",v="";d.length>0&&(p=d[d.length-1],v=d.slice(0,-1).join(" "));const g=[];t.clock&&g.push({featured:!0,title:t.clock}),null!=a&&a.abbreviation&&g.push({featured:!1,title:a.abbreviation});const b=[];n&&b.push({featured:!1,title:n}),v&&b.push({featured:!0,title:v}),p&&b.push({featured:!1,title:p}),e.push({teamLogo:(null==a?void 0:a.logo)||"",teamName:(null==a?void 0:a.abbreviation)||"",header:g,text:(null==t?void 0:t.description)||"",shortText:b,headshot:null!=l&&l.headshot?Object(y.a)(l.headshot,200,144):void 0,athleteShortName:v,athletePosition:(null==l||null===(h=l.position)||void 0===h?void 0:h.abbreviation)||"",athleteJersey:n})}e.length>0&&t.push({title:(null==a?void 0:a.title)||"",items:e})}return 0===t.length?null:{type:"scoringSummary",tag:"hockey",title:e.title||"Scoring Summary",sections:t}}return null}parsePenalties(e){var t,a;const i=e.penaltySummary;if(!i||!i.sections)return null;const s=null===(t=e.entities)||void 0===t?void 0:t.teams,o=null===(a=e.entities)||void 0===a?void 0:a.athletes,l=i.sections.map(e=>{const t=e.items.filter(e=>{var t,a;return(null==e||null===(t=e.team)||void 0===t?void 0:t.$key)&&(null==e||null===(a=e.athlete)||void 0===a?void 0:a.$key)}).map(e=>{var t;const a=null==s?void 0:s[e.team.$key],i=null==o?void 0:o[e.athlete.$key],[l,...r]=e.title.split(" "),n=(null!=r?r:[]).join(" ")||"",d=[];return l&&d.push({featured:!1,title:l}),n&&d.push({featured:!0,title:n}),{teamLogo:(null==a?void 0:a.logo)||"",teamName:(null==a?void 0:a.abbreviation)||"",header:[{title:e.clock||"",featured:!1}],text:e.description||"",shortText:d,headshot:null!=i&&i.headshot?Object(y.a)(i.headshot,200,144):void 0,athleteShortName:r.join(" "),athletePosition:(null==i||null===(t=i.position)||void 0===t?void 0:t.abbreviation)||"",athleteJersey:l||""}});return{title:e.title,items:t}});return!l.length||l.every(e=>0===e.items.length)?null:{type:"penalties",tag:"penalties",title:i.title,sections:l}}parsePlayerSeasonStats(e){var t,a,i;const s=e.playerStats,o=null===(t=e.entities)||void 0===t?void 0:t.teams,l=null===(a=e.entities)||void 0===a?void 0:a.athletes;if(null==s||null===(i=s.teams)||void 0===i||!i.length||!o)return null;const r=[];for(const e of s.teams){if(!e.$key)continue;const t=o[e.$key];if(!t)continue;const a=[];for(const t of e.sections||[]){var n;if(!t.title||null===(n=t.items)||void 0===n||!n.length)continue;const e=[];for(const a of t.items){var d,c,u,m,h;if(!a.title)continue;const t=null===(d=a.athlete)||void 0===d?void 0:d.$key,i=t?null==l?void 0:l[t]:void 0,s=(null===(c=a.athlete)||void 0===c?void 0:c.statistics)||[],o=s.find(e=>e.featured);e.push({title:a.title,headshot:null!=i&&i.headshot?Object(y.a)(i.headshot,256,144):"",position:(null==i||null===(u=i.position)||void 0===u?void 0:u.abbreviation)||"",jersey:(null==i?void 0:i.jersey)||"",featuredStat:o?{displayValue:o.displayValue||"",label:o.label||""}:null,statistics:s.filter(e=>!e.featured).map(e=>({displayValue:e.displayValue||"",label:e.label||""})),playerStatus:null!=a&&a.status?{displayName:null!==(m=a.status.displayName)&&void 0!==m?m:"",type:null!==(h=a.status.type)&&void 0!==h?h:""}:null})}e.length>0&&a.push({title:t.title,items:e})}a.length>0&&r.push({teamKey:e.$key,shortDisplayName:t.shortDisplayName||t.displayName||"",color:t.color||"",sections:a})}return 0===r.length?null:{type:"playerSeasonStats",teams:r}}}t.default=f}}]);
2
2
  //# sourceMappingURL=10.maestro-web-sdk.esm.js.map