@maestro_io/maestro-web-sdk 2.1.1 → 2.1.3

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 (200) hide show
  1. package/dist/MaestroEventDelegate.js +60 -0
  2. package/dist/components/atoms/BaseButton/BaseButton.js +11 -0
  3. package/dist/components/atoms/BaseButton/index.js +2 -0
  4. package/dist/components/atoms/Image/index.js +30 -0
  5. package/dist/components/atoms/Rive/index.d.ts +1 -0
  6. package/dist/components/atoms/Rive/index.js +53 -0
  7. package/dist/components/atoms/SvgIcon/BetGeneralIcon.js +9 -0
  8. package/dist/components/atoms/SvgIcon/BetsIcon.js +11 -0
  9. package/dist/components/atoms/SvgIcon/BetsWarningIcon.js +11 -0
  10. package/dist/components/atoms/SvgIcon/CheckmarkIcon.js +6 -0
  11. package/dist/components/atoms/SvgIcon/CollapseIcon.js +6 -0
  12. package/dist/components/atoms/SvgIcon/ExpandIcon.js +6 -0
  13. package/dist/components/atoms/SvgIcon/FantasyIcon.js +8 -0
  14. package/dist/components/atoms/SvgIcon/FlameIcon.js +11 -0
  15. package/dist/components/atoms/SvgIcon/Icon.js +42 -0
  16. package/dist/components/atoms/SvgIcon/KeyPlaysIcon.js +10 -0
  17. package/dist/components/atoms/SvgIcon/MobilePhoneIcon.js +11 -0
  18. package/dist/components/atoms/SvgIcon/PlayIcon.js +8 -0
  19. package/dist/components/atoms/SvgIcon/StatsIcon.js +12 -0
  20. package/dist/components/atoms/SvgIcon/TimesIcon.js +6 -0
  21. package/dist/components/atoms/SvgIcon/WarningIcon.js +8 -0
  22. package/dist/components/atoms/SvgIcon/index.js +2 -0
  23. package/dist/components/core/App/App.js +41 -0
  24. package/dist/components/core/App/index.js +2 -0
  25. package/dist/components/core/OverlayContainer.js +58 -0
  26. package/dist/components/core/PanelManager/PanelManager.js +80 -0
  27. package/dist/components/core/PanelManager/index.js +2 -0
  28. package/dist/components/core/ScrollableContainer/FocusableItem.js +38 -0
  29. package/dist/components/core/ScrollableContainer/ScrollableContainer.js +166 -0
  30. package/dist/components/core/ScrollableContainer/index.js +2 -0
  31. package/dist/components/molecules/ActionButton/ActionButton.d.ts +1 -0
  32. package/dist/components/molecules/ActionButton/ActionButton.js +10 -0
  33. package/dist/components/molecules/ActionButton/index.js +2 -0
  34. package/dist/components/molecules/Overlay/Overlay.js +139 -0
  35. package/dist/components/molecules/Overlay/index.js +2 -0
  36. package/dist/components/molecules/PanelNavButton/PanelNavButton.d.ts +1 -0
  37. package/dist/components/molecules/PanelNavButton/PanelNavButton.js +40 -0
  38. package/dist/components/molecules/PanelNavButton/index.js +2 -0
  39. package/dist/components/molecules/SegmentButton/SegmentButton.js +10 -0
  40. package/dist/components/molecules/SegmentButton/index.js +2 -0
  41. package/dist/components/molecules/WatchButton/WatchButton.js +15 -0
  42. package/dist/components/molecules/WatchButton/index.js +2 -0
  43. package/dist/components/organisms/PanelNavigation/PanelNavigation.js +71 -0
  44. package/dist/components/organisms/PanelNavigation/index.js +2 -0
  45. package/dist/components/organisms/SegmentController/SegmentController.d.ts +2 -2
  46. package/dist/components/organisms/SegmentController/SegmentController.js +68 -0
  47. package/dist/components/organisms/SegmentController/index.d.ts +1 -1
  48. package/dist/components/organisms/SegmentController/index.js +2 -0
  49. package/dist/external/AxiosNetworkClient.js +83 -0
  50. package/dist/external/LocalStorageCacheManager.js +213 -0
  51. package/dist/external/ReactRenderer.d.ts +2 -2
  52. package/dist/external/ReactRenderer.js +86 -0
  53. package/dist/external/mocks/MockExternalNetworkClient.js +161 -0
  54. package/dist/external/ports/cacheManager.js +1 -0
  55. package/dist/external/ports/networkClient.js +1 -0
  56. package/dist/external/ports/renderer.js +1 -0
  57. package/dist/external/spatial-navigation/index.d.ts +3 -4
  58. package/dist/external/spatial-navigation/index.js +3 -0
  59. package/dist/external/spatial-navigation/measureLayout.js +30 -0
  60. package/dist/external/spatial-navigation/spatialNavigation.d.ts +2 -4
  61. package/dist/external/spatial-navigation/spatialNavigation.js +864 -0
  62. package/dist/external/spatial-navigation/utils.js +6 -0
  63. package/dist/external/spatial-navigation/visualDebugger.js +76 -0
  64. package/dist/external/spatial-navigation/withFocusable.d.ts +1 -0
  65. package/dist/external/spatial-navigation/withFocusable.js +245 -0
  66. package/dist/helpers/Observable.js +37 -0
  67. package/dist/helpers/deliver-focus.js +12 -0
  68. package/dist/index.d.ts +4 -4
  69. package/dist/index.js +192 -0
  70. package/dist/interfaces/IMaestroEvent.js +6 -0
  71. package/dist/interfaces/IMaestroEventDelegate.js +1 -0
  72. package/dist/interfaces/IMaestroManager.js +1 -0
  73. package/dist/maestro-web-sdk.umd.js +3 -3
  74. package/dist/maestro-web-sdk.umd.js.map +1 -1
  75. package/dist/models/IModel.js +1 -0
  76. package/dist/models/IPanel.js +53 -0
  77. package/dist/models/ITheme.js +20 -0
  78. package/dist/models/IWinningBet.js +1 -0
  79. package/dist/modules/bets/interfaces/IBets.js +1 -0
  80. package/dist/modules/bets/mocks.js +572 -0
  81. package/dist/modules/bets/view/BetsView.js +116 -0
  82. package/dist/modules/bets/view/HotProps/HotPropsView.d.ts +7 -6
  83. package/dist/modules/bets/view/HotProps/HotPropsView.js +139 -0
  84. package/dist/modules/bets/view/SixPack/SixPackView.d.ts +2 -2
  85. package/dist/modules/bets/view/SixPack/SixPackView.js +103 -0
  86. package/dist/modules/bets/view/TabLoadFailureView.d.ts +1 -0
  87. package/dist/modules/bets/view/TabLoadFailureView.js +12 -0
  88. package/dist/modules/bets/view/UserBets/BetResult/BetResult.js +6 -0
  89. package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +7 -6
  90. package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.js +122 -0
  91. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardEvent.js +34 -0
  92. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardFooter.js +22 -0
  93. package/dist/modules/bets/view/UserBets/Boost/Boost.js +6 -0
  94. package/dist/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.js +9 -0
  95. package/dist/modules/bets/view/UserBets/Parlay/Parlay.js +13 -0
  96. package/dist/modules/bets/view/UserBets/Straight/Straight.js +6 -0
  97. package/dist/modules/bets/view/UserBets/Teaser/Teaser.js +13 -0
  98. package/dist/modules/bets/view/UserBets/UserBetsView.js +114 -0
  99. package/dist/modules/bets/view/components/Bet/Bet.d.ts +1 -0
  100. package/dist/modules/bets/view/components/Bet/Bet.js +32 -0
  101. package/dist/modules/bets/view/components/BetPill/BetPill.js +6 -0
  102. package/dist/modules/bets/view/components/BetsCard/BetsCard.js +15 -0
  103. package/dist/modules/bets/view/components/BetsCard/BetsCardHeader.js +20 -0
  104. package/dist/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.js +14 -0
  105. package/dist/modules/bets/view/components/LocationWarning/LocationWarning.js +16 -0
  106. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +2 -2
  107. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +63 -0
  108. package/dist/modules/bets/view/components/PromoCodeBanner/index.d.ts +1 -1
  109. package/dist/modules/bets/view/components/PromoCodeBanner/index.js +1 -0
  110. package/dist/modules/bets/view-model/BetsViewModel.js +767 -0
  111. package/dist/modules/key-plays/constants.js +292 -0
  112. package/dist/modules/key-plays/interfaces/IKeyPlays.d.ts +4 -4
  113. package/dist/modules/key-plays/interfaces/IKeyPlays.js +14 -0
  114. package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.js +1 -0
  115. package/dist/modules/key-plays/view/KeyPlayCardScoreTagView.js +13 -0
  116. package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +0 -4
  117. package/dist/modules/key-plays/view/KeyPlayCardView.js +120 -0
  118. package/dist/modules/key-plays/view/KeyPlayErrorStateView.js +58 -0
  119. package/dist/modules/key-plays/view/KeyPlaysView.js +166 -0
  120. package/dist/modules/key-plays/view-model/KeyPlaysViewModel.js +182 -0
  121. package/dist/modules/stats/interfaces/IStats.d.ts +166 -0
  122. package/dist/modules/stats/interfaces/IStats.js +1 -0
  123. package/dist/modules/stats/mocks.d.ts +82 -0
  124. package/dist/modules/stats/mocks.js +686 -0
  125. package/dist/modules/stats/utils/renderTeamStatistic.d.ts +21 -0
  126. package/dist/modules/stats/utils/renderTeamStatistic.js +16 -0
  127. package/dist/modules/stats/utils.d.ts +39 -0
  128. package/dist/modules/stats/utils.js +62 -0
  129. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +34 -0
  130. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.js +78 -0
  131. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +5 -0
  132. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +27 -0
  133. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +10 -0
  134. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +15 -0
  135. package/dist/modules/stats/view/ActiveAthletes/index.d.ts +2 -0
  136. package/dist/modules/stats/view/ActiveAthletes/index.js +2 -0
  137. package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +8 -0
  138. package/dist/modules/stats/view/GameLeaders/GameLeaders.js +9 -0
  139. package/dist/modules/stats/view/GameLeaders/index.d.ts +2 -0
  140. package/dist/modules/stats/view/GameLeaders/index.js +2 -0
  141. package/dist/modules/stats/view/MatchPredictor/DonutChart/DonutChart.d.ts +17 -0
  142. package/dist/modules/stats/view/MatchPredictor/DonutChart/DonutChart.js +55 -0
  143. package/dist/modules/stats/view/MatchPredictor/DonutChart/index.d.ts +2 -0
  144. package/dist/modules/stats/view/MatchPredictor/DonutChart/index.js +1 -0
  145. package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +53 -0
  146. package/dist/modules/stats/view/MatchPredictor/MatchPredictorView.js +66 -0
  147. package/dist/modules/stats/view/MatchPredictor/index.d.ts +3 -0
  148. package/dist/modules/stats/view/MatchPredictor/index.js +2 -0
  149. package/dist/modules/stats/view/RecentGames/RecentGames.d.ts +63 -0
  150. package/dist/modules/stats/view/RecentGames/RecentGames.js +22 -0
  151. package/dist/modules/stats/view/RecentGames/index.d.ts +2 -0
  152. package/dist/modules/stats/view/RecentGames/index.js +2 -0
  153. package/dist/modules/stats/view/StatsQRCode/StatsQRCodeView.d.ts +52 -0
  154. package/dist/modules/stats/view/StatsQRCode/StatsQRCodeView.js +38 -0
  155. package/dist/modules/stats/view/StatsQRCode/index.d.ts +2 -0
  156. package/dist/modules/stats/view/StatsQRCode/index.js +1 -0
  157. package/dist/modules/stats/view/StatsView.d.ts +20 -0
  158. package/dist/modules/stats/view/StatsView.js +107 -0
  159. package/dist/modules/stats/view/TeamStats/TeamStatsView.d.ts +54 -0
  160. package/dist/modules/stats/view/TeamStats/TeamStatsView.js +69 -0
  161. package/dist/modules/stats/view/TeamStats/index.d.ts +2 -0
  162. package/dist/modules/stats/view/TeamStats/index.js +1 -0
  163. package/dist/modules/stats/view/Teams/StatsCarousel.d.ts +8 -0
  164. package/dist/modules/stats/view/Teams/StatsCarousel.js +14 -0
  165. package/dist/modules/stats/view/Teams/StatsProgressBar.d.ts +7 -0
  166. package/dist/modules/stats/view/Teams/StatsProgressBar.js +18 -0
  167. package/dist/modules/stats/view/Teams/Teams.d.ts +68 -0
  168. package/dist/modules/stats/view/Teams/Teams.js +42 -0
  169. package/dist/modules/stats/view/Teams/index.d.ts +2 -0
  170. package/dist/modules/stats/view/Teams/index.js +2 -0
  171. package/dist/modules/stats/view/WinProbability/WinProbability.d.ts +63 -0
  172. package/dist/modules/stats/view/WinProbability/WinProbability.js +27 -0
  173. package/dist/modules/stats/view/WinProbability/index.d.ts +2 -0
  174. package/dist/modules/stats/view/WinProbability/index.js +2 -0
  175. package/dist/modules/stats/view/components/AthletesStatistics/AthletesStatistics.d.ts +67 -0
  176. package/dist/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +29 -0
  177. package/dist/modules/stats/view/components/AthletesStatistics/StatisticTable.d.ts +4 -0
  178. package/dist/modules/stats/view/components/AthletesStatistics/StatisticTable.js +12 -0
  179. package/dist/modules/stats/view/components/AthletesStatistics/index.d.ts +2 -0
  180. package/dist/modules/stats/view/components/AthletesStatistics/index.js +2 -0
  181. package/dist/modules/stats/view/index.d.ts +2 -0
  182. package/dist/modules/stats/view/index.js +2 -0
  183. package/dist/modules/stats/view-model/StatsViewModel.d.ts +31 -0
  184. package/dist/modules/stats/view-model/StatsViewModel.js +90 -0
  185. package/dist/services/BetsService.js +102 -0
  186. package/dist/services/NetworkManager/NetworkManager.js +410 -0
  187. package/dist/services/NetworkManager/errors.js +45 -0
  188. package/dist/services/StatsService.d.ts +36 -0
  189. package/dist/services/StatsService.js +68 -0
  190. package/dist/services/ThemeManager/constants.js +47 -0
  191. package/dist/test-polyfills.d.ts +1 -0
  192. package/dist/test-polyfills.js +15 -0
  193. package/dist/types/OverlayTypes.js +4 -0
  194. package/dist/view-models/MaestroEventViewModel.d.ts +9 -0
  195. package/dist/view-models/MaestroEventViewModel.js +168 -0
  196. package/dist/view-models/OverlayViewModel.js +222 -0
  197. package/dist/view-models/PanelManagerViewModel.js +80 -0
  198. package/dist/view-models/ViewModel.js +32 -0
  199. package/dist/view-models/index.js +59 -0
  200. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import StatsProgressBar from '../view/Teams/StatsProgressBar';
3
+ /**
4
+ * Shared utility to render a team statistic with consistent structure
5
+ * This eliminates code duplication between Teams and TeamStatsView components
6
+ */
7
+ export const renderTeamStatistic = (props) => {
8
+ const { statisticName, firstDisplayValue, secondDisplayValue, awayProgressValue, homeProgressValue, key, classNames = {}, } = props;
9
+ const { container = 'team-stat-item', header = 'stat-header', firstValue = 'stat-value away-value', secondValue = 'stat-value home-value', statisticName: statisticNameClass = 'stat-name', } = classNames;
10
+ return (React.createElement("div", { key: key, className: container },
11
+ React.createElement("div", { className: header },
12
+ React.createElement("span", { className: firstValue }, firstDisplayValue),
13
+ React.createElement("span", { className: statisticNameClass }, statisticName),
14
+ React.createElement("span", { className: secondValue }, secondDisplayValue)),
15
+ React.createElement(StatsProgressBar, { awayTeamValue: awayProgressValue, homeTeamValue: homeProgressValue })));
16
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Utility functions for stats module
3
+ */
4
+ export interface Point {
5
+ x: number;
6
+ y: number;
7
+ }
8
+ /**
9
+ * Convert polar coordinates to cartesian coordinates
10
+ * @param centerX - Center X coordinate
11
+ * @param centerY - Center Y coordinate
12
+ * @param radius - Radius from center
13
+ * @param angleInDegrees - Angle in degrees (0 degrees is at the top)
14
+ * @returns Point with x,y coordinates
15
+ */
16
+ export declare const polarToCartesian: (centerX: number, centerY: number, radius: number, angleInDegrees: number) => Point;
17
+ /**
18
+ * Create an SVG arc path string
19
+ * @param centerX - Center X coordinate
20
+ * @param centerY - Center Y coordinate
21
+ * @param radius - Arc radius
22
+ * @param startAngle - Start angle in degrees
23
+ * @param endAngle - End angle in degrees
24
+ * @returns SVG path string for the arc
25
+ */
26
+ export declare const createArcPath: (centerX: number, centerY: number, radius: number, startAngle: number, endAngle: number) => string;
27
+ /**
28
+ * Convert percentage to angle in degrees
29
+ * @param percentage - Percentage value (0-100)
30
+ * @returns Angle in degrees (0-360)
31
+ */
32
+ export declare const percentageToAngle: (percentage: number) => number;
33
+ /**
34
+ * Get team color with fallback
35
+ * @param teamColor - Team color from API (without #)
36
+ * @param fallbackColor - Fallback color (with #)
37
+ * @returns Color string with # prefix
38
+ */
39
+ export declare const getTeamColor: (teamColor?: string, fallbackColor?: string) => string;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Utility functions for stats module
3
+ */
4
+ /**
5
+ * Convert polar coordinates to cartesian coordinates
6
+ * @param centerX - Center X coordinate
7
+ * @param centerY - Center Y coordinate
8
+ * @param radius - Radius from center
9
+ * @param angleInDegrees - Angle in degrees (0 degrees is at the top)
10
+ * @returns Point with x,y coordinates
11
+ */
12
+ export const polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
13
+ const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
14
+ return {
15
+ x: centerX + radius * Math.cos(angleInRadians),
16
+ y: centerY + radius * Math.sin(angleInRadians),
17
+ };
18
+ };
19
+ /**
20
+ * Create an SVG arc path string
21
+ * @param centerX - Center X coordinate
22
+ * @param centerY - Center Y coordinate
23
+ * @param radius - Arc radius
24
+ * @param startAngle - Start angle in degrees
25
+ * @param endAngle - End angle in degrees
26
+ * @returns SVG path string for the arc
27
+ */
28
+ export const createArcPath = (centerX, centerY, radius, startAngle, endAngle) => {
29
+ const start = polarToCartesian(centerX, centerY, radius, endAngle);
30
+ const end = polarToCartesian(centerX, centerY, radius, startAngle);
31
+ const largeArcFlag = endAngle - startAngle <= 180 ? '0' : '1';
32
+ return [
33
+ 'M',
34
+ start.x,
35
+ start.y,
36
+ 'A',
37
+ radius,
38
+ radius,
39
+ 0,
40
+ largeArcFlag,
41
+ 0,
42
+ end.x,
43
+ end.y,
44
+ ].join(' ');
45
+ };
46
+ /**
47
+ * Convert percentage to angle in degrees
48
+ * @param percentage - Percentage value (0-100)
49
+ * @returns Angle in degrees (0-360)
50
+ */
51
+ export const percentageToAngle = (percentage) => {
52
+ return (percentage / 100) * 360;
53
+ };
54
+ /**
55
+ * Get team color with fallback
56
+ * @param teamColor - Team color from API (without #)
57
+ * @param fallbackColor - Fallback color (with #)
58
+ * @returns Color string with # prefix
59
+ */
60
+ export const getTeamColor = (teamColor, fallbackColor = '#666666') => {
61
+ return teamColor ? `#${teamColor}` : fallbackColor;
62
+ };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import './ActiveAthletes.styles.css';
3
+ import { WithFocusableProps } from '@/external/spatial-navigation';
4
+ import { Direction } from '@/external/spatial-navigation/utils';
5
+ import { AthletesStatisticsItem } from '../components/AthletesStatistics/AthletesStatistics';
6
+ export type ActiveAthletesItem = {
7
+ displayText: string;
8
+ awayTeam: {
9
+ id: string;
10
+ logo: string;
11
+ name: string;
12
+ };
13
+ homeTeam: {
14
+ id: string;
15
+ logo: string;
16
+ name: string;
17
+ };
18
+ athletes: AthletesStatisticsItem[];
19
+ };
20
+ export type ActiveAthletesProps = {
21
+ item: ActiveAthletesItem;
22
+ };
23
+ declare class ActiveAthletes extends React.Component<WithFocusableProps & ActiveAthletesProps, {
24
+ expanded: boolean;
25
+ }> {
26
+ constructor(props: WithFocusableProps & ActiveAthletesProps);
27
+ onEnterPress(): void;
28
+ onAthletesStatisticsArrowPress: (index: number) => (d: Direction) => boolean;
29
+ get cardFocusKey(): string;
30
+ onAthletesStatisticsBackPress: () => void;
31
+ renderContent(): React.JSX.Element;
32
+ render(): React.JSX.Element;
33
+ }
34
+ export default ActiveAthletes;
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import './ActiveAthletes.styles.css';
3
+ import Icon from '@/components/atoms/SvgIcon';
4
+ import { withFocusable, } from '@/external/spatial-navigation';
5
+ import CollapsedAthletes from './CollapsedAthletes/CollapsedAthletes';
6
+ import ExpandedAthletes from './ExpandedAthletes/ExpandedAthletes';
7
+ import SDK from '@/index';
8
+ class ActiveAthletes extends React.Component {
9
+ constructor(props) {
10
+ super(props);
11
+ Object.defineProperty(this, "onAthletesStatisticsArrowPress", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: (index) => (d) => {
16
+ if (d === 'up' && index === 0) {
17
+ SDK.getMaestroEventViewModel().navigation.setFocus(this.cardFocusKey);
18
+ this.setState({
19
+ expanded: false,
20
+ });
21
+ return false;
22
+ }
23
+ return true;
24
+ }
25
+ });
26
+ Object.defineProperty(this, "onAthletesStatisticsBackPress", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: () => {
31
+ this.setState({
32
+ expanded: false,
33
+ }, () => {
34
+ SDK.getMaestroEventViewModel().navigation.setFocus(this.cardFocusKey);
35
+ });
36
+ }
37
+ });
38
+ this.state = {
39
+ expanded: false,
40
+ };
41
+ }
42
+ onEnterPress() {
43
+ const newValue = !this.state.expanded;
44
+ this.setState({
45
+ expanded: newValue,
46
+ }, () => {
47
+ if (newValue) {
48
+ const firstAthlete = this.props.item.athletes[0];
49
+ SDK.getMaestroEventViewModel().navigation.setFocus(`${firstAthlete.awayAthlete.id}-${firstAthlete.homeAthlete.id}-${firstAthlete.displayName}-statistics`);
50
+ }
51
+ });
52
+ }
53
+ get cardFocusKey() {
54
+ return this.props.item.displayText
55
+ .trim()
56
+ .toLowerCase()
57
+ .replace(/\s+/g, '-');
58
+ }
59
+ renderContent() {
60
+ if (this.state.expanded) {
61
+ return (React.createElement(ExpandedAthletes, { item: this.props.item, onArrowPress: this.onAthletesStatisticsArrowPress, onBackPress: this.onAthletesStatisticsBackPress }));
62
+ }
63
+ return React.createElement(CollapsedAthletes, { item: this.props.item });
64
+ }
65
+ render() {
66
+ return (React.createElement(FocusableWrapper, { displayText: this.props.item.displayText, onEnterPress: this.onEnterPress.bind(this), expanded: this.state.expanded, focusKey: this.cardFocusKey }, this.renderContent()));
67
+ }
68
+ }
69
+ const Wrapper = (props) => {
70
+ return (React.createElement("section", { className: "active-athletes focus-ring", "data-focused": props.focused },
71
+ React.createElement("div", { className: "header" },
72
+ React.createElement("h5", { className: "T05_ALT" }, props.displayText),
73
+ React.createElement("div", { className: "icon-container", "data-focused": props.focused },
74
+ React.createElement(Icon, { iconName: props.expanded ? 'collapse' : 'expand', height: 48, width: 48 }))),
75
+ props.children));
76
+ };
77
+ const FocusableWrapper = withFocusable()(Wrapper);
78
+ export default ActiveAthletes;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './CollapsedAthletes.styles.css';
3
+ import { ActiveAthletesProps } from '../ActiveAthletes';
4
+ declare const CollapsedAthletes: (props: ActiveAthletesProps) => React.JSX.Element;
5
+ export default CollapsedAthletes;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import './CollapsedAthletes.styles.css';
3
+ import Image from '@/components/atoms/Image';
4
+ const CollapsedAthletes = (props) => {
5
+ const { awayTeam, homeTeam, athletes } = props.item;
6
+ return (React.createElement("div", { className: "minified-content" },
7
+ React.createElement("div", { className: "teams-header" }, [awayTeam, homeTeam].map((team) => {
8
+ return (React.createElement("div", { className: "team-header", key: team.id },
9
+ React.createElement(Image, { src: team.logo, crossOrigin: "anonymous", alt: team.name }),
10
+ React.createElement("span", { className: "T05_ALT" }, team.name)));
11
+ })),
12
+ athletes.map((item, index) => {
13
+ return (React.createElement("div", { className: "minified-athletes", key: item.awayAthlete.id + item.homeAthlete.id },
14
+ React.createElement("div", { className: "athletes-jersey-row" }, [item.awayAthlete, item.homeAthlete].map((athlete) => {
15
+ return (React.createElement("div", { className: "T05_ALT", key: athlete.id + index + '-jersey' },
16
+ React.createElement("span", null,
17
+ "#",
18
+ athlete.jersey),
19
+ " ",
20
+ athlete.shortName));
21
+ })),
22
+ React.createElement("div", { className: "athletes-statistics-row" }, [item.awayAthlete, item.homeAthlete].map((athlete) => {
23
+ return (React.createElement("span", { key: athlete.id + index + '-statistic', className: "T02" }, athlete.minifiedStatistics || ''));
24
+ }))));
25
+ })));
26
+ };
27
+ export default CollapsedAthletes;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './ExpandedAthletes.styles.css';
3
+ import { ActiveAthletesProps } from '../ActiveAthletes';
4
+ import { Direction } from '@/external/spatial-navigation/utils';
5
+ type Props = {
6
+ onArrowPress: (index: number) => (direction: Direction) => void;
7
+ onBackPress: () => void;
8
+ } & ActiveAthletesProps;
9
+ declare const ExpandedAthletes: (props: Props) => React.JSX.Element;
10
+ export default ExpandedAthletes;
@@ -0,0 +1,15 @@
1
+ import Image from '@/components/atoms/Image';
2
+ import React from 'react';
3
+ import './ExpandedAthletes.styles.css';
4
+ import AthletesStatistics from '../../components/AthletesStatistics';
5
+ const ExpandedAthletes = (props) => {
6
+ const { awayTeam, homeTeam, athletes } = props.item;
7
+ const { onArrowPress, onBackPress } = props;
8
+ return (React.createElement("div", { className: "active-athletes-statistics" },
9
+ React.createElement("div", { className: "divider" }),
10
+ React.createElement("div", { className: "active-athletes-statistics-header" }, [awayTeam, homeTeam].map((team) => (React.createElement("div", { className: "team-header", key: team.id },
11
+ React.createElement(Image, { src: team.logo, crossOrigin: "anonymous", alt: team.name }),
12
+ React.createElement("span", { className: "T05_ALT" }, team.name))))),
13
+ athletes.map((item, index) => (React.createElement(AthletesStatistics, { key: item.awayAthlete.id + item.homeAthlete.id + item.displayName, focusKey: `${item.awayAthlete.id}-${item.homeAthlete.id}-${item.displayName}-statistics`, item: item, onArrowPress: onArrowPress(index), onBackPress: onBackPress })))));
14
+ };
15
+ export default ExpandedAthletes;
@@ -0,0 +1,2 @@
1
+ import ActiveAthletes from './ActiveAthletes';
2
+ export default ActiveAthletes;
@@ -0,0 +1,2 @@
1
+ import ActiveAthletes from './ActiveAthletes';
2
+ export default ActiveAthletes;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './GameLeaders.styles.css';
3
+ import { AthletesStatisticsItem } from '../components/AthletesStatistics/AthletesStatistics';
4
+ export type GameLeadersStatsItem = {
5
+ items: AthletesStatisticsItem[];
6
+ };
7
+ declare const GameLeaders: (props: GameLeadersStatsItem) => React.JSX.Element;
8
+ export default GameLeaders;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './GameLeaders.styles.css';
3
+ import AthletesStatistics from '../components/AthletesStatistics';
4
+ const GameLeaders = (props) => {
5
+ return (React.createElement("section", { className: "game-leaders" },
6
+ React.createElement("h5", { className: "T05_ALT" }, "Game Leaders"),
7
+ props.items.map((item, index) => (React.createElement(AthletesStatistics, { key: `${index}-${item.awayAthlete.id}`, item: item, focusKey: String(index) })))));
8
+ };
9
+ export default GameLeaders;
@@ -0,0 +1,2 @@
1
+ import GameLeaders from './GameLeaders';
2
+ export default GameLeaders;
@@ -0,0 +1,2 @@
1
+ import GameLeaders from './GameLeaders';
2
+ export default GameLeaders;
@@ -0,0 +1,17 @@
1
+ import React, { Component } from 'react';
2
+ export interface DonutChartProps {
3
+ awayPercentage: number;
4
+ homePercentage: number;
5
+ size?: number;
6
+ strokeWidth?: number;
7
+ }
8
+ declare class DonutChart extends Component<DonutChartProps> {
9
+ static defaultProps: {
10
+ size: number;
11
+ strokeWidth: number;
12
+ };
13
+ private patternId;
14
+ constructor(props: DonutChartProps);
15
+ render(): React.JSX.Element;
16
+ }
17
+ export default DonutChart;
@@ -0,0 +1,55 @@
1
+ import React, { Component } from 'react';
2
+ import { createArcPath, percentageToAngle } from '../../../utils';
3
+ class DonutChart extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ Object.defineProperty(this, "patternId", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: void 0
11
+ });
12
+ this.patternId = `homeStripes-${Math.random().toString(36).substr(2, 9)}`;
13
+ }
14
+ render() {
15
+ const { awayPercentage, size = 280, strokeWidth = 32 } = this.props;
16
+ const radius = (size - strokeWidth) / 2;
17
+ const centerX = size / 2;
18
+ const centerY = size / 2;
19
+ // Calculate angles with equal gaps between sections
20
+ const awayAngle = percentageToAngle(awayPercentage);
21
+ const homeAngle = percentageToAngle(100 - awayPercentage);
22
+ const gapAngle = 3; // 3 degree gap between sections
23
+ const totalGaps = gapAngle * 2; // Two gaps total
24
+ // Adjust angles to account for gaps
25
+ const adjustedAwayAngle = (awayAngle * (360 - totalGaps)) / 360;
26
+ const adjustedHomeAngle = (homeAngle * (360 - totalGaps)) / 360;
27
+ const startAngle = 270; // Start from top
28
+ const awayEndAngle = startAngle + adjustedAwayAngle; // Away team section
29
+ const homeStartAngle = awayEndAngle + gapAngle; // Gap after away team
30
+ const homeEndAngle = homeStartAngle + adjustedHomeAngle; // Home team section
31
+ // Use consistent text-100 color for both teams
32
+ const chartColor = 'var(--sdk-text100)';
33
+ return (React.createElement("svg", { width: size, height: size, className: "donut-svg" },
34
+ React.createElement("defs", null,
35
+ React.createElement("pattern", { id: this.patternId, patternUnits: "userSpaceOnUse", width: "6", height: "6", patternTransform: "rotate(45)" },
36
+ React.createElement("rect", { width: "1", height: "6", fill: chartColor }),
37
+ React.createElement("rect", { x: "1", width: "2", height: "6", fill: "transparent" }),
38
+ React.createElement("rect", { x: "3", width: "1", height: "6", fill: chartColor }),
39
+ React.createElement("rect", { x: "4", width: "2", height: "6", fill: "transparent" }))),
40
+ React.createElement("path", { d: createArcPath(centerX, centerY, radius, startAngle, awayEndAngle), fill: "transparent", stroke: chartColor, strokeWidth: strokeWidth, strokeLinecap: "butt" }),
41
+ React.createElement("path", { d: createArcPath(centerX, centerY, radius, homeStartAngle, homeEndAngle), fill: "transparent", stroke: `url(#${this.patternId})`, strokeWidth: strokeWidth, strokeLinecap: "butt" }),
42
+ React.createElement("path", { d: createArcPath(centerX, centerY, radius, awayEndAngle, homeStartAngle), fill: "transparent", stroke: "var(--sdk-surface4)", strokeWidth: strokeWidth, strokeLinecap: "butt" }),
43
+ React.createElement("path", { d: createArcPath(centerX, centerY, radius, homeEndAngle, startAngle + 360), fill: "transparent", stroke: "var(--sdk-surface4)", strokeWidth: strokeWidth, strokeLinecap: "butt" })));
44
+ }
45
+ }
46
+ Object.defineProperty(DonutChart, "defaultProps", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: {
51
+ size: 280,
52
+ strokeWidth: 32,
53
+ }
54
+ });
55
+ export default DonutChart;
@@ -0,0 +1,2 @@
1
+ export { default } from './DonutChart';
2
+ export { DonutChartProps } from './DonutChart';
@@ -0,0 +1 @@
1
+ export { default } from './DonutChart';
@@ -0,0 +1,53 @@
1
+ /// <reference types="prop-types" />
2
+ import React from 'react';
3
+ import './MatchPredictorView.styles.css';
4
+ import { WithFocusableProps } from '@/external/spatial-navigation';
5
+ import { Predictor, EntityMap, Team } from '../../interfaces/IStats';
6
+ export interface MatchPredictorProps {
7
+ predictor: Predictor;
8
+ teams: EntityMap<Team>;
9
+ }
10
+ declare const _default: {
11
+ new (props?: (MatchPredictorProps & WithFocusableProps) | undefined, context?: any): {
12
+ state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
13
+ navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
14
+ getChildContext(): {
15
+ parentFocusKey: string;
16
+ };
17
+ setFocus: (focusKey: string) => void;
18
+ navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
19
+ stealFocus: () => void;
20
+ onUpdateFocus: (focused: boolean) => void;
21
+ onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
22
+ onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
23
+ onEnterReleaseHandler: () => void;
24
+ onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
25
+ onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
26
+ onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
27
+ onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
28
+ componentDidMount(): void;
29
+ componentDidUpdate(): void;
30
+ componentWillUnmount(): void;
31
+ render(): React.ReactElement<MatchPredictorProps & WithFocusableProps>;
32
+ setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: MatchPredictorProps & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
33
+ forceUpdate(callBack?: (() => any) | undefined): void;
34
+ props: Readonly<{
35
+ children?: React.ReactNode;
36
+ }> & Readonly<MatchPredictorProps & WithFocusableProps>;
37
+ context: any;
38
+ refs: {
39
+ [key: string]: React.ReactInstance;
40
+ };
41
+ componentWillMount?(): void;
42
+ componentWillReceiveProps?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextContext: any): void;
43
+ shouldComponentUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
44
+ componentWillUpdate?(nextProps: Readonly<MatchPredictorProps & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
45
+ };
46
+ contextTypes: {
47
+ parentFocusKey: import("prop-types").Requireable<string>;
48
+ };
49
+ childContextTypes: {
50
+ parentFocusKey: import("prop-types").Requireable<string>;
51
+ };
52
+ };
53
+ export default _default;
@@ -0,0 +1,66 @@
1
+ import React, { Component } from 'react';
2
+ import './MatchPredictorView.styles.css';
3
+ import { withFocusable, } from '@/external/spatial-navigation';
4
+ import DonutChart from './DonutChart/DonutChart';
5
+ import Image from '@/components/atoms/Image';
6
+ class MatchPredictorView extends Component {
7
+ constructor() {
8
+ super(...arguments);
9
+ Object.defineProperty(this, "state", {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value: {
14
+ shouldRenderPredictorImage: Boolean(this.props.predictor.imageUrl),
15
+ }
16
+ });
17
+ Object.defineProperty(this, "handleImageError", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: () => {
22
+ this.setState({ shouldRenderPredictorImage: false });
23
+ }
24
+ });
25
+ }
26
+ render() {
27
+ const { predictor, teams } = this.props;
28
+ const { shouldRenderPredictorImage } = this.state;
29
+ // Get team data
30
+ const homeTeam = teams[predictor.homeTeam.team.$key];
31
+ const awayTeam = teams[predictor.awayTeam.team.$key];
32
+ // Parse percentages
33
+ const homePercentage = parseFloat(predictor.homeTeam.gameProjection);
34
+ const awayPercentage = parseFloat(predictor.awayTeam.gameProjection);
35
+ return (React.createElement("section", { className: "match-predictor-view focus-ring", "data-focused": this.props.focused },
36
+ React.createElement("div", { className: "match-predictor-header" },
37
+ React.createElement("h2", { className: "T05_ALT" }, predictor.header)),
38
+ React.createElement("div", { className: "match-predictor-percentages" },
39
+ React.createElement("div", { className: "team-percentage away-team" },
40
+ React.createElement("span", { className: "percentage-value T70" },
41
+ awayPercentage,
42
+ "%"),
43
+ React.createElement("div", { className: "team-info" },
44
+ React.createElement("div", { className: "legend-item away" },
45
+ React.createElement("div", { className: "legend-pattern away-pattern" }),
46
+ React.createElement("span", { className: "T02" }, awayTeam?.abbreviation)))),
47
+ React.createElement("div", { className: "team-percentage home-team" },
48
+ React.createElement("span", { className: "percentage-value T70" },
49
+ homePercentage,
50
+ "%"),
51
+ React.createElement("div", { className: "team-info" },
52
+ React.createElement("div", { className: "legend-item home" },
53
+ React.createElement("div", { className: "legend-pattern home-pattern" }),
54
+ React.createElement("span", { className: "T02" }, homeTeam?.abbreviation))))),
55
+ React.createElement("div", { className: "donut-chart-container" }, shouldRenderPredictorImage && predictor.imageUrl ? (React.createElement("div", { className: "actual-chart" },
56
+ React.createElement(Image, { src: predictor.imageUrl, alt: "Match Predictor Chart", className: "predictor-chart-image", onError: this.handleImageError }))) : (React.createElement("div", { className: "svg-chart-fallback" },
57
+ React.createElement("div", { className: "svg-donut-container" },
58
+ React.createElement(DonutChart, { awayPercentage: awayPercentage, homePercentage: homePercentage }),
59
+ React.createElement("div", { className: "donut-center" },
60
+ React.createElement("div", { className: "center-team-logos" },
61
+ React.createElement("div", { className: "center-logo away-center-logo" }, awayTeam?.logo ? (React.createElement(Image, { src: awayTeam.logo, alt: awayTeam.displayName, className: "center-logo-image" })) : (React.createElement("span", { className: "center-logo-fallback T30" }, awayTeam?.abbreviation))),
62
+ React.createElement("div", { className: "center-divider" }),
63
+ React.createElement("div", { className: "center-logo home-center-logo" }, homeTeam?.logo ? (React.createElement(Image, { src: homeTeam.logo, alt: homeTeam.displayName, className: "center-logo-image" })) : (React.createElement("span", { className: "center-logo-fallback T30" }, homeTeam?.abbreviation)))))))))));
64
+ }
65
+ }
66
+ export default withFocusable()(MatchPredictorView);
@@ -0,0 +1,3 @@
1
+ import MatchPredictorView from './MatchPredictorView';
2
+ export default MatchPredictorView;
3
+ export { MatchPredictorProps } from './MatchPredictorView';
@@ -0,0 +1,2 @@
1
+ import MatchPredictorView from './MatchPredictorView';
2
+ export default MatchPredictorView;
@@ -0,0 +1,63 @@
1
+ /// <reference types="prop-types" />
2
+ import { WithFocusableProps } from '@/external/spatial-navigation';
3
+ import React from 'react';
4
+ import './RecentGames.styles.css';
5
+ type PreviousGame = {
6
+ score: string;
7
+ gameResult: string;
8
+ teamLogo: string;
9
+ homeAway: string;
10
+ };
11
+ type Team = {
12
+ logo: string;
13
+ name?: string;
14
+ events: PreviousGame[];
15
+ };
16
+ export type RecentGamesStatsItem = {
17
+ awayTeam: Team;
18
+ homeTeam: Team;
19
+ };
20
+ declare const _default: {
21
+ new (props?: (RecentGamesStatsItem & WithFocusableProps) | undefined, context?: any): {
22
+ state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState;
23
+ navigation: import("../../../../external/spatial-navigation/spatialNavigation").default;
24
+ getChildContext(): {
25
+ parentFocusKey: string;
26
+ };
27
+ setFocus: (focusKey: string) => void;
28
+ navigateByDirection: (direction: import("../../../../external/spatial-navigation/utils").Direction, details?: Record<string, any>) => void;
29
+ stealFocus: () => void;
30
+ onUpdateFocus: (focused: boolean) => void;
31
+ onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;
32
+ onEnterPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
33
+ onEnterReleaseHandler: () => void;
34
+ onBackPressHandler: (details: import("../../../../external/spatial-navigation/utils").Details) => void;
35
+ onArrowPressHandler: (direction: import("../../../../external/spatial-navigation/utils").Direction, details: import("../../../../external/spatial-navigation/utils").Details) => boolean | void;
36
+ onBecameFocusedHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
37
+ onBecameBlurredHandler: (layout: import("../../../../external/spatial-navigation/utils").Layout, details: import("../../../../external/spatial-navigation/utils").Details) => void;
38
+ componentDidMount(): void;
39
+ componentDidUpdate(): void;
40
+ componentWillUnmount(): void;
41
+ render(): React.ReactElement<RecentGamesStatsItem & WithFocusableProps>;
42
+ setState<K extends keyof import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: RecentGamesStatsItem & WithFocusableProps) => import("../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
43
+ forceUpdate(callBack?: (() => any) | undefined): void;
44
+ props: Readonly<{
45
+ children?: React.ReactNode;
46
+ }> & Readonly<RecentGamesStatsItem & WithFocusableProps>;
47
+ context: any;
48
+ refs: {
49
+ [key: string]: React.ReactInstance;
50
+ };
51
+ componentWillMount?(): void;
52
+ componentWillReceiveProps?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextContext: any): void;
53
+ shouldComponentUpdate?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
54
+ componentWillUpdate?(nextProps: Readonly<RecentGamesStatsItem & WithFocusableProps>, nextState: Readonly<import("../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
55
+ };
56
+ contextTypes: {
57
+ parentFocusKey: import("prop-types").Requireable<string>;
58
+ };
59
+ childContextTypes: {
60
+ parentFocusKey: import("prop-types").Requireable<string>;
61
+ };
62
+ };
63
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { withFocusable, } from '@/external/spatial-navigation';
2
+ import React from 'react';
3
+ import './RecentGames.styles.css';
4
+ import Image from '@/components/atoms/Image';
5
+ const RecentGames = (props) => {
6
+ return (React.createElement("section", { className: "recent-games focus-ring", "data-focused": props.focused },
7
+ React.createElement("h5", { className: "T05_ALT" }, "Recent Games"),
8
+ React.createElement("div", { className: "recent-games-teams" }, [props.awayTeam, props.homeTeam].map((team, index) => (React.createElement("div", { className: "team-container", key: team.name || team.logo || index },
9
+ React.createElement(Image, { src: team.logo, alt: team.name || '', crossOrigin: "anonymous" }),
10
+ React.createElement("span", { className: "T05_ALT" }, team.name))))),
11
+ React.createElement("div", { className: "recent-games-list-group" }, [props.awayTeam, props.homeTeam].map((team, index) => (React.createElement("div", { className: "recent-games-list", key: team.name || team.logo || index }, team.events.map((event) => (React.createElement("div", { className: "recent-game-item T10", key: event.teamLogo +
12
+ event.score +
13
+ event.gameResult +
14
+ event.homeAway },
15
+ React.createElement("div", { className: "recent-game-item-team" },
16
+ React.createElement("span", null, event.homeAway === 'home' ? 'VS' : '@'),
17
+ React.createElement(Image, { src: event.teamLogo, alt: `${team.name} event ${event.score}`, crossOrigin: "anonymous" })),
18
+ React.createElement("div", { className: "recent-game-item-result" },
19
+ React.createElement("span", { "data-result": event.gameResult }, event.gameResult),
20
+ event.score))))))))));
21
+ };
22
+ export default withFocusable()(RecentGames);